# \[ProxySQL\]Change of weight value on mysql\_servers table

**URL:** <https://forums.percona.com/t/proxysql-change-of-weight-value-on-mysql-servers-table/5676>\
**Category:** Other Tools\
**Created:** [June 13, 2017, 3:53am UTC](https://forums.percona.com/t/proxysql-change-of-weight-value-on-mysql-servers-table/5676 "2017-06-13T03:53:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Young\_Heon.Kim](https://avatars.discourse-cdn.com/v4/letter/y/3bc359/32.png) [@Young\_Heon.Kim](https://forums.percona.com/u/Young_Heon.Kim)\
**Post date:** [June 13, 2017, 3:53am UTC](https://forums.percona.com/t/proxysql-change-of-weight-value-on-mysql-servers-table/5676/1 "2017-06-13T03:53:42Z")

</div>

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 | [COLOR=#FF0000]1000000 |  
| 0 | host2 | ONLINE | [COLOR=#FF0000]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 | [COLOR=#FF0000]1000 |  
| 0 | host2 | ONLINE | [COLOR=#FF0000]1000 |  
±-------------±-------------±-------±-------+

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

---

<div class="post-metadata">

**Author:** ![krissfr](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@krissfr](https://forums.percona.com/u/krissfr)\
**Post date:** [July 28, 2017, 2:04am UTC](https://forums.percona.com/t/proxysql-change-of-weight-value-on-mysql-servers-table/5676/2 "2017-07-28T02:04:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Reiner030](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/reiner030/32/1142_2.png) [@Reiner030](https://forums.percona.com/u/Reiner030)\
**Post date:** [June 11, 2018, 9:06am UTC](https://forums.percona.com/t/proxysql-change-of-weight-value-on-mysql-servers-table/5676/3 "2018-06-11T09:06:38Z")

</div>

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).

[url][Main (runtime) · sysown/proxysql Wiki · GitHub](https://github.com/sysown/proxysql/wiki/Main-(runtime)#runtime-tables%5B/url%5D)  
[url][https://github.com/sysown/proxysql/wiki/DISK-(disk[/url])](https://github.com/sysown/proxysql/wiki/DISK-(disk%5B/url%5D))

---

<div class="post-metadata">

**Author:** ![lorraine.pocklington](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lorraine.pocklington/32/37_2.png) [@lorraine.pocklington](https://forums.percona.com/u/lorraine.pocklington)\
**Post date:** [June 11, 2018, 9:11am UTC](https://forums.percona.com/t/proxysql-change-of-weight-value-on-mysql-servers-table/5676/4 "2018-06-11T09:11:10Z")

</div>

Hey there [Reiner030](https://www.percona.com/forums/member/26717-reiner030) - thank you for taking the time find this information and to update this post. Appreciated!

---

<div class="post-metadata">

**Author:** ![ramesh.sivaraman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ramesh.sivaraman/32/1206_2.png) [@ramesh.sivaraman](https://forums.percona.com/u/ramesh.sivaraman)\
**Post date:** [June 12, 2018, 12:31am UTC](https://forums.percona.com/t/proxysql-change-of-weight-value-on-mysql-servers-table/5676/5 "2018-06-12T00:31:45Z")

</div>

Hi [Young Heon.Kim](https://percona.vanillacommunities.com/profile/x/x/38900) / [krissfr](https://percona.vanillacommunities.com/profile/x/x/29041) / [Reiner030](https://percona.vanillacommunities.com/profile/x/x/26717) ,

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 : [url][Redirecting](https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/proxysql.html#automatic-configuration%5B/url%5D)
