博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu 13.04 MySQL Proxy 安装与配置
阅读量:6495 次
发布时间:2019-06-24

本文共 4576 字,大约阅读时间需要 15 分钟。

5. MySQL Proxy

5.1. Ubuntu

安装环境 Ubuntu 13.04

$ sudo apt-get install mysql-proxy

ENABLED改为true

$ sudo vim /etc/default/mysql-proxyENABLED="true"OPTIONS="--defaults-file=/etc/mysql/mysql-proxy.cnf"

配置 /etc//mysql-proxy.cnf

$ sudo vim /etc/mysql/mysql-proxy.cnf[mysql-proxy]daemon = trueuser = mysqlproxy-skip-profiling = truekeepalive = truemax-open-files = 2048event-threads = 50pid-file = /var/run/mysql-proxy.pidlog-file = /var/log/mysql-proxy.loglog-level = debugadmin-address=:4401admin-username=adminadmin-password=passw0rdadmin-lua-script=/usr/local/lib/mysql-proxy/lua/admin.luaproxy-address = 0.0.0.0:3307proxy-backend-addresses = 192.168.2.1:3306proxy-read-only-backend-addresses=192.168.6.2:3306, 192.168.6.1:3306proxy-lua-script=/usr/lib/mysql-proxy/lua/proxy/balance.lua

修改权限,这个步骤不能省略,否则无法启动。

$ sudo chmod 0660 /etc/mysql/mysql-proxy.cnf

启动mysql-proxy

$ sudo /etc/init.d/mysql-proxy start * Starting MySQL Proxy daemon...                    [ OK ]

测试3307端口

$ mysql -hlocalhost -P3307 -uroot -p

mysql-proxy 软件包所含文件如下:

$ dpkg -L  mysql-proxy/./etc/etc/default/etc/default/mysql-proxy/etc/init.d/etc/init.d/mysql-proxy/usr/usr/share/usr/share/mysql-proxy/usr/share/mysql-proxy/active-queries.lua/usr/share/mysql-proxy/active-transactions.lua/usr/share/mysql-proxy/admin-sql.lua/usr/share/mysql-proxy/admin.lua/usr/share/mysql-proxy/analyze-query.lua/usr/share/mysql-proxy/auditing.lua/usr/share/mysql-proxy/commit-obfuscator.lua/usr/share/mysql-proxy/histogram.lua/usr/share/mysql-proxy/load-multi.lua/usr/share/mysql-proxy/ro-balance.lua/usr/share/mysql-proxy/ro-pooling.lua/usr/share/mysql-proxy/rw-splitting.lua/usr/share/mysql-proxy/xtab.lua/usr/share/doc/usr/share/doc/mysql-proxy/usr/share/doc/mysql-proxy/README.TESTS.gz/usr/share/doc/mysql-proxy/README/usr/share/doc/mysql-proxy/copyright/usr/share/doc/mysql-proxy/changelog.Debian.gz/usr/lib/usr/lib/libmysql-chassis-glibext.so.0.0.0/usr/lib/libmysql-chassis-timing.so.0.0.0/usr/lib/libmysql-chassis.so.0.0.0/usr/lib/libmysql-proxy.so.0.0.0/usr/lib/mysql-proxy/usr/lib/mysql-proxy/lua/usr/lib/mysql-proxy/lua/proxy/usr/lib/mysql-proxy/lua/proxy/auto-config.lua/usr/lib/mysql-proxy/lua/proxy/balance.lua/usr/lib/mysql-proxy/lua/proxy/commands.lua/usr/lib/mysql-proxy/lua/proxy/parser.lua/usr/lib/mysql-proxy/lua/proxy/tokenizer.lua/usr/lib/mysql-proxy/lua/proxy/test.lua/usr/lib/mysql-proxy/lua/admin.lua/usr/lib/mysql-proxy/lua/lfs.so/usr/lib/mysql-proxy/lua/glib2.so/usr/lib/mysql-proxy/lua/chassis.so/usr/lib/mysql-proxy/lua/mysql.so/usr/lib/mysql-proxy/lua/lpeg.so/usr/lib/mysql-proxy/lua/posix.so/usr/lib/mysql-proxy/plugins/usr/lib/mysql-proxy/plugins/libadmin.so/usr/lib/mysql-proxy/plugins/libproxy.so/usr/lib/mysql-proxy/plugins/libreplicant.so/usr/lib/mysql-proxy/plugins/libdebug.so/usr/lib/pkgconfig/usr/lib/pkgconfig/mysql-proxy.pc/usr/lib/pkgconfig/mysql-chassis.pc/usr/bin/usr/bin/mysql-binlog-dump/usr/bin/mysql-myisam-dump/usr/bin/mysql-proxy/usr/include/usr/include/network-mysqld.h/usr/include/network-mysqld-lua.h/usr/include/network-mysqld-proto.h/usr/include/network-mysqld-binlog.h/usr/include/network-mysqld-packet.h/usr/include/network-mysqld-masterinfo.h/usr/include/network-conn-pool.h/usr/include/network-conn-pool-lua.h/usr/include/network-queue.h/usr/include/network-socket.h/usr/include/network-socket-lua.h/usr/include/network-address.h/usr/include/network-address-lua.h/usr/include/sys-pedantic.h/usr/include/chassis-plugin.h/usr/include/chassis-log.h/usr/include/chassis-keyfile.h/usr/include/chassis-mainloop.h/usr/include/chassis-path.h/usr/include/chassis-filemode.h/usr/include/chassis-limits.h/usr/include/chassis-event-thread.h/usr/include/chassis-gtimeval.h/usr/include/glib-ext.h/usr/include/glib-ext-ref.h/usr/include/string-len.h/usr/include/lua-load-factory.h/usr/include/lua-scope.h/usr/include/lua-env.h/usr/include/network-injection.h/usr/include/network-injection-lua.h/usr/include/chassis-shutdown-hooks.h/usr/include/chassis-exports.h/usr/include/network-exports.h/usr/include/network-backend.h/usr/include/network-backend-lua.h/usr/include/disable-dtrace.h/usr/include/lua-registry-keys.h/usr/include/chassis-stats.h/usr/include/chassis-timings.h/usr/include/chassis-frontend.h/usr/include/chassis-options.h/usr/include/chassis-win32-service.h/usr/include/chassis-unix-daemon.h/usr/include/my_rdtsc.h/usr/lib/libmysql-chassis-glibext.so.0/usr/lib/libmysql-chassis-glibext.so/usr/lib/libmysql-proxy.so/usr/lib/libmysql-chassis-timing.so.0/usr/lib/libmysql-chassis-timing.so/usr/lib/libmysql-proxy.so.0/usr/lib/libmysql-chassis.so.0/usr/lib/libmysql-chassis.so

转载地址:http://fvyyo.baihongyu.com/

你可能感兴趣的文章
c基础知识复习
查看>>
如何彻底卸载mysql(xp)
查看>>
.net反射详解(转)
查看>>
使用jquery.more.js来实现点击底部更多后, 底部加载出新的数据
查看>>
使用dom4j解析XML例子
查看>>
adviser vs mentor
查看>>
JavaBean简单及使用
查看>>
VS2013 编译&使用 stlport
查看>>
几种更新(Update语句)查询的方法
查看>>
20步打造最安全的Nginx Web服务器
查看>>
WP8:Unity3D之间的值传递
查看>>
string与数值之间的转换
查看>>
Windows系统安装Oracle 11g客户端
查看>>
怎样写出一个较好的高速排序程序
查看>>
【动态规划】最长公共子序列与最长公共子串
查看>>
要立刷金组flag了T_T
查看>>
Swift常量和变量
查看>>
GNU Make chapter 2 —— Makefile 介绍
查看>>
[转]在Eclipse中使用JUnit4进行单元测试(中级篇)
查看>>
gdb图形化调试工具总结
查看>>