<?xml version="1.0"?>
<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
<mycat:schema xmlns:mycat="http://io.mycat/">
<schema name="TESTDB" checkSQLschema="false" sqlMaxLimit="100" dataNode="orders">
<!--配置表-->
<table name="lmrs_orders" primaryKey="id" subTables="lmrs_orders_$0-63" dataNode="orders" rule="mod-long"/>
<table name="lmrs_orders_items" primaryKey="id" subTables="lmrs_order_items_$0-63" dataNode="orders" rule="mod-long"/>
<table name="lmrs_user_order_index" primaryKey="user_id" subTables="lmrs_user_order_index_$0-63" dataNode="orders" rule="mod-long-user_id"/>
</schema>
<!--配置節點-->
<dataNode name="orders" dataHost="lmrs_orders" database="lmrs_2008_orders"/>
<!--設定資料來源-->
<dataHost name="lmrs_orders" maxCon="1000" minCon="10" balance="3"
writeType="0" dbType="mysql" dbDriver="native" switchType="1" slaveThreshold="100">
<heartbeat>select user()</heartbeat>
<writeHost host="hostM1" url="172.18.12.1:3306" user="root" password="root">
<readHost host="hostS1" url="172.18.12.1:3307" user="root" password="root"/>
<readHost host="hostS2" url="172.18.12.1:3308" user="root" password="root"/>
</writeHost>
</dataHost>
</mycat:schema>
本作品採用《CC 協議》,轉載必須註明作者和本文連結