You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sdny-order/mycat-config/rule.xml

36 lines
2.1 KiB

<?xml version="1.0" encoding="UTF-8"?>
<!-- - - Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License. - You
may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0
- - Unless required by applicable law or agreed to in writing, software -
distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the
License for the specific language governing permissions and - limitations
under the License. -->
<!DOCTYPE mycat:rule SYSTEM "rule.dtd">
<mycat:rule xmlns:mycat="http://io.mycat/">
<!--订单根据税号使用一致性hash规则进行拆分,-->
<tableRule name="xhfNsrsbhHashRule">
<rule>
<columns>xhf_nsrsbh</columns>
<algorithm>xhfNsrsbh_murmur</algorithm>
</rule>
</tableRule>
<function name="xhfNsrsbh_murmur" class="io.mycat.route.function.PartitionByMurmurHash">
<property name="seed">0</property> <!-- 默认是0-->
<property name="count">3</property><!-- 要分片的数据库节点数量,必须指定,否则没法分片-->
<property name="virtualBucketTimes">160</property><!-- 一个实际的数据库节点被映射为这么多虚拟节点,默认是160倍,也就是虚拟节点数是物理节点数的160倍-->
<!--
<property name="weightMapFile">weightMapFile</property>
节点的权重,没有指定权重的节点默认是 1。以 properties 文件的格式填写,以从 0 开始到 count-1 的整数值也就
是节点索引为 key,以节点权重值为值。所有权重值必须是正整数,否则以 1 代替 -->
<!--
<property name="bucketMapPath">/etc/mycat/bucketMapPath</property>
用于测试时观察各物理节点与虚拟节点的分布情况,如果指定了这个属性,会把虚拟节点的 murmur hash 值与物理节
点的映射按行输出到这个文件,没有默认值,如果不指定,就不会输出任何东西 -->
</function>
</mycat:rule>