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

2.0 : Check read-only status of writer node with "proxysql-admin --update-cluster --write-node=<node>" command

    XMLWordPrintable

    Details

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

      Description

      Check read-only status of writer node with proxysql-admin --update-cluster --write-node=<node> command and terminate the command if the node is read-only.

      mysql> set global read_only=1;
      Query OK, 0 rows affected (0.01 sec)
      
      mysql> select @@read_only;
      +-------------+
      | @@read_only |
      +-------------+
      |           1 |
      +-------------+
      1 row in set (0.00 sec)
      
      mysql> select @@port;
      +--------+
      | @@port |
      +--------+
      |  26200 |
      +--------+
      1 row in set (0.00 sec)
      
      mysql>
      
      [vagrant@proxysql ~]$ sudo proxysql-admin --update-cluster --write-node=127.0.0.1:26200 --writer-hg=10
      Cluster node (127.0.0.1:26200) does not exist in ProxySQL, adding to the writer hostgroup(10)
      Waiting for ProxySQL to process the new nodes...
      
      Cluster node info
      +---------------+-------+-----------+-------+--------+
      | hostgroup     | hg_id | hostname  | port  | weight |
      +---------------+-------+-----------+-------+--------+
      | writer        | 10    | 127.0.0.1 | 26100 | 1000   |
      | reader        | 11    | 127.0.0.1 | 26300 | 1000   |
      | backup-writer | 12    | 127.0.0.1 | 26300 | 1000   |
      +---------------+-------+-----------+-------+--------+
      
      Cluster membership updated in the ProxySQL database!
      [vagrant@proxysql ~]$
      

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              ramesh.sivaraman Ramesh Sivaraman
              Reporter:
              ramesh.sivaraman Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 3 hours, 40 minutes
                  3h 40m