Hi,
I’m getting below error while configuring PXC HA using Proxysql-admin.
Error:
[root@qtsxtradb01 tmp]# proxysql-admin --config-file=/etc/proxysql-admin.cnf --enable
This script will assist with configuring ProxySQL for use with
Percona XtraDB Cluster (currently only PXC in combination
with ProxySQL is supported)
ProxySQL read/write configuration mode is singlewrite
ERROR 2005 (HY000): Unknown MySQL server host ‘pxc-cluster’ (2)
ERROR (line:612) : PXC connection check failed.
– Could not connect to the PXC cluster at pxc-cluster:3306
– Please check the PXC connection parameters and status.
Below are the PXC details.
mysql> show variables like ‘wsrep_cluster%’;
±----------------------±--------------------------------------------------+
| Variable_name | Value |
±----------------------±--------------------------------------------------+
| wsrep_cluster_address | gcomm://192.168.50.83,192.168.50.84,192.168.50.85 |
| wsrep_cluster_name | pxc-cluster |
±----------------------±--------------------------------------------------+
2 rows in set (0.00 sec)
mysql> show grants for ‘monitor’@‘%’;
±------------------------------------+
| Grants for monitor@% |
±------------------------------------+
| GRANT USAGE ON . TO ‘monitor’@‘%’ |
±------------------------------------+
1 row in set (0.00 sec)
mysql> show grants for ‘admin’@‘%’;
±----------------------------------+
| Grants for admin@% |
±----------------------------------+
| GRANT USAGE ON . TO ‘admin’@‘%’ |
±----------------------------------+
1 row in set (0.00 sec)
Below are the proxysql-admin.cnf
[root@qtsxtradb01 tmp]# cat /etc/proxysql-admin.cnf
proxysql admin interface credentials.
export PROXYSQL_DATADIR=‘/var/lib/proxysql’
export PROXYSQL_USERNAME=‘admin’
export PROXYSQL_PASSWORD=‘admin’
export PROXYSQL_HOSTNAME=‘localhost’
export PROXYSQL_PORT=‘6032’
PXC admin credentials for connecting to pxc-cluster-node.
export CLUSTER_USERNAME=‘admin’
export CLUSTER_PASSWORD=‘admin’
export CLUSTER_HOSTNAME=‘pxc-cluster’
export CLUSTER_PORT=‘3306’
proxysql monitoring user. proxysql admin script will create this user in pxc to monitor pxc-nodes.
export MONITOR_USERNAME=‘monitor’
export MONITOR_PASSWORD=‘monit0r’
Application user to connect to pxc-node through proxysql
export CLUSTER_APP_USERNAME=‘proxysql_user’
export CLUSTER_APP_PASSWORD=‘passw0rd’
ProxySQL read/write hostgroup
export WRITE_HOSTGROUP_ID=‘10’
export READ_HOSTGROUP_ID=‘11’
ProxySQL read/write configuration mode.
export MODE=“singlewrite”
Writer-is-reader configuration
export WRITER_IS_READER=“ondemand”