# Proxysql-admin for PXC HA configuration failing

**URL:** <https://forums.percona.com/t/proxysql-admin-for-pxc-ha-configuration-failing/6842>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [February 6, 2019, 7:42am UTC](https://forums.percona.com/t/proxysql-admin-for-pxc-ha-configuration-failing/6842 "2019-02-06T07:42:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![prince85](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@prince85](https://forums.percona.com/u/prince85)\
**Post date:** [February 6, 2019, 7:42am UTC](https://forums.percona.com/t/proxysql-admin-for-pxc-ha-configuration-failing/6842/1 "2019-02-06T07:42:10Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [February 13, 2019, 8:27am UTC](https://forums.percona.com/t/proxysql-admin-for-pxc-ha-configuration-failing/6842/2 "2019-02-13T08:27:55Z")

</div>

This variable is wrong:

```auto
export CLUSTER_HOSTNAME='pxc-cluster'

```

It basically should be a real cluster host name or IP address where the admin tool can connect to and get the rest of the cluster details.  
Check more details here:  
[url][Redirecting](https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/proxysql.html%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![prince85](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@prince85](https://forums.percona.com/u/prince85)\
**Post date:** [February 13, 2019, 8:36am UTC](https://forums.percona.com/t/proxysql-admin-for-pxc-ha-configuration-failing/6842/3 "2019-02-13T08:36:14Z")

</div>

What is the difference in the variable that You have mentioned and the one I have mentioned?

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [February 14, 2019, 10:28am UTC](https://forums.percona.com/t/proxysql-admin-for-pxc-ha-configuration-failing/6842/4 "2019-02-14T10:28:20Z")

</div>

I only quoted it from your configuration file. The ‘pxc-cluster’ does not look like a valid hostname to me. Try a real IP number instead, like:

```auto
export CLUSTER_HOSTNAME='192.168.50.83'

```

---

<div class="post-metadata">

**Author:** ![prince85](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@prince85](https://forums.percona.com/u/prince85)\
**Post date:** [February 15, 2019, 7:01am UTC](https://forums.percona.com/t/proxysql-admin-for-pxc-ha-configuration-failing/6842/5 "2019-02-15T07:01:28Z")

</div>

The one you have mentioned below this is the IP of one of the node in the cluster. Do I have to mention the one of the node IP in the cluster as cluster host name? Please confirm.  
export CLUSTER\_HOSTNAME=‘192.168.50.83’ also, the below login is having only usage permission is it enough of need more permission. export CLUSTER\_USERNAME=‘admin’ export CLUSTER\_PASSWORD=‘admin’ mysql\> show grants for ‘admin’@‘%’; ±----------------------------------+ | Grants for admin@% | ±----------------------------------+ | GRANT USAGE ON _._ TO ‘admin’@‘%’ | ±----------------------------------+ 1 row in set (0.00 sec)

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [February 17, 2019, 3:52am UTC](https://forums.percona.com/t/proxysql-admin-for-pxc-ha-configuration-failing/6842/6 "2019-02-17T03:52:10Z")

</div>

Yes, it is supposed to be a hostname or IP of one of the cluster node, doesn’t matter which one. The proxysql-admin will connect to this node and will read the IPs of the other nodes automatically.  
Before the tool can discover the cluster addresses and do it’s job, you need to indeed add a user that has enough privileges. And “usage” is not enough. I’d suggest rather:

```auto
GRANT RELOAD, PROCESS, SELECT, CREATE USER ON *.* TO 'admin'&#64;'192.168.%' WITH GRANT OPTION;

```

Later, you will need application users also added to ProxySQL. You may do it manually, or use the proxysql-admin tool with “–adduser” or “–syncusers” options.
