# apt-get install mysql-proxy
$ mysql-proxy -V
mysql-proxy 0.8.1$ mkdir mysql-proxy
chassis: mysql-proxy 0.8.1
glib2: 2.30.2
libevent: 2.0.21-stable
LUA: Lua 5.1.4
package.path: /usr/lib/mysql-proxy/lua/?.lua
package.cpath: /usr/lib/mysql-proxy/lua/?.so
-- modules
admin: 0.8.1
proxy: 0.8.1
$ cd mysql-proxy
$ wget https://raw.githubusercontent.com/cwarden/mysql-proxy/master/examples/tutorial-query-time.lua
$ vi mysql-proxy.cnf
[mysql-proxy]$ chmod 660 mysql-proxy.cnf
daemon = false
pid-file = /tmp/mysql-proxy.pid
log-file = /tmp/mysql-proxy.log
log-level = debug
admin-username = 1
admin-password = 1
admin-lua-script = /usr/share/mysql-proxy/admin.lua
proxy-address = 0.0.0.0:3307
proxy-backend-addresses = 192.168.24.204:3306
proxy-lua-script = /home/yan/mysql-proxy/tutorial-query-time.lua
$ mysql-proxy --defaults-file=mysql-proxy.cnf
References :
mysql-proxy命令参数(二) | 哈巴狗
沒有留言:
張貼留言