当前位置:网站首页>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 !
边栏推荐
- Win10 如何删除系统盘大文件hiberfil.sys
- Set drop-down options on Excel files
- 【小程序】使用font-awesome字体图标的解决文案(图文)
- 电子地图坐标系统研究整理
- Win 10出现bitlocke恢复,蓝屏错误代码0x1600007e
- Solution to not displaying logcat logs during debugging of glory V8 real machine
- Is it safe to buy stocks and open an account through the account opening link of the broker manager? Want to open an account for stock trading
- What are the good practices of cloud cost optimization?
- What are the technologies to be mastered in the test? Database design for software testing
- Websocket (simple experience version)
猜你喜欢

基于 WPF 的酷炫 GUI 窗口的简易实现

云应用、服务的“5层”架构

Object class, and__ new__,__ init__,__ setattr__,__ dict__
![Redis cluster setup [simple]](/img/20/9974a290f8c5d346e2b404b48b02e5.png)
Redis cluster setup [simple]

Inference optimization implementation of tensorrt model

Why is the service implementation class always red

Lost connection repair: make "hide and seek" nowhere to hide

数据库系列之InnoDB中在线DDL实现机制

2022年R1快開門式壓力容器操作特種作業證考試題庫及答案

Websocket (simple experience version)
随机推荐
Use js programming questions [split] in Niuke
Hot! Yolov6's fast and accurate target detection framework is open source (with source code download)
启牛商学院赠送证券账户是真的吗?开户到底安不安全呢
Severe Tire Damage:世界上第一个在互联网上直播的摇滚乐队
database
WARN: SQL Error: …
【PaddleDetection】ModuleNotFoundError: No module named ‘paddle‘
kubernetes资源对象介绍及常用命令
同样是MB,差距怎么这么大呢?
matlab习题 —— 数据的基本处理
Go 数据类型篇(四)之浮点型与复数类型
数据库的迁移
可扩展系统的“9不”原则和“5个”衡量维度
Solution to not displaying logcat logs during debugging of glory V8 real machine
GAMES104 作业2-ColorGrading
可扩展存储系统(上)
Inference optimization implementation of tensorrt model
What are the good practices of cloud cost optimization?
在牛客中使用JS编程题【split】
新手开哪家的证券账户是比较好?股票开户安全吗
