I deployed ProxySQL and MySQL on Kubernetes according to the official documentation, but it always ends up being configured in multi-primary (multi-writer) mode. How can I resolve this problem?
SELECT hostgroup_id, hostname, status FROM mysql_servers ORDER BY hostgroup_id;
±-------------±--------------------------------------------------±-------+
| hostgroup_id | hostname | status |
±-------------±--------------------------------------------------±-------+
| 10 | cluster1-pxc-0.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 10 | cluster1-pxc-1.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 10 | cluster1-pxc-2.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 11 | cluster1-pxc-0.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 11 | cluster1-pxc-1.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 11 | cluster1-pxc-2.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 12 | cluster1-pxc-1.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 12 | cluster1-pxc-2.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
±-------------±--------------------------------------------------±-------+
Welcome to Percona Forum @Arsenal_Dong ,
I see that you’re querying mysql_servers table. That’s for configuration but when you “apply that configuration”, proxysql loads it to runtime and that is the table you should check for active status.
Please rerun your query as:
SELECT hostgroup_id, hostname, status FROM runtime_mysql_servers ORDER BY hostgroup_id;
Thanks,
K
Refer:
Hi, K
Thanks for your answer and reference link sharing!
Below is the result to query table runtime_mysql_servers:
mysql> SELECT hostgroup_id, hostname, status FROM runtime_mysql_servers ORDER BY hostgroup_id;
±-------------±--------------------------------------------------±--------+
| hostgroup_id | hostname | status |
±-------------±--------------------------------------------------±--------+
| 10 | cluster1-pxc-0.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 10 | cluster1-pxc-1.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 10 | cluster1-pxc-2.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 11 | cluster1-pxc-0.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 11 | cluster1-pxc-1.cluster1-pxc.pxc.svc.cluster.local | SHUNNED |
| 11 | cluster1-pxc-2.cluster1-pxc.pxc.svc.cluster.local | SHUNNED |
| 12 | cluster1-pxc-1.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
| 12 | cluster1-pxc-2.cluster1-pxc.pxc.svc.cluster.local | ONLINE |
±-------------±--------------------------------------------------±--------+
looks like 3 nodes all be written nodes, right?
hmmm! Can you share galera hostgroups configuration? (or the steps that you followed to set this up)
select * from runtime_mysql_galera_hostgroups;
So as per your configuration 11 is writer hostgroup. There you only have 1 node ONLINE. Does this looks OK to you? I think you’re wrongly looking at 10.
Thanks,
K
Ops! It’s my fault. Thanks for your patience guidance!
