当前位置:网站首页>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 !
边栏推荐
- idea自动生成代码
- Go 數據類型篇(四)之浮點型與複數類型
- 導入Excel文件,解决跳過空白單元格不讀取,並且下標前移的問題,以及RETURN_BLANK_AS_NULL報紅
- 17 `bs object Node name h3 Parent ` parents get parent node ancestor node
- Relative path writing of files
- View the SQL execution plan according to explain and optimize the SQL
- Object类,以及__new__,__init__,__setattr__,__dict__
- 数据库乱码问题
- How to automatically add author, time, etc. to eclipse
- Tardigrade:Trino 解决 ETL 场景的方案
猜你喜欢

Relative path writing of files

第九章 APP项目测试(3) 测试工具

基于 LNMP 搭建个人网站的填坑之旅

剑指 Offer 47. 礼物的最大价值(DP)

__ getitem__ And__ setitem__

「运维有小邓」监控文件及文件夹变更

文件的相对路径写法

2022 safety officer-c certificate examination question bank simulated examination platform operation

2022危险化学品经营单位安全管理人员特种作业证考试题库模拟考试平台操作

17 `bs对象.节点名h3.parent` parents 获取父节点 祖先节点
随机推荐
荣耀v8 真机调试时不显示 Logcat 日志的解决办法
力扣每日一题-第29天-219.存在重复元素Ⅱ
idea自动生成代码
Ten reasons for system performance failure
ARM Development Studio build编译报错
数据库系列之MySQL和TiDB中慢日志分析
"9 No" principle and "5 measurement dimensions" of extensible system
如何获取GC(垃圾回收器)的STW(暂停)时间?
Win 10出现bitlocke恢复,蓝屏错误代码0x1600007e
matlab习题 —— 矩阵的常规运算
How to write concise code? (upper)
No result defined&nbsp…
Import an excel file, solve the problem of skipping blank cells without reading and moving the subscript forward, and return_ BLANK_ AS_ Null red
Documentation issues
SSH框架的搭建(上)
数据库乱码问题
第九章 APP项目测试(3) 测试工具
Anaconda命令用法
2022 safety officer-c certificate examination question bank simulated examination platform operation
CURDATE()和NOW()区别
