说明:分片规则都定义在rule.xml文件里面
<!--pc28源码出租【企 娥:217 1793 408】
tableRule标签:定义table分片策略
-->
<tableRule name="rule1">
<!--
rule标签:策略定义标签
-->
<rule>
<!--
columns标签:对应的分片字段
-->
<columns>id</columns>
<!--
algorithm标签:tableRule分片策略对应的function名称
-->
<algorithm>func1</algorithm>
</rule>
</tableRule>
<!-- 定义分片函数 -->
<function name="func1" class="io.mycat.route.function.PartitionByLong">
<property name="partitionCount">1,1,2,3,1</property><!-- 分片数 -->
<property name="partitionLength">128,128,128,128,128</property><!-- 分片长度 -->
</function>