一、Amoeba工作原理

二、Amoeba安装及配置详解

    下载:

    wget 
http://iweb.dl.sourceforge.net/project/amoeba/Amoeba%20for%20mysql/3.x/amoeba-mysql-3.0.5-RC-distribution.zip



解压后可直接使用

本人主要测试读写分离

配置文件

amoeba.xml关键点配置:


                        
                        
                        8066

                        
                        
                        192.168.0.3

                        
                                
                                        128
                                        64
                                
                        

                        
                                
                                        
                                        root
                                        
                                        123

                                        
                                                
                                                        ${amoeba.home}/conf/access_list.conf
                                                
                                        
                                
                        

                

此段配置的是连接到amoeba的账号和密码,账号密码是自行设置


wKioL1Y8SdqwpFHeAADW3cmN-yQ927.jpg

此段设置的是读写分离的mysql服务器,server1,server2,mutipool等在dbServer.xml内设置

说明:此处defaultPool设定的mysql服务器是除/select/update/delete/insert以外的操作都会在此mysql执行,所以一般定义为master

writePool定义的是写数据库

readPool定义的是读数据库,如果要使用多台数据库进行读操作,可参考dbServer.xml的multiPool定义


dbServer.xml关键点配置:


                
                        ${defaultManager}
                        64
                        128

                        
                        
                        3306

                        
                        proxy_test

                        
                        
                        xtrabackup
                        
                        test123
                

                
                        500
                        500
                        1
                        600000
                        600000
                        true
                        true
                        true
                
        
        
        
                
                        
                        
                        192.168.0.1
                
        

        
                
                        
                        192.168.0.2
                
        
        
        
                
                        
                        1

                        
                        
                        server1,server2
                
        


启动服务

./bin/launcher &


注意点:

    1.需安装java

    2.需在主从服务器上建立可以让amoeba服务器进行远程连接的账号


三、测试

连接amoeba

mysql -uxtrabackup -ptest123 -P8066 -h 127.0.0.1

测试方式同mysql-proxy读写分离的测试方式


关闭主从服务器负载在一台添加新数据,进行查询测试