1、下载mysql-proxy包
2、解压并启动
tar zxvf mysql-proxy....tar mv mysql-proxy... /user/local/proxy cd /usr/local/proxy #IP1为master的ip,IP2为slave1的ip,IP3为slave2的ip
./bin/mysql-proxy -P IP:4040 -b IP1:port -r IP2:port -r IP3:port -s /usr/local/mysql-proxy/share/doc/mysql-proxy/rw-spliting.lua --daemon
3、连接
mysql -hIP -uroot -P4040