Uploaded image for project: 'ProxySQL Admin Scripts'
  1. ProxySQL Admin Scripts
  2. PSQLADM-117

--syncusers doesn't work when enabling cluster

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Pending Release
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.12
    • Component/s: None
    • Labels:
      None

      Description

      If you want to initially configure a cluster using --enable and also sync users by using --syncusers, proxysql-admin won't import the users.
      You need to manually call proxysql-admin again to import users:

      [root@marcelo-altmann-238169-proxysql-1 ~]# mysql -u admin -padmin -h 127.0.0.1 -P 6032 -e "SELECT * FROM mysql_users"
      mysql: [Warning] Using a password on the command line interface can be insecure.
      [root@marcelo-altmann-238169-proxysql-1 ~]# proxysql-admin --config-file=/etc/proxysql-admin.cnf --without-cluster-app-user --syncusers --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
      
      Configuring the ProxySQL monitoring user.
      ProxySQL monitor user name as per command line/config-file is monitor
      
      The monitoring user is already present in Percona XtraDB Cluster.
      
      Would you like to enter a new password [y/n] ? n
      
      Monitoring user 'monitor'@'172.%' has been setup in the ProxySQL database.
      
      Adding the Percona XtraDB Cluster server nodes to ProxySQL
      
      Write node info
      +--------------+--------------+------+---------+---------+
      | hostname     | hostgroup_id | port | weight  | comment |
      +--------------+--------------+------+---------+---------+
      | 172.16.1.229 | 10           | 3306 | 1000000 | WRITE   |
      +--------------+--------------+------+---------+---------+
      
      ProxySQL configuration completed!
      
      ProxySQL has been successfully configured to use with Percona XtraDB Cluster
      
      You can use the following login credentials to connect your application through ProxySQL
      
      mysql --user=proxysql_user -p --host=localhost --port=6033 --protocol=tcp
      
      [root@marcelo-altmann-238169-proxysql-1 ~]# mysql -u admin -padmin -h 127.0.0.1 -P 6032 -e "SELECT * FROM mysql_users"
      mysql: [Warning] Using a password on the command line interface can be insecure.
      [root@marcelo-altmann-238169-proxysql-1 ~]# proxysql-admin --config-file=/etc/proxysql-admin.cnf --syncusers
      ERROR (line:1267) : Failed to load user list from ProxySQL database.
      -- Please check the ProxySQL connection parameters and status.
      
      Syncing user accounts from PXC to ProxySQL
      Adding user to ProxySQL: monitor
      Adding user to ProxySQL: root
      
      Synced PXC users to the ProxySQL database!
      [root@marcelo-altmann-238169-proxysql-1 ~]# mysql -u admin -padmin -h 127.0.0.1 -P 6032 -e "SELECT * FROM mysql_users"
      mysql: [Warning] Using a password on the command line interface can be insecure.
      +----------+-------------------------------------------+--------+---------+-------------------+----------------+---------------+------------------------+--------------+---------+----------+-----------------+
      | username | password                                  | active | use_ssl | default_hostgroup | default_schema | schema_locked | transaction_persistent | fast_forward | backend | frontend | max_connections |
      +----------+-------------------------------------------+--------+---------+-------------------+----------------+---------------+------------------------+--------------+---------+----------+-----------------+
      | monitor  | *E1A383418F81A65DB753CF477200945A1A5BA77D | 1      | 0       | 10                | NULL           | 0             | 1                      | 0            | 1       | 1        | 10000           |
      | root     | *AF9E01EA8519CE58E3739F4034EFD3D6B4CA6324 | 1      | 0       | 10                | NULL           | 0             | 1                      | 0            | 1       | 1        | 10000           |
      +----------+-------------------------------------------+--------+---------+-------------------+----------------+---------------+------------------------+--------------+---------+----------+-----------------+
      

        Attachments

          Activity

            People

            • Assignee:
              kenn.takara Kenn Takara
              Reporter:
              marcelo.altmann Marcelo Altmann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: