Description:
I am using mysql-proxy 0.6.1 and I think the fail over function is not completely working.
Here the command (sql is the proxy address) :
-----------------------------------
/usr/local/sbin/mysql-proxy \
--daemon \
--pid-file=/var/run/mysql-proxy.pid \
--proxy-address=sql:3306 \
--proxy-backend-addresses=sql1:3306 \
--proxy-backend-addresses=sql2:3306 \
>& /var/log/mysql-proxy.log
-----------------------------------
===================================
SQL1 and SQL2 are UP :
===================================
-----------------------------------
sql1:/home/xxx# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 209
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
-----------------------------------
-----------------------------------
sql2:/home/xxx# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 319
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
-----------------------------------
-----------------------------------
sql:/home/xxx# mysql -h sql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 350
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
-----------------------------------
===================================
I SHUTDOWN SQL1 :
===================================
-----------------------------------
sql1:/home/xxx# mysql -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
-----------------------------------
-----------------------------------
sql2:/home/xxx# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 531
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
-----------------------------------
-----------------------------------
sql:/home/xxx# mysql -h sql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 501
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
-----------------------------------
===================================
I start SQL1 and SHUTDOWN SQL2 :
===================================
-----------------------------------
sql1:/home/xxx# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 478
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
-----------------------------------
-----------------------------------
sql2:/home/xxx# mysql -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
-----------------------------------
-----------------------------------
sql:/home/xxx# mysql -h sql -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
-----------------------------------
:(
How to repeat:
There is something is particularly bizarre. Sometimes SQL is up when SQL1 is down so I enjoy : failover is working ! But when I start SQL1 and then shutdown SQL2, sql seems to be down :(