mysql-proxy-discuss team mailing list archive
-
mysql-proxy-discuss team
-
Mailing list archive
-
Message #00229
Load balancing on master/slave : not really active/active, only active/passive
Hi There,
I have been told that there were no script for simply doing load
balancing on a master/master architecture.
So I got back on a simplest architecture. Assuming that I have one
master and one slave.
LUA_PATH="/usr/src/mysql-proxy-0.7.2/lib/?.lua"
mysql-proxy \
--log-file=/var/log/mysql-proxy.log \
--log-level=debug \
--proxy-lua-script=/usr/src/mysql-proxy-0.7.2/lib/rw-splitting.lua \
--proxy-address=10.33.3.241:3306 \
--proxy-backend-addresses=10.33.3.242:3306 \
--proxy-read-only-backend-addresses=10.33.3.243:3306 \
--daemon
Everything works fine but it's not an active/active LB. The selects goes
to the slave and when i turn off the slave, Selects are on the master.
When the slave goes up again, the selects come back to it.
for ((f=1;f<5000;f++)) ; do mysql -h 10.33.3.241 -P 3306 -u proxyuser
-p****** -e 'SELECT 42;'; done
At least, I would like to have some real active/active LB on the
selects. So I added the master as a slave :
LUA_PATH="/usr/src/mysql-proxy-0.7.2/lib/?.lua"
mysql-proxy \
--log-file=/var/log/mysql-proxy.log \
--log-level=debug \
--proxy-lua-script=/usr/src/mysql-proxy-0.7.2/lib/rw-splitting.lua \
--proxy-address=10.33.3.241:3306 \
--proxy-backend-addresses=10.33.3.242:3306 \
--proxy-read-only-backend-addresses=10.33.3.243:3306 \
--proxy-read-only-backend-addresses=10.33.3.242:3306 \
--daemon
I also tried to stimulate a bit more my slaves. On each terminal, the
loop made 3000 select * from mysql.user and only 20 where on the other
slave :(
I set up a lower max_connection=5 and when I Launch the two loops, I
have a Can't connect to Mysql :
ERROR 2003 (HY000): Can't connect to MySQL server on '10.33.3.241' (111)
But the script have the same behaviour (active/passive). Have you got
any idea ? Thanks a lot for your help :)
Regards,
Kin