问题描述
在3个节点的galera-cluster群集前,我有2个proxysql(2.0.13)+ keepalived,在我的主机组10中,有2个galera-nodes实例为“ SHUNNED”。 我不知道为什么它们会显示为“ SHUNNED”,并且永远都不会恢复。
所以我希望在座的人能帮助我将避开的服务器重新带回环路。
我尝试过的方法: -设置var MysqL-shun_on_failures = 5000和MysqL-shun_recovery_time_sec = 10 -重新启动proxysql节点
我已与主机组10建立连接,并进行了一些查询以触发恢复,但仍然不予理。
这是来自proxysql的一些信息
Servers:
Admin> select * from runtime_MysqL_servers;
+--------------+-----------+------+-----------+---------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+-----------+------+-----------+---------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 10 | 10.4.4.21 | 3306 | 0 | SHUNNED | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 20 | 10.4.4.21 | 3306 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 20 | 10.4.4.22 | 3306 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 30 | 10.4.4.23 | 3306 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 30 | 10.4.4.22 | 3306 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 30 | 10.4.4.21 | 3306 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 10 | 10.4.4.23 | 3306 | 0 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | |
| 10 | 10.4.4.22 | 3306 | 0 | SHUNNED | 1 | 0 | 1000 | 0 | 0 | 0 | |
+--------------+-----------+------+-----------+---------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
Hostgroups:
Admin> select * from runtime_MysqL_galera_hostgroups;
+------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+--------------------+
| writer_hostgroup | backup_writer_hostgroup | reader_hostgroup | offline_hostgroup | active | max_writers | writer_is_also_reader | max_transactions_behind | comment |
+------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+--------------------+
| 10 | 20 | 30 | 9999 | 1 | 1 | 1 | 30 | galera-hostgroup-1 |
+------------------+-------------------------+------------------+-------------------+--------+-------------+-----------------------+-------------------------+--------------------+
Status:
Admin> select hostgroup,srv_host,status,ConnUsed,MaxConnUsed,Queries,Latency_us from stats.stats_MysqL_connection_pool order by srv_host;
+-----------+-----------+---------+----------+-------------+---------+------------+
| hostgroup | srv_host | status | ConnUsed | MaxConnUsed | Queries | Latency_us |
+-----------+-----------+---------+----------+-------------+---------+------------+
| 10 | 10.4.4.21 | SHUNNED | 0 | 0 | 0 | 289 |
| 30 | 10.4.4.21 | ONLINE | 0 | 0 | 0 | 289 |
| 20 | 10.4.4.21 | ONLINE | 0 | 0 | 0 | 289 |
| 10 | 10.4.4.22 | SHUNNED | 0 | 0 | 0 | 281 |
| 30 | 10.4.4.22 | ONLINE | 0 | 0 | 0 | 281 |
| 20 | 10.4.4.22 | ONLINE | 0 | 0 | 0 | 281 |
| 10 | 10.4.4.23 | ONLINE | 1 | 1 | 106 | 277 |
| 30 | 10.4.4.23 | ONLINE | 0 | 0 | 0 | 277 |
+-----------+-----------+---------+----------+-------------+---------+------------+
My ping-log:
Admin> select * from monitor.MysqL_server_ping_log order by time_start_us DESC limit 0,10;
+-----------+------+------------------+----------------------+------------+
| hostname | port | time_start_us | ping_success_time_us | ping_error |
+-----------+------+------------------+----------------------+------------+
| 10.4.4.23 | 3306 | 1597916943398296 | 257 | NULL |
| 10.4.4.21 | 3306 | 1597916943298413 | 232 | NULL |
| 10.4.4.22 | 3306 | 1597916943198499 | 276 | NULL |
| 10.4.4.22 | 3306 | 1597916935355114 | 220 | NULL |
| 10.4.4.23 | 3306 | 1597916935277079 | 259 | NULL |
| 10.4.4.21 | 3306 | 1597916935199034 | 232 | NULL |
| 10.4.4.22 | 3306 | 1597916927359456 | 175 | NULL |
| 10.4.4.21 | 3306 | 1597916927278902 | 242 | NULL |
| 10.4.4.23 | 3306 | 1597916927198335 | 302 | NULL |
| 10.4.4.21 | 3306 | 1597916919324515 | 189 | NULL |
+-----------+------+------------------+----------------------+------------+
谢谢大家。
解决方法
我找到了将其标记为“避开”的原因:
我的主机组配置的max_writers = 1-这意味着(我的作家主机组中)我的3个作家中只有一个可用,而其他2个作家应该待命,因此如果当前的作家应该失败。
这里的解释非常好-在“ ProxySQL 2.x对Galera群集的支持”下查看 https://github.com/apache/cordova-plugin-device。