systemctl stop firewalld.service
setenforce 0
cp jdk-6u14-linux-x64.bin /usr/local/ //复制
./jdk-6u14-linux-x64.bin
//安装jdk ,注意这一步,一路按回车到最后,提示输入yes,等待安装
mv jdk1.6.0_14/ /usr/local/jdk1.6
export JAVA_HOME=/usr/local/jdk1.6
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/lib:$JAVA_HOME/jre/bin/:$PATH:$HOME/bin
export AMOEBA_HOME=/usr/local/amoeba
export PATH=$PATH:$AMOEBA_HOME/bin
source /etc/profile
mkdir /usr/local/amoeba
tar zxvf amoeba-mysql-binary-2.2.0.tar.gz -C /usr/local/amoeba/
chmod -R 755 /usr/local/amoeba/
grant all on *.* to test@'192.168.220.%' identified by '123.com';
//允许ip为192.168.220网段从任意终端通过123.com的密码进行访问
vim conf/amoeba.xml
第30行:<property name="user">amoeba</property>
第32行:<property name="password">123456</property>
117行去掉注释:
<property name="writePool">master</property>
<property name="readPool">slaves</property>
26-29行:去掉注释,设置登录用户名和密码
<property name="user">test</property>
<property name="password">123.com</property>
找到主服务器和从服务器模块,修改好名称和对应IP地址:
主服务器:
<dbServer name="master" parent="abstractServer">
<property name="ipAddress">192.168.220.141</property>
第一台从服务器:
<dbServer name="slave1" parent="abstractServer">
<property name="ipAddress">192.168.220.140</property>
第二台从服务器:
<dbServer name="slave2" parent="abstractServer">
<property name="ipAddress">192.168.220.136</property>
指定从服务器池:
<dbServer name="slaves" virtual="true">
<property name="poolNames">slave1,slave2</property>
/usr/local/amoeba/bin/amoeba start& //&表示将进程放到后台,时间较长,稍等待
1
yum install -y mysql
mysql -u amoeba -p 123456 -h 192.168.220.129 -P8066
MySQL [school]> create table info (
-> id int(4) not null primary key, //指定id号,为primary key,不为空
-> name varchar(10) not null, //名字
-> score decimal(4,1) not null); //成绩
Query OK, 0 rows affected (0.03 sec)
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。