本篇文章为大家展示了如何进行Mysql中的mysql-proxy读写分离,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。
以配置文件的方式启动
[root@host-192-168-1-56 mysql-proxy]# ls
bin include lib libexec licenses mysql-proxy.conf mysql-proxy.log mysql-proxy.pid share
[root@host-192-168-1-56 mysql-proxy]# more mysql-proxy.conf
[mysql-proxy]
daemon=true
pid-file=/usr/local/mysql-proxy/mysql-proxy.pid
log-file=/usr/local/mysql-proxy/mysql-proxy.log
log-level=debug
LUA_PATH=/usr/local/mysql-proxy/share/doc/mysql-proxy
proxy-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua
proxy-address=127.0.0.1:4040
proxy-read-only-backend-addresses=192.168.1.56:3307,192.168.1.6.3307
proxy-backend-addresses=192.168.1.6:3307
keepalive=true
proxy-skip-profiling=true
admin-address=:4042
admin-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/admin-sql.lua
admin-username=admin
admin-password=admin
plugins=proxy,admin
[root@host-192-168-1-56 mysql-proxy]# /usr/local/mysql-proxy/bin/mysql-proxy --defaults-file=/usr/local/mysql-proxy/mysql-proxy.conf
上述内容就是如何进行Mysql中的mysql-proxy读写分离,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注亿速云行业资讯频道。