mycat使用--schema配置

<?xml version="1.0"?>

<!DOCTYPE schema SYSTEM "schema.dtd">

-<mycat:schema xmlns:mycat="http://org.opencloudb/">


-<schema sqlMaxLimit="100" checkSQLschema="false" name="TESTDB">

<!--设备相关表-->

<table name="tb_device_basic" rule="dguid" dataNode="dnd1" primaryKey="id"/>

<table name="tb_user_device" rule="userid" dataNode="dnd1" primaryKey="id"/>

<table name="tb_device_alarm" rule="dguid" dataNode="dnd1" primaryKey="id"/>

<table name="tb_device_user" rule="dguid" dataNode="dnd1" primaryKey="id"/>

<table name="tb_app_version" rule="dguid" dataNode="dnd1" primaryKey="id"/>

<table name="tb_advertisement_version" rule="dguid" dataNode="dnd1" primaryKey="id"/>

<table name="tb_weburl" rule="dguid" dataNode="dnd1" primaryKey="id"/>

<table name="tb_device_version" rule="dguid" dataNode="dnd1" primaryKey="id"/>

<table name="mycat_sequence" dataNode="dnd1" primaryKey="name"/>

<table name="statistics" rule="keyname" dataNode="dnd1" primaryKey="id"/>

<table name="sysuser" rule="id" dataNode="dnd1" primaryKey="id"/>

<!-- 账号相关表-->


<table name="tb_user" rule="userid" dataNode="dna1" primaryKey="id"/>

<!-- 用户权限管理相关表 -->


<table name="sysrole" rule="rule1" dataNode="dnd1" primaryKey="id"/>

<table name="sysfunction" rule="rule1" dataNode="dnd1" primaryKey="id"/>

<table name="sysrole_function" rule="rule1" dataNode="dnd1" primaryKey="id"/>

<table name="sysuser_role" rule="rule1" dataNode="dnd1" primaryKey="id"/>

</schema>

<!-- <dataNode name="dn1$0-743" dataHost="localhost1" database="db$0-743" /> -->


<dataNode name="dnd1" database="DeviceDB" dataHost="deviceservice1"/>

<dataNode name="dna1" database="Account_XiaoWei" dataHost="accountservice1"/>


-<dataHost name="deviceservice1" slaveThreshold="100" switchType="1" dbDriver="jdbc" dbType="mysql" writeType="0" balance="0" minCon="10" maxCon="1000">

<heartbeat>select user()</heartbeat>

-<writeHost password="***" user="***" url="jdbc:mysql://***:3306" host="hostM1">

<!-- can have multi read hosts -->


</writeHost>


</dataHost>


-<dataHost name="accountservice1" slaveThreshold="100" switchType="1" dbDriver="jdbc" dbType="mysql" writeType="0" balance="0" minCon="10" maxCon="1000">

<heartbeat>select user()</heartbeat>

<!-- can have multi write hosts -->


<writeHost password="***" user="***" url="jdbc:mysql://***:3306" host="hostM2">    </writeHost>

</dataHost>

</mycat:schema>

 

posted on 2015-11-30 11:48  战神归来  阅读(1747)  评论(0编辑  收藏  举报

导航