mycat主从复制的配置 schema.xml文件配置
<?xml version="1.0"?> <!DOCTYPE mycat:schema SYSTEM "schema.dtd"> <mycat:schema xmlns:mycat="http://io.mycat/"> <schema name="MYCATDATA" checkSQLschema="false" sqlMaxLimit="100" dataNode="dn1"></schema> <!-- <dataNode name="dn1$0-743" dataHost="localhost1" database="db$0-743" /> --> <dataNode name="dn1" dataHost="localhost1" database="thinkcmf" /> <dataHost name="localhost1" maxCon="1000" minCon="10" balance="3" writeType="0" dbType="mysql" dbDriver="native" switchType="2" slaveThreshold="100"> <heartbeat>show slave status</heartbeat> <!-- can have multi write hosts --> <writeHost host="hostM1" url="192.168.43.127:3306" user="mycat" password="123456"> <readHost host="hostS1" url="192.169.43.149:3306" user="mycat2" password="123456" /> </writeHost> <writeHost host="hostM2" url="192.168.43.62:3306" user="mycat" password="123456"> <readHost host="hostS2" url="192.169.43.76:3306" user="mycat" password="123456" /> </writeHost> <!-- <writeHost host="hostM2" url="localhost:3316" user="root" password="123456"/> --> </dataHost> </mycat:schema>