sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.05k stars 983 forks source link

Changes on mysql-interfaces shouldn't requires a restart #440

Open renecannao opened 9 years ago

renecannao commented 9 years ago

WHY

Currently, changing mysql-interfaces requires a restarts. This is against the principle that proxysql can be reconfigured at runtime, although it is rare that someone would need to change mysql-interfaces at runtime.

WHAT

Allow to change binding address/port without the need to restart the proxy This is already done for the admin interface, so shouldn't be difficult to port it also for MySQL threads

renecannao commented 9 years ago

Maybe there is a bug associated with this: LOAD MYSQL VARIABLES TO RUNTIME resets mysql-interfaces . To be verified

ManjotS commented 8 years ago

setting in runtime doesnt work and restart doesnt change port either.

renecannao commented 8 years ago

I confirm that setting at runtime doesn't work, but this should work (just tested):

SET mysql-interfaces='0.0.0.0:6034;/tmp/proxysql.sock';
SAVE MYSQL VARIABLES TO DISK;
PROXYSQL RESTART;
ManjotS commented 8 years ago

This is not intuitive. But I can confirm it works.

Thanks!

On 7/15/16 5:08 PM, René Cannaò wrote:

|SET mysql-interfaces='0.0.0.0:6034;/tmp/proxysql.sock'; SAVE MYSQL VARIABLES TO DISK; PROXYSQL RESTART;|

renecannao commented 8 years ago

Manjot, a bit more context: all changes applied to memory and/or runtime are lost during a restart, therefore the changes need to be saved to disk to make them persistent across restart. That is why, in order, the variable need to changed (in memory, using SET), saved to disk (SAVE MYSQL VARIABLES TO DISK) and then restart (PROXYSQL RESTART)

mcrauwel commented 6 years ago

@renecannao @pondix in combination with https://github.com/sysown/proxysql/issues/1363 this has an extra side effect.

I need to add an additional VIP to my proxy instances and to support query_rules based on proxy_addr I need to add this VIP's to mysql-interfaces which will trigger me to restart the entire fleet of proxysql instances which will break any active connections to my other VIP's

h4rr21 commented 5 years ago

hello @renecannao, is there any way to change the default values of mysql-interfaces?

if I do a service proxysql restart it takes my new default value?

basti-nis commented 3 years ago

Run in this today when i try changing the port. This is still an issue in v2.0.17.

I have tried to change it in the /etc/proxysql.cnf, but it's not noticed.

As mentioned by @renecannao :

I confirm that setting at runtime doesn't work, but this should work (just tested):

SET mysql-interfaces='0.0.0.0:6034;/tmp/proxysql.sock';
SAVE MYSQL VARIABLES TO DISK;
PROXYSQL RESTART;

This helped me changing the port.

Should work for @h4rr21 too.

deadlybore commented 2 days ago

This is becoming a requirement in the context of a proxysql cluster, otherwise you have to reset your whole cluster just to add a listening port, or did I miss something ?

renecannao commented 2 days ago

You can perform a rolling restart

deadlybore commented 2 days ago

oh, how do you do that ? I did not find a way to propagate the changes to the mysql-interfaces variable to the whole cluster

deadlybore commented 22 hours ago

I realize that you were speaking about a kubernetes context which is not my case