Buy Percona ServicesBuy Now!

[ProxySQL]Change of weight value on mysql_servers table

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [ProxySQL]Change of weight value on mysql_servers table

    Hi
    I was set up PXC & ProxySQL for some testing.
    I made host group 0 that included host1 and host2.
    And I would like to use these servers like this:
    host1 : primary for write transaction
    host2 : secondary for write transaction

    So I expected that host1 processes most of write transaction, and host2 processes write transaction if host1 is down.
    And then I expected host1 processes write transaction again, if host1 is recovered.

    I set mysql_server table like this.
    +--------------+--------------+--------+-----------+
    | hostgroup_id | hostname | status | weight |
    +--------------+--------------+--------+-----------+
    | 0 | host1 | ONLINE | 1000000 |
    | 0 | host2 | ONLINE | 1000 |
    +--------------+--------------+--------+-----------+

    It is working well at first as I expect.
    But if host1 is stop and start, weight value of host1 is changed default value(1000).
    +--------------+--------------+--------+--------+
    | hostgroup_id | hostname | status | weight |
    +--------------+--------------+--------+--------+
    | 0 | host1 | ONLINE | 1000 |
    | 0 | host2 | ONLINE | 1000 |
    +--------------+--------------+--------+--------+

    How can I do not to change weight value of host1 ?




  • #2
    Hi, i just want to report that i have the same issue with a 3 node pxc and proxySQL.
    ProxySQL version is 1.3.7-1-1 (from percona repo).

    Does it come from the proxysql_galera_checker script that reload the mysql_server table without passing the weight argument ?

    Can an expert from Percona look at this issue ?

    thanks

    Comment


    • #3
      i found that the change come from the /usr/bin/proxysql_node_monitor script installed by the Percona's proxysql package.
      it is also in the github : https://github.com/percona/proxysql-...l_node_monitor

      Comment


      • #4
        Hi, since the solution is yet not written here and I found this page in some research for server weight min/max values...

        To activate the weight you had to query also:

        LOAD MYSQL SERVERS TO RUNTIME;

        and to make them reboot/restart save with:

        SAVE MYSQL SERVERS TO DISK;

        Same also to mysql query rules, mysql users, global_variables (for LOAD/SAVE sadly referenced as "MYSQL VARIABLES" which isn't good documented).


        https://github.com/sysown/proxysql/w...runtime-tables
        https://github.com/sysown/proxysql/wiki/DISK-(disk)

        Comment


        • #5
          Hey there Reiner030 - thank you for taking the time find this information and to update this post. Appreciated!

          Comment


          • #6
            Hi Young Heon.Kim / krissfr / Reiner030 ,

            If you install proxysql from percona repo you will get proxysql-admin tool to configure your nodes in ProxySQL database.
            proxysql-admin tool support two modes. singlewrite mode and loadbal mode.

            With singlewrite mode, one node will be writer node and remaining nodes will act as reader nodes. When writer node goes offline the scheduler scripts (proxysql_galera_checker and proxysql_node_monior) will promote one of the reader nodes as the writer. We can also control a priority order of what host is most desired to be the writer at any given time using host priority file.

            Please go through this doc to get more info : https://www.percona.com/doc/percona-...-configuration


            Comment

            Working...
            X