Buy Percona ServicesBuy Now!

ProxySQL Admin Support for Multiple Clusters

 | April 11, 2018 |  Posted In: Insight for DBAs, MySQL, ProxySQL

PREVIOUS POST
NEXT POST

ProxySQL AdminIn this blog post, we demonstrate a new feature in ProxySQL Admin: support for multiple clusters.

In a previous blog post, Ramesh and Roel introduced a new tool that helps configured Percona XtraDB Cluster nodes into ProxySQL. However, at that time it only worked for a single cluster per ProxySQL Admin configuration. Starting from ProxySQL 1.4.6, which comes with an improved ProxySQL Admin tool (proxysql-admin), our tool now supports configuring multiple Percona XtraDB Cluster clusters with ease (PSQLADM-32).

Pre-requisites

  • Cluster name (wsrep_cluster_name) should be unique.
  • proxysql-admin.cnf configuration differences:
    • ProxySQL READ/WRITE hostgroup should be different for each cluster.
    • Application user should be different for each cluster.
  • Host priority feature support only one cluster at a time.

Configuring /etc/proxysql-admin.cnf

As mentioned above, the CLUSTER_APP_USERNAME and the WRITE/READ_HOSTGROUP should be different for each cluster. Wsrep_cluster_name should also be unique for each cluster.

Sample configuration of /etc/proxysql-admin.cnf for cluster1:

Sample configuration of /etc/proxysql-admin.cnf for cluster2

Setting up Percona XtraDB Cluster nodes in ProxySQL

I would add that you have the option to use a single proxysql-admin.cnf file, and just edit the file where changes are appropriate. You could also use two different files to configure ProxySQL. In my example, I used two files with the contents as seen above:

Inspect ProxySQL tables

Login to ProxySQL to confirm that the setup is correct:

It’s as easy as that! We hope you continue to enjoy using ProxySQL Admin!

PREVIOUS POST
NEXT POST
Jericho Rivera

Jericho Rivera currently works for Percona as Support Engineer. His interests include linux systems and MySQL database administration.

Leave a Reply