Skip to content

Galera cluster check failed when ProxySQL monitor user have REQUIRE SSL #19

@phongdt2019

Description

@phongdt2019

Hi,

When using the script galera_check.pl and the proxysql monitor user have REQUIRE SSL, the access from proxysql monitor user is denied from all pxc nodes, which leads to the galera_check.pl could not get the proper state of every pxc nodes hence fail to find a candidate for failover.

I think proxysql uses a different way to check PXC node states in the case of SSL encryption is enforced, while the galera_check.pl report Cannot connect to DBI:mysql:host=10.238.63.98;port=3306; all the PXC nodes stay ONLINE in proxysql.running_mysql_servers.

  1. I am using proxysql as proxysql monitor user
    In ProxySQL
| mysql-monitor_username                                       | proxysql              
| mysql-monitor_password                                       | secret

In MySQL


mysql> select * from mysql.user where User like 'proxysql'\G
*************************** 1. row ***************************
                  Host: %
                  User: proxysql
              ssl_type: ANY
  1. My PXC servers in PXC nodes
mysql> select * from mysql_servers;
+--------------+--------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname     | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+--------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 10           | 172.16.1.199 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
| 20           | 172.16.0.239 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
| 20           | 172.16.2.104 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
| 8010         | 172.16.1.199 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
| 8020         | 172.16.3.91  | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
| 8020         | 172.16.2.104 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
| 8010         | 172.16.0.239 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
| 8010         | 172.16.2.104 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
| 8020         | 172.16.0.239 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 1       | 0              |         |
+--------------+--------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
9 rows in set (0.00 sec)
  1. ProxySQL scheduler
+----+--------+-------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+------+------+------+---------+
| id | active | interval_ms | filename                          | arg1                                                                                                                                                                                                      | arg2 | arg3 | arg4 | arg5 | comment |
+----+--------+-------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+------+------+------+---------+
| 10 | 1      | 2000        | /var/lib/proxysql/galera_check.pl | -u=proxyadmin -p=proxyadmin -h=127.0.0.1 -P=6032 -H=10:W,20:R --active_failover=3 --debug=1 --retry_up=3 --retry_down=2 --single_writer=1 --writer_is_also_reader=0 --log=/var/lib/proxysql/galera_check_ | NULL | NULL | NULL | NULL |         |
+----+--------+-------------+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+------+------+------+---------+
  1. After enabling REQUIRE SSL

PXC nodes start denying access from ProxySQL user

2020-12-25T05:58:27.171725Z 2079 [Note] Access denied for user 'proxysql'@'vagrant-phong-anydbver-default-891d4c331b800bee.lxd' (using password: YES)
2020-12-25T05:58:29.484811Z 2080 [Note] Access denied for user 'proxysql'@'vagrant-phong-anydbver-default-891d4c331b800bee.lxd' (using password: YES)
2020-12-25T05:58:29.512120Z 2081 [Note] Access denied for user 'proxysql'@'vagrant-phong-anydbver-default-891d4c331b800bee.lxd' (using password: YES)
2020-12-25T05:58:29.553124Z 2082 [Note] Access denied for user 'proxysql'@'vagrant-phong-anydbver-default-891d4c331b800bee.lxd' (using password: YES)
2020-12-25T05:58:31.864506Z 2083 [Note] Access denied for user 'proxysql'@'vagrant-phong-anydbver-default-891d4c331b800bee.lxd' (using password: YES)
2020-12-25T05:58:31.896786Z 2084 [Note] Access denied for user 'proxysql'@'vagrant-phong-anydbver-default-891d4c331b800bee.lxd' (using password: YES)
2020-12-25T05:58:31.951574Z 2085 [Note] Access denied for user 'proxysql'@'vagrant-phong-anydbver-default-891d4c331b800bee.lxd' (using password: YES) 

then galera_check.pl report cannot connect to PXC nodes

2020/12/25 05:58:31.999:[ERROR] Cannot connect to DBI:mysql:host=172.16.2.104;port=3306;mysql_connect_timeout=6 as proxysql
2020/12/25 05:58:31.999:[ERROR]  Node is not responding setting it as SHUNNED (internally) (ProxySQL bug - #2658)172.16.2.104:3306:HG8020

Meanwhile, the node state remain ONLINE in proxysql.running_mysql_servers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions