目录
- 一、本节实现Proxy架构
- 二、proxysql安装配置与基本设置
- 三、配置proxysql集群-(192.168.21.171/172)
- 四、初始化配置(192.168.21.171/172)
- 五、读写分离测试
- 六、运维测试
- 七、新增Proxy节点配置-192.168.21.173(后期可以添加)
MySQL集群读写分离方案A-(MySQL+GTID+ProxySQL+Keepalive)之5/7:ProxySQL配置
一、本节实现Proxy架构
1、客户需求
需求:对MySQL主从实现读写分离
实现:利用ProxySQL实现读写分离
原理:使用Proxy的功能实现读写分离功能
2、ProxySQL是如何实现读写分离的
NOTE: The backend MySQL servers have read_only = 1 configured on all replicas. ProxySQL considers backend instances with a read_only = 0 as WRITER instances so this should only be set on your primary MySQL servers (or all primaries in case of multi-primary replication). Make sure this is properly set by running set global read_only = 1 and configuring this in the my.cnf file as ProxySQL will make routing decisions based on this value.
注意:后端MySQL服务器在所有副本上都配置了read_only=1。ProxySQL将read_only=0的后端实例视为WRITER实例,因此应仅在您的主MySQL服务器(或在多主复制的情况下的所有主服务器)上进行设置。通过运行set global read_only=1并在my.cnf文件中配置它,确保这是正确设置的,因为ProxySQL将根据这个值做出路由决策。
二、proxysql安装配置与基本设置
1、下载 proxy
(1)官网下载
https://www.percona.com/download-proxysql https://github.com/sysown/proxysql/releases https://github.com/sysown/proxysql/releases/tag/v1.4.16
(2) 私网下载
--注意:proxysql-1.4.9的版本可以实现读写分离(但不知道为什么proxysql-1.4.16不可以,可能和配置有关,后续需要单独调试。后测试是可以的。)
但1.4.9版本对于utf8mb4的字符集有些问题,建议使用1.4.16最后一个v1的版本,比较稳定。
cd /soft wget https://download.topunix.com/MySQL/Software-Cluster/Soft-Proxysql/proxysql-1.4.16-1-centos7.x86_64.rpm wget https://download.topunix.com/MySQL/Software-Cluster/Soft-Proxysql/proxysql-1.4.9-1-centos7.x86_64.rpm
2、安装前用户配置
groupadd mysql useradd -r -g mysql -s /bin/false mysql #默认用root安装,但使用mysql用户和组的权限,mysql用户不允许登录 mkdir -p /mysql/data/3306/data mkdir -p /mysql/log/3306
3、安装 proxysql
(1)安装proxysql
yum install proxysql-1.4.16-1.1.el7.x86_64.rpm -y
(2)启动/停止/状态管理(官方)
service proxysql start --启动 service proxysql stop --停止 service proxysql status --状态
(3)启动/停止/状态管理(systemctl)
这个方式启动,服务状态是Active: active (exited)。
systemctl start proxysql --启动 systemctl stop proxysql --停止 systemctl status proxysql --状态 systemctl enable proxysql --启动
4、二进制方式安装时,手动配置proxysql
(1)配置systemctl 启动方式
如果想要通过 systemd管理 ProxySQL:
[root@xuexi ~]# vim /usr/lib/systemd/system/proxysql.service Description=High Performance Advanced Proxy for MySQL After=network.target [Service] Type=simple User=mysql Group=mysql PermissionsStartOnly=true LimitNOFILE=102400 LimitCORE=1073741824 ExecStartPre=/bin/mkdir -p /var/lib/proxysql ExecStartPre=/bin/chown mysql:mysql -R /var/lib/proxysql ExecStart=/usr/bin/proxysql -f /etc/proxysql.cnf Restart=always
(2)启停管理
systemctl status proxysql systemctl enable proxysql systemctl start proxysql systemctl stop proxysql systemctl restart proxysql
5、proxysql相关信息
(1)数据目录
[root@mysqlfz01 soft]# cd /var/lib/proxysql
proxy.db 是SQLITE的数据文件,proxysql很 多东西是存储在这个迷你数据库里面的。 proxy.log 是日志文件,排查问题好地方。 proxy.pid 这个pid文件不多说了。 proxy_stats.db 是存放一统计信息stats_history proxy.cnf 是proxy的一些 静态配置项,比如一些启动选项,sqlite的数据 目录等等。
(2)进程
[root@mysqlfz01 proxy]# ps -ef|grep proxysql
(3)两个端口(配置文件可以修改)
管理端口:6032 应用端口:6033——对外提供服务端口,前端应用连接此端口进行后端mysql转发
6、注意:
proxysql的所有读写分离功能都来自于数据库的配置,而不是prxoysql.cnf,对于单机proxysql而言,默认配置即可,对于集群而言,proxysql.cnf需要进行配置集群信息。
三、配置proxysql集群-(192.168.21.171/172)
1、配置文件
(1)配置文件的作用
During start-up, ProxySQL reads its config file (if present) to determine the defined `datadir` and then tries to locate its internal database file in the specified path.
If the database is found in the specified datadir, ProxySQL will initialize its in-memory configuration from the persisted on-disk database i.e. here the disk configuration is loaded into MEMORY and is also propagated to RUNTIME. If the database file is not found (e.g. in case ProxySQL is being run for the first time or the database has been deleted) the config file is parsed and its content is loaded into MEMORY, saved to the DISK database and is also propagated to RUNTIME.
在启动过程中,ProxySQL读取其配置文件(如果存在)以确定定义的“datadir”,然后尝试在指定的路径中定位其内部数据库文件。
--如果在指定的datadir中找到数据库,ProxySQL将从持久化的磁盘数据库初始化其内存中配置,即在这里,磁盘配置加载到memory中,并传播到RUNTIME。 --如果找不到数据库文件(例如,在首次运行ProxySQL或数据库已被删除的情况下),将解析配置文件,并将其内容加载到MEMORY中,保存到DISK数据库,同时传播到RUNTIME。
(2)配置文件
配置更改如下admin_variables,proxysql_servers,其他参数默认即可。
vi /etc/proxysql.cnf
admin_variables= { admin_credentials="admin:admin;cluster01:cluster01" #配置用于实例间通讯的账号 # mysql_ifaces="127.0.0.1:6032;/tmp/proxysql_admin.sock" mysql_ifaces="0.0.0.0:6032" #全网开放登录 # refresh_interval=2000 # debug=true cluster_username="cluster01" #可以通过外部ip登录 cluster_password="cluster01" #可以通过外部ip登录 } proxysql_servers = ( { hostname="192.168.21.171" port=6032 weight=0 comment="primary" #注释 }, { hostname="192.168.21.172" port=6032 weight=0 comment="secondary" } )
2、停止proxysql并初始化数据库
两台机器同时做此处理。
systemctl stop proxysql rm -rf /var/lib/proxysql/* /etc/init.d/proxysql initial
3、重新启动proxysql服务
systemctl stop proxysql sleep 10 systemctl start proxysql systemctl status proxysql
4、登录查看启动
mysql -u admin -padmin -h 127.0.0.1 -P6032 --prompt='Admin> ' select * from proxysql_servers; select * from runtime_proxysql_servers; select * from stats_proxysql_servers_metrics;
5、设计如下三个节点的读写分离组
此时proxysql已经同步了。
192.168.21.151:3306——2000051 192.168.21.152:3306——1000152 192.168.21.153:3306——1000153 192.168.21.154:3306——1000154 192.168.21.155:3306——1000155 192.168.21.156:3306——1000156(新增测试)
另:提供一次性Proxysql-V1.4.16-配置脚本,一次性ProxysqlV2.5.5-配置脚本,下述四步骤在执行脚本后可以直接跳过。
四、初始化配置(192.168.21.171/172)
见:https://proxysql.com/documentation/ProxySQL-Configuration/
1、初始化检查(192.168.21.171/172)
通过检查三张表,确认配置是空的。mysql_servers, mysql_replication_hostgroups and mysql_query_rules tables.
SELECT * FROM mysql_servers; SELECT * from mysql_replication_hostgroups; SELECT * from mysql_query_rules;
2、添加后端数据库服务器(192.168.21.171执行)
包括主机组、主机IP,端口,权重,最大连接,最大复制,条目注释等。
insert into mysql_servers(hostgroup_id,hostname,port,weight,max_connections,max_replication_lag,comment) values(10000151,'192.168.21.151',3306,1,1000,10,'write_gwpt-mysql-proxy'); insert into mysql_servers(hostgroup_id,hostname,port,weight,max_connections,max_replication_lag,comment) values(20152155,'192.168.21.152',3306,1,1000,10,'read_gwpt-mysql-proxy'); insert into mysql_servers(hostgroup_id,hostname,port,weight,max_connections,max_replication_lag,comment) values(20152155,'192.168.21.153',3306,1,1000,10,'read_gwpt-mysql-proxy'); insert into mysql_servers(hostgroup_id,hostname,port,weight,max_connections,max_replication_lag,comment) values(20152155,'192.168.21.154',3306,1,1000,10,'read_gwpt-mysql-proxy'); insert into mysql_servers(hostgroup_id,hostname,port,weight,max_connections,max_replication_lag,comment) values(20152155,'192.168.21.155',3306,1,1000,10,'read_gwpt-mysql-proxy');
NOTE: The backend MySQL servers have read_only = 1 configured on all replicas. ProxySQL considers backend instances with a read_only = 0 as WRITER instances so this should only be set on your primary MySQL servers (or all primaries in case of multi-primary replication). Make sure this is properly set by running set global read_only = 1 and configuring this in the my.cnf file as ProxySQL will make routing decisions based on this value.
(2)查看目前只有21.171有,21.172没有同步
select * from mysql_servers;
--192.168.21.171
--192.168.21.172
3、配置监控用户并写入到proxysql中
(1)MySQL主库执行(192.168.21.151)
CREATE USER 'monitor'@'%' IDENTIFIED BY 'monitor'; GRANT USAGE, REPLICATION CLIENT ON *.* TO 'monitor'@'%'; flush privileges;
(2)在ProxySQL执行(192.168.21.171)
UPDATE global_variables SET variable_value='monitor' WHERE variable_name='mysql-monitor_username';
4、配置监控间隔(192.168.21.171)
(1)配置监控间隔
UPDATE global_variables SET variable_value='2000' WHERE variable_name IN ('mysql-monitor_connect_interval','mysql-monitor_ping_interval','mysql-monitor_read_only_interval');
SELECT * FROM global_variables WHERE variable_name LIKE 'mysql-monitor_%';
(2)生效配置并永久保存
此处并未同步至集群。
LOAD MYSQL VARIABLES TO RUNTIME;
SAVE MYSQL VARIABLES TO DISK;`
5、后端健康检查
配置生效后,请验证monitorProxySQL Admin 中数据库表中 MySQL 后端的状态:
SHOW TABLES FROM monitor;
每种检查类型都有一个专用的日志记录表,每种检查类型都应单独检查:
SELECT * FROM monitor.mysql_server_connect_log ORDER BY time_start_us DESC LIMIT 6; SELECT * FROM monitor.mysql_server_ping_log ORDER BY time_start_us DESC LIMIT 6;
6、MySQL复制组
集群拓扑更改是基于ProxySQL中配置的MySQL复制主机组进行监控的。
ProxySQL通过监视在mysql_replication_hostgroups中配置的主机组中配置的服务器上的read_only值来了解复制拓扑。
默认情况下,此表为空,应通过指定一对READER和WRITER主机组进行配置,尽管MySQL后端现在可能都在一个主机组中。
(1)配置复制组
SHOW CREATE TABLE mysql_replication_hostgroups\G; INSERT INTO mysql_replication_hostgroups (writer_hostgroup,reader_hostgroup,comment) VALUES (10000151,20152155,'cluster01');
现在,所有配置在主机组1或2中的MySQL后端服务器都将根据其read_only值放入各自的主机组中:
如果它们的read_only=0,它们将被移动到主机组1;
如果它们的read_only=1,则会移动到主机组2;
(3)应用复制组
注意:应用下述后,集群信息都进行了同步,192.168.21.171同步至了192.168.21.172
LOAD MYSQL SERVERS TO RUNTIME;
(4)查看复制组
SELECT * FROM monitor.mysql_server_read_only_log ORDER BY time_start_us DESC LIMIT 6; select * from mysql_servers;
(5)永久保存
SAVE MYSQL SERVERS TO DISK; SAVE MYSQL VARIABLES TO DISK;
7、MySQL用户配置
(1)在主数据库上创建,192.168.21.151主库执行
CREATE USER 'test'@'%' IDENTIFIED BY 'test123'; GRANT ALL ON * . * TO 'test'@'%'; FLUSH PRIVILEGES;
(2)将mysql用户更新到proxysql中
INSERT INTO mysql_users(username,password,default_hostgroup) VALUES ('test','test123',10000151);
(3)生效并永久配置
注意:应用下述后,集群信息有关用户的都进行了同步,192.168.21.171同步至了192.168.21.172
LOAD MYSQL USERS TO RUNTIME;
SAVE MYSQL USERS TO DISK;
8、查看ProxySQL主备-【此处有主备的图】
SELECT * FROM mysql_servers; SELECT * from mysql_replication_hostgroups; SELECT * from mysql_query_rules; SELECT * FROM monitor.mysql_server_ping_log ORDER BY time_start_us DESC LIMIT 6; SELECT * FROM monitor.mysql_server_connect_log ORDER BY time_start_us DESC LIMIT 6;
--21.171图
--21.172图
9、测试mysql节点端用户(可以使用此方式进行数据库连接访问)
mysql -utest -ptest123 -h 192.168.21.171 -P 6033 -e "select @@hostname"; mysql -utest -ptest123 -h 192.168.21.172 -P 6033 -e "select @@hostname";
10、功能负载测试
Sysbench 是一个有用的工具,用于验证 ProxySQL 是否正常运行并对系统性能进行基准测试。
假设您已经配置了 sysbench(请参阅此处的 Sysbench 信息),您可以使用以下命令在本地对 ProxySQL 运行负载测试:
sysbench --report-interval=5 --num-threads=4 --num-requests=0 --max-time=20 --test=tests/db/oltp.lua --mysql-user='stnduser' --mysql-password='stnduser' --oltp-table-size=10000 --mysql-host=127.0.0.1 --mysql-port=6033 run
[ output omitted ]
注意:对于旧版本的 sysbench,report-interval应删除并--db-ps-mode=disable添加。
sysbench --num-threads=4 --max-requests=0 --max-time=20 --test=tests/db/oltp.lua --mysql-user='stnduser' --mysql-password='stnduser' --oltp-table-size=10000 --mysql-host=10.10.0.1 --mysql-port=6033 --db-ps-mode=disable run [ output omitted ]
11、ProxySQL统计 信息查询(查询规则的基础)
(1)库stats;
ProxySQL 在模式中收集大量实时统计信息stats,每个表提供有关 ProxySQL 的行为和正在处理的工作负载的特定信息:
ProxySQL Admin> SHOW TABLES FROM stats;
(2)stats_mysql_connection_pool
该stats_mysql_connection_pool表显示与 MySQL 后端以及连接和总体流量相关的信息。
根据健康检查结果跟踪每台服务器的状态。
健康的服务器的状态为ONLINE,暂时删除的服务器的状态为SHUNNED,当服务器被删除(完全删除或移离主机组)时,它在内部标记为OFFLINE_HARD。
SELECT * FROM stats.stats_mysql_connection_pool;
注意:此处显示的SHUNNED_REPLICATION_LAG状态,说明从库(21.152/155)是有问题的或者说是不同步的,所以进行了状态提示。
(3)stats_mysql_commands_counters
该stats_mysql_commands_counters表返回有关执行的语句类型以及执行时间分布的详细信息:
SELECT * FROM stats_mysql_commands_counters WHERE Total_cnt;
(4)stats_mysql_query_digest
跟踪查询信息,其中stats_mysql_query_digest提供每个后端的查询计数、每个查询的响应时间以及实际查询文本以及查询摘要,查询摘要是每个查询类型的唯一标识符:
SELECT * FROM stats_mysql_query_digest ORDER BY sum_time DESC;
--可以通过简单的查询过滤掉关键查询信息,分析核心流量工作负载:
SELECT hostgroup hg, sum_time, count_star, digest_text FROM stats_mysql_query_digest ORDER BY sum_time DESC;
12、配置查询规则(读写分离规则)
从提供的信息中可以清楚地看出,所有流量都发送到 hostgroup1 上的主实例,为了将此工作负载重新路由到 hostgroup2 中的副本,需要查询规则。
(1)配置查询规则
INSERT INTO mysql_query_rules(rule_id,active,match_pattern,destination_hostgroup,apply) VALUES(10,1,'^SELECT.*FOR UPDATE$',10000151,1); INSERT INTO mysql_query_rules(rule_id,active,match_pattern,destination_hostgroup,apply) VALUES(20,1,'^SELECT',20152155,1);
--all SELECT FOR UPDATE statements will be sent to 10000151 --all other SELECT statements will be sent to 20152155 --everything else will be sent to 10000151 (the default)
(2)生效并永久配置
注意:应用下述后,集群信息有关用户的都进行了同步,192.168.21.171同步至了192.168.21.172
LOAD MYSQL QUERY RULES TO RUNTIME; SAVE MYSQL QUERY RULES TO DISK;
(3)检查生效与否
SELECT hostgroup hg, sum_time, count_star, digest_text FROM stats_mysql_query_digest ORDER BY sum_time DESC;
12、保留所有配置到磁盘
(1)写入配置到运行时和磁盘
--加载到runtime中,此时就会同步到proxysql备库
load mysql servers to runtime; load mysql users to runtime; load mysql variables to runtime; load mysql query rules to runtime;
--加载到磁盘中
save mysql servers to disk; save mysql users to disk; save mysql variables to disk; save mysql query rules to disk;
五、读写分离测试
1、数据库创建表
mysql -uroot -prootroot create database testdb; use testdb create table test12(id int,name varchar(10)); insert into test12 values(1,'LLL01'); commit;
2、测试读写分离
mysql -utest -ptest123 -h 192.168.21.171 -P 6033 -e "select @@hostname"; mysql -utest -ptest123 -h 192.168.21.172 -P 6033 -e "select @@hostname"; mysql -utest -ptest123 -h 192.168.21.171 -P 6033 -e "delete from testdb.test12 limit 1;commit;show variables like 'server_id';"; mysql -utest -ptest123 -h 192.168.21.171 -P 6033 -e "select * from testdb.test12 for update;commit;show variables like 'server_id';";
六、运维测试
参考资料:
--https://proxysql.com/documentation/proxysql-read-write-split-howto/
--https://proxysql.com/documentation/ProxySQL-Configuration/
--https://proxysql.com/documentation/getting-started/
1、查看所有节点的配置情况
(1)查看服务器配置(192.168.21.171-192.168.21.172)
select * from mysql_servers;
(2)查看全局变量
select * from global_variables;
(3)查看监控连接日志
SELECT * FROM monitor.mysql_server_ping_log ORDER BY time_start_us DESC LIMIT 6;
(4)查看链接数据库的用户
select * from mysql_users;
(5)查看链式规则
select * from mysql_query_rules;
2、启停运维
(1)通过系统服务
--启动ProxySQL:
service proxysql start
--停止 ProxySQL:
service proxysql stop
(2)通过管理界面
mysql -u admin -padmin -h 127.0.0.1 -P6032 --prompt='Admin> 'Admin>
proxysql stop;Admin>
proxysql restart;
3、查询执行运维
(1)根据总执行时间查找前 5 个查询:
SELECT digest,SUBSTR(digest_text,0,25),count_star,sum_time FROM stats_mysql_query_digest WHERE digest_text LIKE 'SELECT%' ORDER BY sum_time DESC LIMIT 5;
(2)根据计数查找前 5 个查询:
SELECT digest,SUBSTR(digest_text,0,25),count_star,sum_time FROM stats_mysql_query_digest WHERE digest_text LIKE 'SELECT%' ORDER BY count_star DESC LIMIT 5;
(3)根据最大执行时间查找前 5 个查询:
SELECT digest,SUBSTR(digest_text,0,25),count_star,sum_time,sum_time/count_star avg_time, min_time, max_time FROM stats_mysql_query_digest WHERE digest_text LIKE 'SELECT%' ORDER BY max_time DESC LIMIT 5;
(4)查找按总执行时间排序且最短执行时间至少为 1 毫秒的前 5 个查询:
SELECT digest,SUBSTR(digest_text,0,20),count_star,sum_time,sum_time/count_star avg_time, min_time, max_time FROM stats_mysql_query_digest WHERE digest_text LIKE 'SELECT%' AND min_time > 1000 ORDER BY sum_time DESC LIMIT 5;
(5)找到按总执行时间排序的前 5 个查询,平均执行时间至少为 1 秒。还显示总执行时间的百分比:
SELECT digest,SUBSTR(digest_text,0,25),count_star,sum_time,sum_time/count_star avg_time, ROUND(sum_time*100.00/(SELECT SUM(sum_time) FROM stats_mysql_query_digest),3) pct FROM stats_mysql_query_digest WHERE digest_text LIKE 'SELECT%' AND sum_time/count_star > 1000000 ORDER BY sum_time DESC LIMIT 5;
(6)找到按总执行时间排序的前 5 个查询,平均执行时间至少为 15 毫秒,并显示占总执行时间的百分比:
SELECT digest,SUBSTR(digest_text,0,25),count_star,sum_time,sum_time/count_star avg_time, ROUND(sum_time*100.00/(SELECT SUM(sum_time) FROM stats_mysql_query_digest WHERE digest_text LIKE 'SELECT%'),3) pct FROM stats_mysql_query_digest WHERE digest_text LIKE 'SELECT%' AND sum_time/count_star > 15000 ORDER BY sum_time DESC LIMIT 5;
七、新增Proxy节点配置-192.168.21.173(后期可以添加)
1、安装proxysql-192.168.21.173
cd /soft rpm -ivh proxysql-1.4.9-1-centos7.x86_64.rpm systemctl status proxysql systemctl enable proxysql systemctl start proxysql ps -ef|grep proxysql
2、配置新主机(192.168.21.173执行)
(1)配置全局变量
mysql -uadmin -padmin -h127.0.0.1 -P6032 update global_variables set variable_value="admin:admin;cluster01:cluster01" where variable_name ='admin-admin_credentials'; update global_variables set variable_value="cluster01" where variable_name ='admin-cluster_username'; update global_variables set variable_value="cluster01" where variable_name ='admin-cluster_password';
(2)配置proxysql_servers变量-新主机:
insert into proxysql_servers(hostname,port,weight,comment) values ('192.168.21.171',6032,0,'proxysql171'), ('192.168.21.172',6032,0,'proxysql172'), ('192.168.21.156',6032,0,'proxysql156'); select * from proxysql_servers;
3、更新配置原171,172两台主机:
update proxysql_servers set comment='proxysql171' where hostname='192.168.21.171'; update proxysql_servers set comment='proxysql172' where hostname='192.168.21.172'; insert into proxysql_servers(hostname,port,weight,comment) values ('192.168.21.173',6032,0,'proxysql173');
4、配置171,172,173三台主机:
load admin variables to runtime; load proxysql servers to runtime; save admin variables to disk; save proxysql servers to disk;
5、加载更新171主机:
load mysql servers to runtime; load mysql users to runtime; load mysql variables to runtime; load mysql query rules to runtime;
6、173主机:
select * from mysql_servers; select * from mysql_users; select * from mysql_query_rules;
insert into mysql_users(username,password,active,default_hostgroup,transaction_persistent) values('test','test123',1,2000051,1); load mysql users to runtime; save mysql users to disk;
7、再到173上测试
select * from mysql_users;
测试:
mysql -utest -ptest123 -h 192.168.21.173 -P 6033 -e "select @@hostname"; mysql -utest -ptest123 -h 192.168.21.171 -P 6033 -e "select @@hostname"; mysql -utest -ptest123 -h 192.168.21.172 -P 6033 -e "select @@hostname";
select hostgroup,schemaname,username,substr(digest_text,120,-120),count_star from stats_mysql_query_digest ORDER BY sum_time DESC;
8、最后更新配置文件(3台机),下次重启生效
vi /etc/proxysql.cnf
admin_variables = { admin_credentials="admin:admin;cluster01:cluster01" mysql_ifaces="0.0.0.0:6032" cluster_username="cluster01" cluster_password="cluster01" cluster_check_interval_ms=200 cluster_check_status_frequency=100 cluster_mysql_query_rules_save_to_disk=true cluster_mysql_servers_save_to_disk=true cluster_mysql_users_save_to_disk=true cluster_proxysql_servers_save_to_disk=true cluster_mysql_query_rules_diffs_before_sync=3 cluster_mysql_servers_diffs_before_sync=3 cluster_mysql_users_diffs_before_sync=3 cluster_proxysql_servers_diffs_before_sync=3 } proxysql_servers = ( { hostname="192.168.21.171" port=6032 comment="proxysql171" }, { hostname="192.168.21.172" port=6032 comment="proxysql172" }, { hostname="192.168.21.173" port=6032 comment="proxysql173" } )