1、不使用Mycat托管MySQL主從服務器,簡單使用如下配置:
<dataNodename="dn1" dataHost="localhost1" database="db1"/> <dataNodename="dn2" dataHost="localhost1" database="db2"/> <dataNodename="dn3" dataHost="localhost1" database="db3"/> <dataHost name="localhost1"maxCon="1000" minCon="10" balance="0" writeType="0"dbType="mysql" dbDriver="native"switchType="1" slaveThreshold="100"> <heartbeat>selectuser()</heartbeat> <writeHosthost="hostM" url="10.1.176.158:3306" user="root" password="123456"> </writeHost> </dataHost>