If you are thinking of using ProxySQL in our Percona XtraDB Cluster environment, I’ll explain how to use ProxySQL 2 for failover tasks.
How to Test
ProxySQL uses the “weight” column to define who is the WRITER node. For this example, I’ll use the following list of hostnames and IPs for references:
+-----------+----------------+ | node_name | ip | +-----------+----------------+ | pxc1 | 192.168.88.134 | | pxc2 | 192.168.88.125 | | pxc3 | 192.168.88.132 | +-----------+----------------+
My current WRITER node is the “pxc1” node, but how can I see who is the current WRITER? It’s easy, just run the following query:
proxysql> select hostgroup_id, comment, hostname, status, weight from runtime_mysql_servers;
This is the output: …
[Read more]