MyCat arranged separate read and write

    <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>

 Note: Do not write transaction read operations. Otherwise it will lead to cross-database query

Guess you like

Origin www.cnblogs.com/w2011/p/12635332.html