ProxySQL – Add Host group or Server

ProxySQL is a powerful software load balancer and an open-source database protocol-aware proxy for MySQL that provides high performance, high availability, and high availability.

You will learn how to add a host group or server to ProxySQL in this post, as well as how to verify its status.

— Adding a server or host group.

INSERT INTO mysql_servers (
hostgroup_id, hostname, port, status, weight, compression, max_connections, max_replication_lag)
VALUES ( 2, ‘db.xyzinstance.com’, 3306, ‘ONLINE’, 1, 0, 1500, 0);

LOAD MYSQL SERVERS TO RUNTIME;
SAVE MYSQL SERVERS TO DISK;

Run the following commands to confirm that the host group and server are correctly added and that they are operational.

SELECT * FROM mysql_servers;

SELECT hostgroup hg, srv_host, `status`, ConnUsed, ConnFree, ConnOK, ConnERR
FROM stats_mysql_connection_pool;

Your server and host group are operational if the output for both statements displays ONLINE. If the status is SHUNNING, the specified IP address or server host is wrong. In these situations, make sure your DNS and CNAME entries are accurate.

Leave a Reply