mycat

1、修改schema.xml

 1 <?xml version="1.0"?>
  2 <!DOCTYPE mycat:schema SYSTEM "schema.dtd">
  3 <mycat:schema xmlns:mycat="http://io.mycat/">
  4 
  5         <schema name="TESTDB" checkSQLschema="false" sqlMaxLimit="100" dataNode="dn1" >
  6         </schema>
  7         <dataNode name="dn1" dataHost="host1" database="db1" />
  8         <dataHost name="host1" maxCon="1000" minCon="10" balance="0"
  9                           writeType="0" dbType="mysql" dbDriver="native" switchType="1"  slaveThreshold="10    0"> 10                 <heartbeat>select user()</heartbeat> 11                 <!-- can have multi write hosts -->
 12                 <writeHost host="hostM1" url="192.168.1.111:3306" user="root"
 13                                    password="root">
 14                         <!-- can have multi read hosts -->
 15                         <readHost host="hostS1" url="192.168.132.129:3306" user="root" password="root" />
 16                 </writeHost>
 17         </dataHost>
 18 </mycat:schema>

你可能感兴趣的:(mycat)