<dataHost name="localhost1" maxCon="1000" minCon="10" balance="1" writeType="0" dbType="mysql" dbDriver="native" switchType="1" slaveThreshold="100"> <heartbeat>select user()</heartbeat> <writeHost host="hostM1" url="localhost:3306" user="root" password="testpw"> </writeHost> <writeHost host="hostM2" url="192.168.1.6:3306" user="root" password="testpw"> </writeHost> </dataHost>
备注:读的操作不要写事务。不然会引起跨库查询
原文地址:https://www.cnblogs.com/w2011/p/12635332.html
时间: 2024-10-19 07:44:12