Amoeba为阿里的工程师的开源项目,实现高并发集群读写分离而开发的
转载请原创作者:QQ:87180023
前提:master和slave已经做好了主从复制
下载:
jdk-6u3-linux-i586.bin
# wget http://www.mkongjian.com/soft/lnmp/jdk-6u3-linux-i586.bin
amoeba-mysql-binary-2.1.0-RC5.tar.gz
# wget http://www.mkongjian.com/soft/lnmp/amoeba-mysql-binary-2.1.0-RC5.tar.gz
安装jdk
# chmod +x jdk-6u3-linux-i586.bin
# ./jdk-6u3-linux-i586.bin
# mv jdk1.6.0_03 /usr/local/java
# vim /etc/profile
在最后添加
export JAVA_HOME=/usr/local/java
export JAVA_BIN=/usr/local/java/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH==.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
# source /etc/profile
# mkdir /usr/local/amoeba
# tar zxvf amoeba-mysql-binary-2.1.0-RC5.tar.gz -C /usr/local/amoeba/
# vim dbServers.xml
#以下是我的配置文件
#**************************************************************************************
${defaultManager}
64
128
3306
dbname
user
password
500
500
10
600000
600000
true
true
192.168.10.231
192.168.10.211
1
server1,server2
#****************************************************************************************************
# vim amoeba.xml
#****************************************************************************************************
3306
192.168.10.225
${clientConnectioneManager}
128
64
user
password
${amoeba.home}/conf/access_list.conf
192.168.10.225
true
${clientConnectioneManager}
20
30
30
500
60
com.meidusa.amoeba.net.ConnectionManager
com.meidusa.amoeba.net.AuthingableConnectionManager
${amoeba.home}/conf/dbServers.xml
${amoeba.home}/conf/rule.xml
${amoeba.home}/conf/ruleFunctionMap.xml
${amoeba.home}/conf/functionMap.xml
1500
server1
true
#************************************************************************************************************
注意:我这里定义"readPool">server1,server2,server2,server2这个是1:3的意思,让大多数读的直接在server2去
转载请原创作者:QQ:87180023
定义amoeba内存参数,我这里定义了最大2G的并发占用连接
# vim /usr/local/amoeba/bin/amoeba
将 DEFAULT_OPTS="-server -Xms256m -Xmx256m -Xss128k"
修改为 DEFAULT_OPTS="-server -Xms1024m -Xmx2048m -Xss512k"
启动文件,最好以后台方式启动
nohup /usr/local/amoeba/bin/amoeba start &
停止amoeba
/usr/local/amoeba/bin/amoeba stop
本文出自 “linux进阶屋” 博客,谢绝转载!