当前位置:网站首页>MySQL configuration of database Series F5 load balancing
MySQL configuration of database Series F5 load balancing
2022-06-28 03:39:00 【solihawk】
The last article introduced F5 Configuration of virtual machine environment , Reference resources “ Database series F5 Load balancing configuration ”, Here we continue to introduce MySQL To configure F5 Load balancing .
2、F5 Configure load balancing
F5 Virtual machine configured 3 Network card , The information is as follows :
- VMnet2, Host only mode ,ip The address segment is 192.168.1.0, This will act as F5 Of external vlan Address
- VMnet3, Host only mode ,ip The address segment is 192.168.198.0, This will act as F5 Of the management node ip Address
- VMnet8,NAT Pattern ,ip The address segment is 192.168.112.0, Used for communication and bridging between virtual machines
2.1 To configure Platform
Initialize configuration , Enter the management node ip, To configure hostname
2.2 add to VLAN
Just add a few , Generally, two and one intranet will be added , An extranet
2.3 To configure Self-IP
Internal and external Each configuration 2 individual IP, One is floating IP
2.4 newly added monitor
F5 The default detection strategy is TCP The way ,F5 At regular intervals , Send a SYN Package to resource pool pool One of them member, Wait for the server to return SYN_ACK, Upon receipt of SYN_ACK after ,F5 Will use RST, Reset the connection . if F5 In a SYN After package , Not received within the specified time SYN_ACK, I think this is member Unavailable , No more to this member Allocate application traffic .TCP This method can only judge the target server tcp Whether the port is in listen state , Determine whether the target server has been established TCP The ability to connect , It can not be used to judge the availability of the application .
When the application is in a fake state ,Telnet The port can respond normally , But the application cannot provide services normally . Therefore, compatibility has been added MySQL Agreed monitor Detection mechanism , By connecting to mysql Library and execute SQL sentence “select 1” Return results 1 Is normal , If it fails to return normally, judge the member Unavailable .
2.5 establish pools
Create two pools, Add back-end services ip And port , Appoint monitor Test method , They are the default TCP Mode and compatibility mysql Protocol detection method .
2.6 establish Virtual Servers
establish virtual server, I.e. external service IP, and external VLAN In the same segment . At the same time, you need to configure the address forwarding setting to Auto Map, Appoint pool The name is MGR01 and MGR02.
2.7 Access service port
1) visit 192.168.1.200:3306
[[email protected] mysql]# ./bin/mysql -h192.168.1.200 -P3306 -uroot -p
Enter password:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
11 rows in set (0.22 sec)
mysql>
2) visit 192.168.1.201:3306
[[email protected] mysql]# ./bin/mysql -h192.168.1.201 -P3306 -uroot -p
Enter password:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
mysql>
2.8 View server traffic
The menu on the right ”Overview”->”Statistics”,Statistics Type Choose from ”Pools”, You can see the traffic of the corresponding server
3、F5 Load balancing policy test
1)MGR Configure multi write mode
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+----------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+----------------+-------------+--------------+
| group_replication_applier | be42da32-eb35-11ea-9505-000c2937f917 | tango-centos02 | 3306 | ONLINE |
| group_replication_applier | de623c4b-eb35-11ea-b1e4-000c2959d3e3 | tango-centos03 | 3306 | ONLINE |
| group_replication_applier | e5fb2194-eb27-11ea-b838-000c2992e812 | tango-centos01 | 3306 | ONLINE |
+---------------------------+--------------------------------------+----------------+-------------+--------------+
3 rows in set (0.00 sec)
2) Use sysbench To test
[[email protected] sysbench]# sysbench ./tests/include/oltp_legacy/select.lua --mysql-host=192.168.1.201 --mysql-port=3306 --mysql-user=root --mysql-password=password --mysql-db=sbtest --oltp-tables-count=5 --oltp-table-size=50000 --threads=100 --time=600 --report-interval=1 run
[ 6s ] thds: 100 tps: 725.29 qps: 725.29 (r/w/o: 725.29/0.00/0.00) lat (ms,95%): 144.97 err/s: 0.00 reconn/s: 0.00
[ 7s ] thds: 100 tps: 724.89 qps: 724.89 (r/w/o: 724.89/0.00/0.00) lat (ms,95%): 144.97 err/s: 0.00 reconn/s: 0.00
[ 8s ] thds: 100 tps: 732.12 qps: 732.12 (r/w/o: 732.12/0.00/0.00) lat (ms,95%): 144.97 err/s: 0.00 reconn/s: 0.00
[ 9s ] thds: 100 tps: 710.10 qps: 710.10 (r/w/o: 710.10/0.00/0.00) lat (ms,95%): 170.48 err/s: 0.00 reconn/s: 0.00
[ 10s ] thds: 100 tps: 745.56 qps: 745.56 (r/w/o: 745.56/0.00/0.00) lat (ms,95%): 153.02 err/s: 0.00 reconn/s: 0.00
[ 11s ] thds: 100 tps: 729.63 qps: 729.63 (r/w/o: 729.63/0.00/0.00) lat (ms,95%): 142.39 err/s: 0.00 reconn/s: 0.00
[ 12s ] thds: 100 tps: 730.20 qps: 730.20 (r/w/o: 730.20/0.00/0.00) lat (ms,95%): 144.97 err/s: 0.00 reconn/s: 0.00
3) Use the process of one of the nodes kill -19 command hang live , see F5 Traffic in
Because of the configuration MySQL agreement , When a process hang After living ,select 1 No normal return result ,F5 Will take this. member The status flag is unavailable , Traffic will not flow To this member.
Reference material :
- https://blog.csdn.net/weixin_37569048/article/details/100053487
- https://blog.csdn.net/qq_35611533/article/details/51917279
- https://blog.csdn.net/solihawk/article/details/120315419
Reprint please indicate the original address :https://blog.csdn.net/solihawk/article/details/120321153
The article will be synchronized in the official account. “ Shepherd's direction ” to update , Interested can pay attention to the official account , thank you !
边栏推荐
- R1 Quick Open Pressure Vessel Operation Special Operation Certificate Examination Library and Answers in 2022
- 「运维有小邓」监控文件及文件夹变更
- Websocket (simple experience version)
- ARM Development Studio build编译报错
- 【PaddleDetection】ModuleNotFoundError: No module named ‘paddle‘
- Go speed
- Set drop-down options on Excel files
- 物体上下漂浮工具
- 爱普生L3153打印机如何清洗喷头
- MySQL错误
猜你喜欢
大咖说·计算讲谈社|什么是东数西算要解决的核心问题?
View the SQL execution plan according to explain and optimize the SQL
在excel文件上设置下拉选项
2022 safety officer-c certificate examination question bank simulated examination platform operation
Lost connection repair: make "hide and seek" nowhere to hide
2022电工(初级)复训题库及在线模拟考试
[iptables & ICMP] description of ICMP Protocol in iptables default policy
Question bank and answers of special operation certificate for R1 quick opening pressure vessel operation in 2022
idea自动生成代码
Import an excel file, solve the problem of skipping blank cells without reading and moving the subscript forward, and return_ BLANK_ AS_ Null red
随机推荐
如何给Eclips自动添加作者,时间等…
国泰君安证券靠谱吗?开证券账户安全吗?
[iptables & ICMP] description of ICMP Protocol in iptables default policy
「运维有小邓」监控文件及文件夹变更
2022 electrician (elementary) recurrent training question bank and online simulation examination
Object类,以及__new__,__init__,__setattr__,__dict__
在牛客中使用JS编程题【split】
SSH框架的搭建(上)
Inference optimization implementation of tensorrt model
TypeScript 联合类型
大咖说·计算讲谈社|什么是东数西算要解决的核心问题?
力扣每日一题-第29天-575.分糖果
数据库系列之MySQL中的分页查询优化
ARM Development Studio build编译报错
Arm development studio build compilation error
Dataloader parameter collate_ Use of FN
What is the difference between slice and array in go question bank 12?
可扩展数据库(下)
Establishment of SSH Framework (Part I)
物体上下漂浮工具