6. ->master_user='repl_user',
7. ->master_password='copy',
8. ->master_log_file='mysql-bin.000017',
9. ->master_log_pos=2009;
10. QueryOK,0rowsaffected(0.03sec)
11.
12. mysql>startslave;
13. QueryOK,0rowsaffected(0.00sec)
2. Amoeba 读写分离的配置
a. Master , Slave1 ,Slave2 中开放权限给 Amoeba 访问。
在 Master , Slave1 , Slave2 中分别执行
Sql 代码
1. mysql>grantallontest.*totest_user@192.168.14.129indentifiedby
'1234';
Amoeba 访问三个数据库的账号密码相同。
b. 修改 Amoeba 的配置文件
配置文件详细说明请查看 官方文档:http://docs.hexnova.com/amoeba/rw-splitting.html
dbServer.xml
Xml 代码
1. <?xmlversion="1.0"encoding="gbk"?>
2.
3. <!DOCTYPEamoeba:dbServersSYSTEM"dbserver.dtd">
4. <amoeba:dbServersxmlns:amoeba="http://amoeba.meidusa.com/">
5.
6. <!--
7. EachdbServerneedstobeconfiguredintoaPool,
8. IfyouneedtoconfiguremultipledbServerwithloadbalan
cingthatcanbesimplifiedbythefollowingconfiguration:
9. addattributewithnamevirtual="true"indbServer,but
theconfigurationdoesnotallowtheelementwithnamefactoryConfig
10. suchas'multiPool'dbServer
11. -->
12.
13. <!--数据库连接配置的公共部分 -->
14. <dbServername="abstractServer"abstractive="true">