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

proxysql-admin and PXC mode specified with --mode isn't persist

    XMLWordPrintable

    Details

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

      Description

      When configured PXC with:

      proxysql-admin --config-file=/etc/proxysql-admin.cnf --mode=loadbal --enable

      but in /etc/proxysql-admin.cnf there is:

      export MODE="singlewrite"

      the loadbal mode is initially set as --mode option set, but on any cluster status change, it falls back to singlewrite:

      mysql> select hostgroup_id,hostname,status,weight,comment from runtime_mysql_servers;
      ---------------------------------------------

      hostgroup_id hostname   status weight comment  

      ---------------------------------------------

      10           172.17.0.4 ONLINE 1000   READWRITE
      10           172.17.0.3 ONLINE 1000   READWRITE
      10           172.17.0.2 ONLINE 1000   READWRITE

      ---------------------------------------------
      3 rows in set (0.00 sec)

      node2 # service mysql restart
      Shutting down MySQL (Percona XtraDB Cluster).............. SUCCESS!
      Starting MySQL (Percona XtraDB Cluster).. SUCCESS!

      mysql> select hostgroup_id,hostname,status,weight,comment from runtime_mysql_servers;
      --------------------------------------------

      hostgroup_id hostname   status weight  comment

      --------------------------------------------

      10           172.17.0.4 ONLINE 1000000 WRITE  
      10           172.17.0.3 ONLINE 1000    READ   
      10           172.17.0.2 ONLINE 1000000 WRITE  

      --------------------------------------------
      3 rows in set (0.00 sec)

      mysql> select hostgroup_id,hostname,status,weight,comment from disk.mysql_servers;
      ---------------------------------------------

      hostgroup_id hostname   status weight comment  

      ---------------------------------------------

      10           172.17.0.4 ONLINE 1000   READWRITE
      10           172.17.0.3 ONLINE 1000   READWRITE
      10           172.17.0.2 ONLINE 1000   READWRITE

      ---------------------------------------------
      3 rows in set (0.00 sec)

      The only reliable way to set the mode is editing proxysql-admin.cnf file.

      We should either fix the --mode option overriding or remove this option and update the documentation.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                ramesh.sivaraman Ramesh Sivaraman
                Reporter:
                przemyslaw.malkowski@percona.com Przemyslaw Malkowski
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: