使用的是 proxysql 原生自带的 galera 集群配置方案,具体配置如下:
INSERT INTO mysql_servers ( hostgroup_id, hostname, PORT, weight )
VALUES
( 2, '192.168.0.3', 3306, 100 ),
( 2, '192.168.0.4', 3306, 10 ),
( 3, '192.168.0.5', 3306, 100 );
INSERT INTO mysql_galera_hostgroups ( writer_hostgroup, backup_writer_hostgroup, reader_hostgroup, offline_hostgroup, active, max_writers, writer_is_also_reader, max_transactions_behind )
VALUES
( 2, 4, 3, 1, 1, 1, 0, 100 );
加载配置后,理论上应该 192.168.0.4 被改为 4 组,其他保持不变,但实际情况如下:
mysql> select hostgroup_id,hostname,status,weight from runtime_mysql_servers;
+--------------+-------------+--------+--------+
| hostgroup_id | hostname | status | weight |
+--------------+-------------+--------+--------+
| 2 | 192.168.0.5 | ONLINE | 100 |
| 4 | 192.168.0.3 | ONLINE | 100 |
| 4 | 192.168.0.4 | ONLINE | 10 |
+--------------+-------------+--------+--------+
.5 变成了 2 组
.3 和 .4 都变成了 4 组,这直接就懵逼了。。怎么会这样?请问是什么问题?