1. 实施环境:

    master(amoeba):192.168.122.201

         安装:java-1.7.0-openjdk.x86_64,mysql-server,amoeba-mysql-3.0.5-RC-distribution.zip

    slave:192.168.122.202

        安装:mysql-server

  2. 配置主从master与slave的主从环境(略过)

  3. master与slave上创建用于amoeba连接数据库的授权用户:

    grant all privileges on *.* to amoeba@'%' identified by 'amoeba';

  4. amoeba的dbServer.xml配置文件修改:


                     
                              ${defaultManager}
                             64
                             128
                            
                             3306
                            
                             test
                            
                             amoeba
                             amoeba

                    

       #红色部分表示amoeba连接主从mysql的端口,操作的库(这个地方好像只要grant授权足够,可以忽略这块),用户名及密码(即步骤3创建的用户名和密码)


                    
                            
                             192.168.122.201
                    

            
            
                    
                            
                             192.168.122.202
                    

            

      #定义mysql主机

    slavePool" virtual="true">
                    
                            
                             1
                            
                             slave
                    

            
     #定义负载均衡策略及主机组

  5. amoeba的amoeba.xml配置文件修改:

    8066
    0.0.0.0

    #定义amoeba代理服务器端口及绑定ip地址

    amoeba
    amoeba

    #定义amoeba代理服务器的用户名和密码

    slavePool
    master
    slave

    #定义读写服务器

  6. 创建amoeba日志存放目录,并修改权限

    mkdir -m a=rwx /usr/local/amoeba/logs

  7. 启动amoeba服务
    /usr/local/amoeba/bin/launcher &

  8. 测试