MyCat 配置读写分离
时间:2020-04-05 03:02:37
收藏:0
阅读:101
<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
评论(0)