ProxySQL is a popular database proxy for MySQL/MariaDB servers. This focuses on the possible High availability options for ProxySQL and operations of inbuilt clustering feature in ProxySQL. This tech talk was presented at Mydbops Database Meetup on 27-04-2019 by Aakash M, Database Administrator with Mydbops and Vignesh Prabhu, Database Administrator with Mydbops.
2. About Us
2
Aakash .M
Certified MySQL 5.7 DBA, Mydbops
Interested on MySQL Optimization and High Availability systems.
Active MySQL Blogger.
LinkedIn :
https://www.linkedin.com/in/aakash-muthuramalingam-520a77129
Vignesh Prabhu .S
Certified MySQL 5.7 DBA, Mydbops
Interested on MySQL performance and High Availability systems.
Active MySQL Blogger.
LinkedIn : https://www.linkedin.com/in/vignesh-prabhu-s-445827163
3. About Mydbops
● Founded in 2015, HQ in Bangalore India with 150+ customer base across the globe.
● Mydbops is on Database Consulting with core specialization on MySQL and MongoDB Administration and
Support.
● We have expert team with 20+ certified DBA’s providing full time support and currently managing 300+
servers on premises and cloud.
● We help organisations to architect and scale systems in MySQL/MongoDB by implementing the advanced
technologies in industry which are completely open source.
● We are a leading solution provider in the market for all sort of cloud based database deployments and
management.
3
7. Proxysql Introduction
● Proxysql is developed by René Cannaò, who is one of the MySQL Support Engineer.
● Initial release 1.1.0
● Released in the year December 2015
● Latest release 2.0.4
● Take over the failures of the Reverse proxies.
7
17. Proxysql Clustering
● Introduced in 1.4.2(Beta)
● Apply Changes from any node
● Easy to make configuration changes for multiple Servers
● Automatic Node Rejoining
● Easy to add new nodes
17
18. Prerequisite:
1) Minimum two nodes for proxysql installation.
2) Proxysql with version 1.4.2 or higher.
3) Port Opening - 6032
Pre-Requisites
18
27. Flow from Log file:
● ProxySQL detected a change in the checksum for table mysql_users
● MySQL Users are fetched from 172.16.3.130:6032
● MySQL Users are loaded to runtime
● MySQL Users are also saved to disk because cluster_mysql_users_save_to_disk=true
● A new checksum is also detected from 172.16.3.132:6032 , but it matches the local one so there is no
need to sync
● A new checksum is also detected from 172.16.3.131:6032 (that is the same proxysql instance), but it
matches the local one so there is again no need to sync
How does it work ?
27
29. 1) Define What to sync.
a) admin-checksum_mysql_query_rules
b) admin-checksum_mysql_servers
c) admin-checksum_mysql_users
2) Define Credentials
a) admin-cluster_username & admin-cluster_password
3) Define interval/frequency checks
a) admin-cluster_check_interval_ms
b) admin-cluster_check_status_frequency
Cluster Admin Variables
29
30. ● Variables used for saving the changes to the disk
○ admin-cluster_mysql_query_rules_save_to_disk
○ admin-cluster_mysql_servers_save_to_disk
○ admin-cluster_mysql_users_save_to_disk
○ admin-cluster_proxysql_servers_save_to_disk
● Variables used to trigger the synchronization
○ admin-cluster_mysql_query_rules_diffs_before_sync
○ admin-cluster_mysql_servers_diffs_before_sync
○ admin-cluster_mysql_users_diffs_before_sync
○ admin-cluster_proxysql_server_diffs_before_sync
How to implement it ?
30