Amoeba在CentOS6.5下的安装部署
1.需要的文件
2.部署过程
2.1下载amoeba
#mkdir /usr/local/amoeba/
#md5sum amoeba-mysql-binary-2.1.0-RC5.tar.gz |
2.2配置java环境(Amoeba的运行必须依赖java,版本必须为1.5或以上,这里采用JDK1.6版本)
2.3安装jdk
#mkdir /soft && cd /soft # chmod 755 jdk-6u25-linux-i586.bin |
2.4配置jdk
#vim/etc/profile
在文件最后添加如下内容
2.5配置amoeba环境变量
#vim/etc/profile在结尾添加如下内容
2.6测试JDK和AMOEBA_HOME是否设置成功
# java-version
# cd$AMOEBA_HOME && pwd
2.7解压并配置amoeba配置文件
# tar-zxvf amoeba-mysql-binary-2.1.0-RC5.tar.gz
# cd bin/
#chmod 755 *
#amoeba //如果显示下面的内容,证明amoeba的依耐关系安装完成
3.安装mysql
MySQL在Linux下的重要目录
数据库目录:/var/lib/mysql/
配置文件:/usr/share/mysql
相关命令:/usr/bin
启动脚本:/etc/rc.d/init.d
配置My.cnf文件的方法
cp/usr/share/mysql/my-huge.cnf /etc/my.cnf
查看二进制文件
mysqlbinlog/var/lib/mysql/mysql-bin.000001
4.测试通过amoeba操作MySQL
4.1启动amoeba
[root@bogon bin]# amoeba start log4j:WARN log4j config load completed from file:/usr/local/amoeba/conf/log4j.xml log4j:WARN ip access config load completed from file:/usr/local/amoeba/conf/access_list.conf 2014-07-03 04:30:51,105 INFO net.ServerableConnectionManager - Amoeba Monitor Server listening on /127.0.0.1:35367. 2014-07-03 04:30:51,106 INFO net.ServerableConnectionManager - Amoeba for Mysql listening on 0.0.0.0/0.0.0.0:8066.
|
4.2通过8066端口登陆
可以通过Server version看到是由amoeba连接上MySQL服务器的
[root@bogon Desktop]# mysql -uroot -P8066 -h127.0.0.1 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 646286321 Server version: 5.1.45-mysql-amoeba-proxy-2.0.1-BETA MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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>
|
也可以通过amoeba启动后的输出信息看出已经连接上amoeba
[root@bogon bin]# amoeba start log4j:WARN log4j config load completed from file:/usr/local/amoeba/conf/log4j.xml log4j:WARN ip access config load completed from file:/usr/local/amoeba/conf/access_list.conf 2014-07-03 04:30:51,105 INFO net.ServerableConnectionManager - Amoeba Monitor Server listening on /127.0.0.1:35367. 2014-07-03 04:30:51,106 INFO net.ServerableConnectionManager - Amoeba for Mysql listening on 0.0.0.0/0.0.0.0:8066. 2014-07-03 04:32:37,497 INFO server.MysqlClientAuthenticator - Accepting conn=com.meidusa.amoeba.mysql.net.MysqlClientConnection@127.0.0.1:59388,hashcode=918201446
|