mycat的配置文件
<?xml version="1.0"?>
<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
<mycat:schema xmlns:mycat="http://io.mycat/">
<schema name="RDRS_MYCAT_002" checkSQLschema="true" sqlMaxLimit="100000">
<table name='MYCAT_TARGETTABLE' primaryKey='USERID' subTables='mycat_targettable_$0-3' rule='mycatrule4'
dataNode="mysql_node_1,mysql_node_2" selDbColumn='USERID'>
</table>
<table name="mycat_targettable_0,mycat_targettable_1" primaryKey='USERID' dataNode="mysql_node_1"/>
<table name="mycat_targettable_2,mycat_targettable_3" primaryKey='USERID' dataNode="mysql_node_2"/>
</schema>
<dataNode name="mysql_node_1" dataHost="mysql_1" database="rdrsshard_003" />
<dataNode name="mysql_node_2" dataHost="mysql_2" database="rdrsshard_004" />
<dataHost name="mysql_1" maxCon="500" minCon="10" balance="0" writeType="0" dbType="mysql" dbDriver="native"
switchType="1" slaveThreshold="100">
<heartbeat>select user()</heartbeat>
<writeHost host="mysql_1" url="10.47.147.46:3306" user="fabu" password="SuningRds@123"></writeHost>
</dataHost>
<dataHost name="mysql_2" maxCon="500" minCon="10" balance="0" writeType="0" dbType="mysql" dbDriver="native"
switchType="1" slaveThreshold="100">
<heartbeat>select user()</heartbeat>
<writeHost host="mysql_2" url="10.47.147.45:3306" user="fabu" password="SuningRds@123"></writeHost>
</dataHost>
</mycat:schema>