修改规则
<table name="user" dataNode="dn101,dn102" rule="mod-long" />
修改rule.xml
修改分片依赖的columns
<tableRule name="mod-long">
<rule>
<columns>user_id</columns>
<algorithm>mod-long</algorithm>
</rule>
</tableRule>
修改数据节点
<function name="mod-long" class="io.mycat.route.function.PartitionByMod">
<!-- how many data nodes -->
<property name="count">2</property>
</function>
适合2的n的服务器,如果是两台,扩容的话是4 然后8