设为首页 收藏本站
查看: 6427|回复: 3

[经验分享] Mysql-Proxy0.8.3 实现MySQL 5.6读写分离

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2013-8-28 09:36:29 | 显示全部楼层 |阅读模式

一、Mysql-Proxy 简单介绍       MySQL-Proxy是一个处于你的client端和MySQL server端之间的简单程序,它可以监测、分析或改变它们的通信。它使用灵活,没有限制,常见的用途包括:负载平衡,故障、查询分析,查询过滤和修改等等。MySQL-Proxy就是这么一个中间层代理,简单的说,MySQL-Proxy就是一个连接池,负责将前台应用的连接请求转发给后台的数据库,并且通过使用lua脚本,可以实现复杂的连接控制和过滤,从而实现读写分离和负载平衡。对于应用来说,MySQL-Proxy是完全透明的,应用则只需要连接到MySQL-Proxy的监听端口即可。当然,这样proxy机器可能成为单点失效,但完全可以使用多个proxy机器做为冗余,在应用服务器的连接池配置中配置到多个proxy的连接参数即可。       MySQL-Proxy更强大的一项功能是实现“读写分离”,基本原理是让主数据库处理事务性查询,让从库处理SELECT查询。数据库复制被用来把事务性查询导致的变更同步到集群中的从库。

二、环境准备

1.实验拓扑 2033581_1377574419lbDU.png

2.操作系统

  • CentOS 6.4 x86_64
3.软件版本
  • Mysql-Proxy0.8.3
4.时间同步
[iyunv@proxy ~]# ntpdate 202.120.2.101
[iyunv@master ~]# ntpdate 202.120.2.101
[iyunv@slave ~]# ntpdate 202.120.2.101
三、Mysql-Proxy 命令简介mysql-proxy 命令
  • --help-all ———— 用于获取全部帮助信息
  • --proxy-address=host:port ———— 代理服务监听的地址和端口
  • --admin-address=host:port ———— 管理模块监听的地址和端口
  • --proxy-backend-addresses=host:port ———— 后端mysql服务器的地址和端口(主服务器)
  • --proxy-read-only-backend-addresses=host:port ———— 后端只读mysql服务器的地址和端口(从服务器)
  • --proxy-lua-script=file ———— 完成mysql代理功能的Lua脚本
  • --daemon ———— 以守护进程模式启动mysql-proxy
  • --defaults-file=/path/to/conf_file_name ———— 默认使用的配置文件路径
  • --log-file=/path/to/log_file_name ———— 日志文件名称
  • --log-level=level ———— 日志级别
  • --log-use-syslog ———— 基于syslog记录日志
  • --user=user_name ———— 运行mysql-proxy进程的用户
四、Mysql-Proxy主从分离
1.增加代理用户
[iyunv@proxy ~]# id mysql-proxy  
uid=3306(mysql-proxy) gid=3306(mysql-proxy) 组=3306(mysql-proxy)
2.安装mysql-proxy
[iyunv@proxy local]# cd mysql-proxy  
[/table]
"mysql-proxy" -> "mysql-proxy-0.8.3-linux-glibc2.3-x86-64bit"  
[iyunv@proxy mysql-proxy]# ll  
总用量 24  
drwxr-xr-x 2 7157 wheel 4096 8月   6 2012 bin  
drwxr-xr-x 2 7157 wheel 4096 8月   6 2012 include  
drwxr-xr-x 4 7157 wheel 4096 8月   6 2012 lib  
drwxr-xr-x 2 7157 wheel 4096 8月   6 2012 libexec  
drwxr-xr-x 3 7157 wheel 4096 8月   6 2012 licenses  
drwxr-xr-x 3 7157 wheel 4096 8月   6 2012 share
3.修改文件的拥有者与所属组
drwxr-xr-x 2 root mysql-proxy 4096 8月   6 2012 include  
drwxr-xr-x 2 root mysql-proxy 4096 8月   6 2012 bin  
drwxr-xr-x 4 root mysql-proxy 4096 8月   6 2012 lib  
drwxr-xr-x 2 root mysql-proxy 4096 8月   6 2012 libexec  
drwxr-xr-x 3 root mysql-proxy 4096 8月   6 2012 licenses  
drwxr-xr-x 3 root mysql-proxy 4096 8月   6 2012 share
4.修改PATH环境变量
Usage:  
[iyunv@proxy ~]# mysql-proxy --help-all
  mysql-proxy [OPTION...] - MySQL Proxy
Help Options:
  -?, --help                                              Show help options  
  --help-all                                              Show all help options  
  --help-proxy                                            Show options for the proxy-module
proxy-module
  -P, --proxy-address=<host:port>                         listening address:port of the proxy-server (default: :4040)  
  -r, --proxy-read-only-backend-addresses=<host:port>     address:port of the remote slave-server (default: not set)  
  -b, --proxy-backend-addresses=<host:port>               address:port of the remote backend-servers (default: 127.0.0.1:3306)  
  --proxy-skip-profiling                                  disables profiling of queries (default: enabled)  
  --proxy-fix-bug-25371                                   fix bug #25371 (mysqld > 5.1.12) for older libmysql versions  
  -s, --proxy-lua-script=<file>                           filename of the lua script (default: not set)  
  --no-proxy                                              don't start the proxy-module (default: enabled)  
  --proxy-pool-no-change-user                             don't use CHANGE_USER to reset the connection coming from the pool (default: enabled)  
  --proxy-connect-timeout                                 connect timeout in seconds (default: 2.0 seconds)  
  --proxy-read-timeout                                    read timeout in seconds (default: 8 hours)  
  --proxy-write-timeout                                   write timeout in seconds (default: 8 hours)
Application Options:
  -V, --version                                           Show version  
  --defaults-file=<file>                                  configuration file  
  --verbose-shutdown                                      Always log the exit code when shutting down  
  --daemon                                                Start in daemon-mode  
  --user=<user>                                           Run mysql-proxy as user  
  --basedir=<absolute path>                               Base directory to prepend to relative paths in the config  
  --pid-file=<file>                                       PID file in case we are started as daemon  
  --plugin-dir=<path>                                     path to the plugins  
  --plugins=<name>                                        plugins to load  
  --log-level=(errorwarninginfomessagedebug)          log all messages of level ... or higher  
  --log-file=<file>                                       log all messages in a file  
  --log-use-syslog                                        log all messages to syslog  
  --log-backtrace-on-crash                                try to invoke debugger on crash  
  --keepalive                                             try to restart the proxy if it crashed  
  --max-open-files                                        maximum number of open files (ulimit -n)  
  --event-threads                                         number of event-handling threads (default: 1)  
  --lua-path=<...>                                        set the LUA_PATH  
  --lua-cpath=<...>                                       set the LUA_CPATH
5.启动mysql-proxy
2013-08-27 09:58:42: (message) Initiating shutdown, requested from mysql-proxy-cli.c:598  
2013-08-27 09:58:42: (critical) mysql-proxy-cli.c:597: Failure from chassis_mainloop. Shutting down.  
2013-08-27 09:58:42: (message) shutting down normally, exit code is: 1  
2013-08-27 09:59:14: (message) Initiating shutdown, requested from signal handler  
2013-08-27 09:59:14: (message) shutting down normally, exit code is: 0  
2013-08-27 09:59:26: (critical) plugin proxy 0.8.3 started  
2013-08-27 09:59:26: (debug) max open file-descriptors = 1024  
2013-08-27 09:59:26: (message) proxy listening on port :4040  
2013-08-27 09:59:26: (message) added read/write backend: 192.168.18.201:3306  
2013-08-27 09:59:26: (message) added read-only backend: 192.168.18.202:3306
注,从日志可以看启动成功
7.在从服务上进行测试
master:
Query OK, 0 rows affected (0.04 sec)
slave:
注,验证是否能通过代理端口4040 端口连接到 mysql-proxy
Server version: 5.6.13-log MySQL Community Server (GPL)
Your MySQL connection id is 10  
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective  
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+  
Database             
+--------------------+  
information_schema   
mydb                 
mydb1                
mysql                
performance_schema   
test                 
+--------------------+  
6 rows in set (0.00 sec)
注,已经成功从4040端口,连接进mysql-proxy。下面我们来实现读写分离。
8.Mysql-Proxy本身不会实现读写分离,主要是依靠 Lua 脚本实现的,在 mysql-proxy 主机上 杀死mysql-proxy 进程并添加读写分离脚本
2013-08-27 10:05:51: (message) Initiating shutdown, requested from signal handler  
10.重新启动mysql-proxy,把此脚本加入到启动选项里面,实现读写分离
2013-08-27 09:59:26: (message) added read-only backend: 192.168.18.202:3306  
2013-08-27 10:05:51: (message) shutting down normally, exit code is: 0  
2013-08-27 10:10:29: (debug) chassis-path.c.122: adjusting relative path ( /usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua) to base_dir (/usr/local/mysql-proxy-0.8.3-linux-glibc2.3-x86-64bit). New path: /usr/local/mysql-proxy-0.8.3-linux-glibc2.3-x86-64bit/ /usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua  
2013-08-27 10:10:29: (critical) plugin proxy 0.8.3 started  
2013-08-27 10:10:29: (debug) max open file-descriptors = 1024  
2013-08-27 10:10:29: (message) proxy listening on port :4040  
2013-08-27 10:10:29: (message) added read/write backend: 192.168.18.201:3306  
2013-08-27 10:10:29: (message) added read-only backend: 192.168.18.202:3306
[iyunv@proxy ~]# netstat -ntlp grep :4040 #查看一下端口
tcp        0      0 0.0.0.0:4040                0.0.0.0:*                   LISTEN      2944/mysql-proxy
11.为mysql-proxy 提供一个管理接口,方便以后随时查看后端mysql 服务器的状态和访问类型,实现管理功能
注,下面为大家提供一个管理接口的脚本,同样也是一个LUA 脚本,建议跟 读写分离脚本放在同一目录。
        errmsg = errmsg or "error"  
        type = proxy.MYSQLD_PACKET_ERR,  
    }  
end
function read_query(packet)
    if packet:byte() ~= proxy.COM_QUERY then  
        set_error("[admin] we only handle text-based queries (COM_QUERY)")  
        return proxy.PROXY_SEND_RESULT  
    end
    local query = packet:sub(2)
    local rows = { }
    local fields = { }
    if query:lower() == "select * from backends" then
        fields = {   
            { name = "backend_ndx",   
              type = proxy.MYSQL_TYPE_LONG },
            { name = "address",
              type = proxy.MYSQL_TYPE_STRING },  
            { name = "state",  
              type = proxy.MYSQL_TYPE_STRING },  
            { name = "type",  
              type = proxy.MYSQL_TYPE_STRING },  
            { name = "uuid",  
              type = proxy.MYSQL_TYPE_STRING },  
            { name = "connected_clients",   
              type = proxy.MYSQL_TYPE_LONG },  
        }
        for i = 1, #proxy.global.backends do
            local states = {  
                "unknown",  
                "up",  
                "down"  
            }  
            local types = {  
                "unknown",  
                "rw",  
                "ro"  
            }  
            local b = proxy.global.backends
            rows[#rows + 1] = {
                i,  
                b.dst.name,          -- configured backend address  
                states[b.state + 1], -- the C-id is pushed down starting at 0  
                types[b.type + 1],   -- the C-id is pushed down starting at 0  
                b.uuid,              -- the MySQL Server's UUID if it is managed  
                b.connected_clients  -- currently connected clients  
            }  
        end  
    elseif query:lower() == "select * from help" then  
        fields = {   
            { name = "command",   
              type = proxy.MYSQL_TYPE_STRING },  
            { name = "description",   
              type = proxy.MYSQL_TYPE_STRING },  
        }  
        rows[#rows + 1] = { "SELECT * FROM help", "shows this help" }  
        rows[#rows + 1] = { "SELECT * FROM backends", "lists the backends and their state" }  
    else  
        set_error("use 'SELECT * FROM help' to see the supported commands")  
        return proxy.PROXY_SEND_RESULT  
    end
    proxy.response = {
        type = proxy.MYSQLD_PACKET_OK,  
        resultset = {  
            fields = fields,  
            rows = rows  
        }  
    }  
    return proxy.PROXY_SEND_RESULT  
end
12.重新启动mysql-proxy
注,这次启动要添加以下启动选项 ,因为我们添加了额外的插件,把新加功能添加进来,选项如下。
--plugins=admin  在mysql-proxy启动时加载的插件;
--admin-username="admin" 运行mysql-proxy进程管理的用户;
--admin-password="admin" 密码
--admin-lua-script="/usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua" 插件使用的配置文件路径;
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1066/rpcbind      
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1223/sshd         
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1299/master      
tcp        0      0 0.0.0.0:54053               0.0.0.0:*                   LISTEN      1084/rpc.statd   
tcp        0      0 0.0.0.0:4040                0.0.0.0:*                   LISTEN      2970/mysql-proxy  
tcp        0      0 0.0.0.0:4041                0.0.0.0:*                   LISTEN      2970/mysql-proxy    #生成新的管理端口4041  
tcp        0      0 :::111                      :::*                        LISTEN      1066/rpcbind      
tcp        0      0 :::22                       :::*                        LISTEN      1223/sshd         
tcp        0      0 :::39894                    :::*                        LISTEN      1084/rpc.statd   
tcp        0      0 ::1:25                      :::*                        LISTEN      1299/master
13.在slave测试一下,记得使用管理端口4041 登陆,密码是admin。
Server version: 5.0.99-agent-admin
Your MySQL connection id is 1  
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective  
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
注,登录成功,下面我们来查看一下状态。
14.测试读写分离状态
Server version: 5.0.99-agent-admin
Your MySQL connection id is 1  
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective  
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select * from backends;
+-------------+---------------------+---------+------+------+-------------------+  
backend_ndx address             state    type uuid connected_clients   
+-------------+---------------------+---------+------+------+-------------------+  
           1 192.168.18.201:3306 unknown rw    NULL                  0   
           2 192.168.18.202:3306 unknown ro    NULL                  0   
+-------------+---------------------+---------+------+------+-------------------+  
2 rows in set (0.00 sec)
注,大家可以看到状态信息是unknown,因为我们还没有执行读写操作,所有状态还有UP起来,下面我们来测试一下读写信息,再来查看状态。
15.执行一下读写操作
+----------+  
user       
root       
repluser   
root       
root       
            
root       
            
root       
+----------+
[iyunv@slave ~]# mysql -uroot -p -h192.168.18.203 --port=4040 -e "create database mydb2;"
16.再次查看一下读写分离状态
Server version: 5.0.99-agent-admin
[table]
Your MySQL connection id is 1  
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective  
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SELECT * FROM backends;
+-------------+---------------------+-------+------+------+-------------------+  
backend_ndx address             state type uuid connected_clients   
+-------------+---------------------+-------+------+------+-------------------+  
           1 192.168.18.201:3306 up    rw    NULL                  0   
           2 192.168.18.202:3306 up    ro    NULL                  0   
+-------------+---------------------+-------+------+------+-------------------+  
2 rows in set (0.00 sec)
mysql>
注,大家可以看到,这时状态全部是up。说明读写分离配置成功。 在测试读写分离的时候,我们可以分布测试,比如先测试读的语句,查看读写状态是否UP ,然后在测试写的语句,反反复复多测试几次才能看出效果,本人在测试的时候也出现过读的状态不能up,解决办法是:多测试即便就出来了。好了,读写分离配置全部完成,下面我们进行优化一下,大家可以看到,启动mysql-proxy时要写很多参数,能不能写到一个文件中呢?还有连接mysql-proxy时,用的端口是4040,我们能不能修改为3306呢?答案是可以的下面我们优化一下。17.优化配置启动脚本,并修连接端口。注,博友看到每次启动的时候,启动选项非常多,一不小心都会写错,所以我们创建一个脚本或者配置文件把选项都写进去,每次启动的时候都调用此脚本。

(1).(1).增加配置文件

[iyunv@proxy ~]# vim /etc/sysconfig/mysql-proxy
# Options for mysql-proxy  
ADMIN_USER="admin"  
ADMIN_PASSWORD="admin"  
ADMIN_ADDRESS=""  
ADMIN_LUA_SCRIPT="/usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua"  
PROXY_ADDRESS="0.0.0.0:3306"  
PROXY_USER="mysql-proxy"  
PROXY_OPTIONS="--daemon --log-level=info --log-file="/var/log/mysql-proxy.log" --plugins=proxy --plugins=admin --proxy-backend-addresses=192.168.18.201:3306 --proxy-read-only-backend-addresses=192.168.18.202:3306 --proxy-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua"
(2).增加sysV脚本


[iyunv@proxy ~]# vim /etc/init.d/mysql-proxy #增加sysV脚本  
#!/bin/bash  
#  
# mysql-proxy This script starts and stops the mysql-proxy daemon  
#  
# chkconfig: - 78 30  
# processname: mysql-proxy  
# description: mysql-proxy is a proxy daemon for mysql
# Source function library.
. /etc/rc.d/init.d/functions
prog="/usr/local/mysql-proxy/bin/mysql-proxy"
# Source networking configuration.
if [ -f /etc/sysconfig/network ]; then  
    . /etc/sysconfig/network  
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
# Set default mysql-proxy configuration.
ADMIN_USER="admin"  
ADMIN_PASSWD="admin"  
ADMIN_LUA_SCRIPT="/usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua"  
PROXY_OPTIONS="--daemon"  
PROXY_PID=/var/run/mysql-proxy.pid  
PROXY_USER="mysql-proxy"
# Source mysql-proxy configuration.
if [ -f /etc/sysconfig/mysql-proxy ]; then  
    . /etc/sysconfig/mysql-proxy  
fi
RETVAL=0
start() {
    echo -n $"Starting $prog: "  
    daemon $prog $PROXY_OPTIONS --pid-file=$PROXY_PID --proxy-address="$PROXY_ADDRESS" --user=$PROXY_USER --admin-username="$ADMIN_USER" --admin-lua-script="$ADMIN_LUA_SCRIPT" --admin-password="$ADMIN_PASSWORD"  
    RETVAL=$?  
    echo  
    if [ $RETVAL -eq 0 ]; then  
        touch /var/lock/subsys/mysql-proxy  
    fi  
}
stop() {
    echo -n $"Stopping $prog: "  
    killproc -p $PROXY_PID -d 3 $prog  
    RETVAL=$?  
    echo  
    if [ $RETVAL -eq 0 ]; then  
        rm -f /var/lock/subsys/mysql-proxy  
        rm -f $PROXY_PID  
    fi  
}  
# See how we were called.  
case "$1" in  
    start)  
        start  
        ;;  
    stop)  
        stop  
        ;;  
    restart)  
        stop  
        start  
        ;;  
    condrestart|try-restart)  
        if status -p $PROXY_PIDFILE $prog >&/dev/null; then  
            stop  
            start  
        fi  
        ;;  
    status)  
        status -p $PROXY_PID $prog  
        ;;  
    *)  
        echo "Usage: $0 {start|stop|restart|reload|status|condrestart|try-restart}"  
        RETVAL=1  
        ;;  
esac
exit $RETVAL


[iyunv@proxy ~]# chmod +x /etc/rc.d/init.d/mysql-proxy #增加执行权限
[iyunv@proxy ~]# chkconfig --add mysql-proxy #加入服务  
[iyunv@proxy ~]# killall mysql-proxy #关闭mysql-proxy

18.启动并测试一下脚本(1).启动并查看日志与端口
Active Internet connections (only servers)  
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1066/rpcbind      
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1223/sshd         
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1299/master      
tcp        0      0 0.0.0.0:54053               0.0.0.0:*                   LISTEN      1084/rpc.statd   
tcp        0      0 0.0.0.0:4041                0.0.0.0:*                   LISTEN      3084/mysql-proxy  
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      3084/mysql-proxy    #大家可以看到端口已变为3306  
tcp        0      0 :::111                      :::*                        LISTEN      1066/rpcbind      
tcp        0      0 :::22                       :::*                        LISTEN      1223/sshd         
tcp        0      0 :::39894                    :::*                        LISTEN      1084/rpc.statd   
tcp        0      0 ::1:25                      :::*                        LISTEN      1299/master      
udp        0      0 0.0.0.0:37355               0.0.0.0:*                               1084/rpc.statd   
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               1066/rpcbind      
udp        0      0 0.0.0.0:817                 0.0.0.0:*                               1066/rpcbind      
udp        0      0 0.0.0.0:836                 0.0.0.0:*                               1084/rpc.statd   
udp        0      0 :::111                      :::*                                    1066/rpcbind      
udp        0      0 :::817                      :::*                                    1066/rpcbind      
udp        0      0 :::43102                    :::*                                    1084/rpc.statd   
[iyunv@proxy ~]# tail /var/log/mysql-proxy.log #查看一下日志  
2013-08-27 10:54:07: (message) added read/write backend: 192.168.18.201:3306  
2013-08-27 10:54:07: (message) added read-only backend: 192.168.18.202:3306  
2013-08-27 10:56:38: (debug) [network-mysqld.c:1134]: error on a connection (fd: -1 event: 0). closing client connection.  
2013-08-27 11:22:52: (message) Initiating shutdown, requested from signal handler  
2013-08-27 11:22:52: (message) shutting down normally, exit code is: 0  
2013-08-27 11:25:56: (critical) plugin proxy 0.8.3 started  
2013-08-27 11:25:56: (critical) plugin admin 0.8.3 started  
2013-08-27 11:25:56: (message) proxy listening on port 0.0.0.0:3306  
2013-08-27 11:25:56: (message) added read/write backend: 192.168.18.201:3306  
2013-08-27 11:25:56: (message) added read-only backend: 192.168.18.202:3306
(2).测试连接一下
[iyunv@slave ~]#  mysql -uroot -p -h192.168.18.203
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.6.13-log MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
Database           
+--------------------+
information_schema
mydb               
mydb1              
mydb2              
mydb3              
mysql              
performance_schema
test               
+--------------------+
8 rows in set (0.00 sec)
mysql>

注,大家可以看到,现在连接不用指定端口,默认使用3306端口。好了,到这里mysql-proxy实现读写分离配置全部完成,希望大家有所收获。^_^……




2033581_1377574419lbDU.png

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-8775-1-1.html 上篇帖子: Mysql的错误代码及消息 下篇帖子: mysql安装后无法启动

尚未签到

发表于 2013-9-27 15:47:10 | 显示全部楼层
勃起不是万能的,但不能勃起却是万万都不能的!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

尚未签到

发表于 2013-12-7 02:34:44 | 显示全部楼层
我不是无坚不摧的城墙,也没有百毒不侵的心脏

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

尚未签到

发表于 2014-1-10 21:48:43 | 显示全部楼层
只有在大排长龙时,才能真正体会到我们是‘龙的传人’。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表