Percona/ProxySQL with modified scripts intended for use with docker swarm and galera cluster
1.2K
In addition to the requirements for percona/proxysql, this will need:
Environment Variables (with examples): CLUSTER_NAME: MariaDB_Galera DISCOVERY_SERVICE: "etcd1:2379,etcd2:2379,etcd3:2379" ADMIN_CREDENTIALS: admin:admin CLUSTER_CREDENTIALS: clusterusername:clusterpassword
A working etcd cluster of at least 3 nodes with a "galera" root directory and a "proxysql" root directory. (TODO: make these environment variables)
Extra scripts in /usr/bin/: add_cluster_nodes.sh - adds mysql cluster nodes and proxysql nodes, updates admin and cluster credentials in proxysql proxysql_report_status.sh - reports the node's IP to etcd at regular intervals
There is a delay of 15 seconds before Report Status starts to allow Proxysql to start on all nodes. There is a delay of 45 seconds before Add Cluster Nodes starts to allow all nodes to report into etcd.
To check the scripts have run correctly:
Check in proxysql admin interface on each node:
SELECT * FROM mysql_servers; SELECT * FROM proxysql_servers; SELECT * FROM global_variables;
Check everything is online: SELECT * FROM monitor.mysql_server_ping_log ORDER BY time_start_us DESC LIMIT 10; SELECT * FROM stats.stats_mysql_connection_pool;
If there are any issues, you can run the Add Cluster Nodes script manually: Login to the proxysql container shell on each node and run
/usr/bin/add_cluster_nodes.sh
An attempt to add a cluster already added will fail as it won't be unique so the script is safe to run multiple times.
Ensure your etcd cluster is clean!
Content type
Image
Digest
Size
110.4 MB
Last updated
over 7 years ago
docker pull playbackgames/playback-proxysql