Originally to test the Atlas, unfortunately there is no 32 version, and the two are extremely similar, but the internal implementation is different, so familiar with Mysql-proxy as an alternative.
Environment: Tested on a single machine due to condition constraints
rw:192.168.137.129:3306
ro:192.168.137.129:3307
viproxy:192.168.137.129:3814
viadmin:192.168.137,129:4041
Configuration file: myproxy.cnf
[Mysql-proxy]
proxy-address=0.0.0.0:38141
Plugins = Admin,proxy
Admin-address = 0.0.0.0:4041
Admin-username=admin
Admin-password=admin
Admin-lua-script=/usr/local/mysqlproxy/lib/mysql-proxy/lua/admin.lua
proxy-backend-addresses=192.168.137.129:3306
proxy-read-only-backend-addresses=192.168.137.129:3307
Proxy-lua-script=/usr/local/mysqlproxy/share/doc/mysql-proxy/rw-splitting.lua
Log-file=/usr/local/mysqlproxy/log/mysql-proxy.log
Log-level=debug
Daemon=true
Keepalive=true
Start: Enter the client directory
./bin/mysql-proxy--DEFAULTS-FILE=/ETC/MYPROXY.CNF
To view the current administrative actions:
./bin/mysql-h 192.168.137.129-p 4041-uadmin-p
SELECT * from Backends; View the status of the current individual SQL nodes
Manipulating SQL nodes from a proxy port
./bin/mysql-h 192.168.137.129-p 38141-u test-p
#之前已经通过grant create a SQL user that can be used on the SQL node
#进入后就能像操作sql the same operation.
Note: When viewing the management node, it was found that the query could not be automatically polled and was later found to be the configured minimum node connection number in the Lua RW script
is 4, and my test and only opened two connections, so you can not poll query, change over can
This article is from the PHP Learning notes blog, so be sure to keep this source http://jxw7733.blog.51cto.com/6389174/1693173
Mysql-proxy First Experience