<?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 rule SYSTEM "rule.dtd">

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

-<tableRule name="rule1">

-<rule>

<columns>id</columns>

<algorithm>func1</algorithm>

</rule>

</tableRule>

-<tableRule name="rule2">

-<rule>

<columns>user_id</columns>

<algorithm>func1</algorithm>

</rule>

</tableRule>

-<tableRule name="sharding-by-intfile">

-<rule>

<columns>sharding_id</columns>

<algorithm>hash-int</algorithm>

</rule>

</tableRule>

-<tableRule name="auto-sharding-long">

-<rule>

<columns>id</columns>

<algorithm>rang-long</algorithm>

</rule>

</tableRule>

-<tableRule name="mod-long">

-<rule>

<columns>id</columns>

<algorithm>mod-long</algorithm>

</rule>

</tableRule>

-<tableRule name="sharding-by-murmur">

-<rule>

<columns>id</columns>

<algorithm>murmur</algorithm>

</rule>

</tableRule>

-<tableRule name="sharding-by-month">

-<rule>

<columns>create_date</columns>

<algorithm>partbymonth</algorithm>

</rule>

</tableRule>

-<tableRule name="latest-month-calldate">

-<rule>

<columns>calldate</columns>

<algorithm>latestMonth</algorithm>

</rule>

</tableRule>

-<tableRule name="auto-sharding-rang-mod">

-<rule>

<columns>id</columns>

<algorithm>rang-mod</algorithm>

</rule>

</tableRule>

-<tableRule name="jch">

-<rule>

<columns>id</columns>

<algorithm>jump-consistent-hash</algorithm>

</rule>

</tableRule>

<!--add in 2010.10.13 by zhangkai-->

-<tableRule name="dguid">

-<rule>

<columns>device_guid</columns>

<algorithm>murmur</algorithm>

</rule>

</tableRule>

<!--add in 2010.10.19 by zhangkai-->

-<tableRule name="userid">

-<rule>

<columns>userid</columns>

<algorithm>murmur</algorithm>

</rule>

</tableRule>

<!--add in 2010.10.20 by zhangkai-->

-<tableRule name="id">

-<rule>

<columns>id</columns>

<algorithm>murmur</algorithm>

</rule>

</tableRule>

<!--add in 2010.10.26 by zhangkai-->

-<tableRule name="keyname">

-<rule>

<columns>keyname</columns>

<algorithm>murmur</algorithm>

</rule>

</tableRule>

-<function name="murmur" class="org.opencloudb.route.function.PartitionByMurmurHash">

<property name="seed">0</property>

<!-- 默认是0 -->

<property name="count">1</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>

-<function name="hash-int" class="org.opencloudb.route.function.PartitionByFileMap">

<property name="mapFile">partition-hash-int.txt</property>

</function>

-<function name="rang-long" class="org.opencloudb.route.function.AutoPartitionByLong">

<property name="mapFile">autopartition-long.txt</property>

</function>

-<function name="mod-long" class="org.opencloudb.route.function.PartitionByMod">

<!-- how many data nodes -->

<property name="count">3</property>

</function>

-<function name="func1" class="org.opencloudb.route.function.PartitionByLong">

<property name="partitionCount">8</property>

<property name="partitionLength">128</property>

</function>

-<function name="latestMonth" class="org.opencloudb.route.function.LatestMonthPartion">

<property name="splitOneDay">24</property>

</function>

-<function name="partbymonth" class="org.opencloudb.route.function.PartitionByMonth">

<property name="dateFormat">yyyy-MM-dd</property>

<property name="sBeginDate">2015-01-01</property>

</function>

-<function name="rang-mod" class="org.opencloudb.route.function.PartitionByRangeMod">

<property name="mapFile">partition-range-mod.txt</property>

</function>

-<function name="jump-consistent-hash" class="org.opencloudb.route.function.PartitionByJumpConsistentHash">

<property name="totalBuckets">3</property>

</function>

</mycat:rule>

mycat-rule的更多相关文章

  1. Mycat分布式数据库架构解决方案--rule.xml详解

    echo编辑整理,欢迎转载,转载请声明文章来源.欢迎添加echo微信(微信号:t2421499075)交流学习. 百战不败,依不自称常胜,百败不颓,依能奋力前行.--这才是真正的堪称强大!!! 该文件 ...

  2. mycat schema server rule

    schema <?xml version="1.0"?> <!DOCTYPE mycat:schema SYSTEM "schema.dtd" ...

  3. 【无私分享:ASP.NET CORE 项目实战(第十三章)】Asp.net Core 使用MyCat分布式数据库,实现读写分离

    目录索引 [无私分享:ASP.NET CORE 项目实战]目录索引 简介 MyCat2.0版本很快就发布了,关于MyCat的动态和一些问题,大家可以加一下MyCat的官方QQ群:106088787.我 ...

  4. MySQL分布式集群之MyCAT(转)

    原文地址:http://blog.itpub.net/29510932/viewspace-1664499/ 隔了好久,才想起来更新博客,最近倒腾的数据库从Oracle换成了MySQL,研究了一段时间 ...

  5. LVS+MYCAT读写分离+MYSQL同步部署手册(第三版)

    1      配置MYSQL主备同步 1.1    测试环境 mysql版本:5.6.24: 操作系统内核版本:Linux-3.13-0-32 主数据库IP:192.168.10.3: 主数据库名:d ...

  6. LVS+MYCAT+读写分离+MYSQL主备同步部署手册

    LVS+MYCAT+读写分离+MYSQL主备同步部署手册 1          配置MYSQL主备同步…. 2 1.1       测试环境… 2 1.2       配置主数据库… 2 1.2.1  ...

  7. Windows环境Mycat数据库分库分表中间件部署

    下载地址MYCAT官方网站 jdk安装配置 首先去oracle官网下载并安装jdk8,添加环境变量,JAVA_HOME设置为D:\Worksoftware\Java\jdk1.8 CLASSPATH设 ...

  8. 【转载】LVS+MYCAT+读写分离+MYSQL主备同步部署手册(邢锋)

    LVS+MYCAT+读写分离+MYSQL主备同步部署手册 1          配置MYSQL主备同步…. 2 1.1       测试环境… 2 1.2       配置主数据库… 2 1.2.1  ...

  9. mycat表拆分操作教程

    1,迁移数据 举例说明,比如一个博客数据库数据表如下: 这里水平拆分,垂直拆分,只是做个简单的实验,真正的线上业务要根据情况,数据进行拆分. ? 1 2 3 4 5 6 7 8 9 10 11 12 ...

  10. net Core 使用MyCat分布式数据库,实现读写分离

    net Core 使用MyCat分布式数据库,实现读写分离 目录索引 [无私分享:ASP.NET CORE 项目实战]目录索引 简介 MyCat2.0版本很快就发布了,关于MyCat的动态和一些问题, ...

随机推荐

  1. Linux记录-常用统计awk

    #统计第一列ip的个数(uniq -c 打印重复行count计数) cat ip.txt | awk '{print $1}' | sort | uniq -c | sort -rn | head - ...

  2. 【440】Tweet 元素意义

          参考:Tweet Object 参考:Geo Objects 参考:User Object Ref: Place data dictionary Tweet Object Attribut ...

  3. c# 子线程与主线程通信二

    之前写过使用线程上下文实现线程同步,今天利用子线程向主线程发送事件,实现子线程与主线程的同步 基本步骤 1.定义类 using System; using System.Collections.Gen ...

  4. HTML布局排版2 div的和图片平铺方便管理

    在HTML里,由于浏览器显示器等差异,浏览器的宽度也会有变化,为了适应不同的宽度,需要用到平铺.例如页面前面的固定的条等,如果是纯色,可以用背景色,如果不是纯色,是渐变等,可以用条状图平铺.常见的布局 ...

  5. LM_ReadImgMode.js PC单页轮播读图模式组件,零依赖!

    LM_ReadImgMode.js PC单页轮播读图模式组件,零依赖! github:http://dtdxrk.github.io/LM-ReadImgMode/ TXT 1.全新的2.0版本,脱离 ...

  6. MySQL索引对NULL值的处理

    # 索引不会包含有NULL值的列 只要列中包含有NULL值都将不会被包含在索引中,复合索引中只要有一列含有NULL值,那么这一列对于此复合索引就是无效的.所以我们在数据库设计时不要让字段的默认值为NU ...

  7. 2019.10.28 IDEA入门指南(很多人问补充一篇)

    Idea快速入门指南 1.安装 1.1.安装 我们使用的是最新的2017.3.4版本: 双击打开, 选择一个目录,最好不要中文和空格: 然后选择桌面快捷方式,请选择64位: 然后选择安装: 开始安装: ...

  8. redhat与zlib兼容性问题?

    今天在redhat 6.3 x64版本上安装了zlib,安装完后可以正常使用,就是发现gedit使用有点异常——无法启动,当时也没在意,但是后来重启电脑后出现桌面背景图片后就不弹出登陆窗口了,但是进命 ...

  9. LeetCode 70. 爬楼梯(Climbing Stairs)

    70. 爬楼梯 70. Climbing Stairs 题目描述 假设你正在爬楼梯.需要 n 阶你才能到达楼顶. 每次你可以爬 1 或 2 个台阶.你有多少种不同的方法可以爬到楼顶呢? 注意: 给定 ...

  10. TensorSpace:超酷炫3D神经网络可视化框架

    TensorSpace:超酷炫3D神经网络可视化框架 TensorSpace - 一款 3D 模型可视化框架,支持多种模型,帮助你可视化层间输出,更直观地展示模型的输入输出,帮助理解模型结构和输出方法 ...