【Mysql】mysql-proxy讀寫分離

小亮520cl發表於2016-03-07
mark 明天看
http://blog.csdn.net/yueliangdao0608/article/details/2398655


以配置檔案的方式啟動
  1. [root@host-192-168-1-56 mysql-proxy]# ls
  2. 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

更多高階用法參考http://mp.weixin.qq.com/s/A5SnwL4Gzin6Sz2weu9Bzw

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29096438/viewspace-2050922/,如需轉載,請註明出處,否則將追究法律責任。

相關文章