Overview of Redis Cluster main components
来源:互联网 发布:新网站如何做优化 编辑:程序博客网 时间:2024/04/28 09:55
Keys distribution model
HASH_SLOT = CRC16(key) mod 16384
CRC16 behaved remarkably well in distributing different kind of keys evenly across the 16384 slots.
总之,该方法可以是数据均匀的分配不同的节点上。
Keys hash tags
>Hash tags are a way to ensure that multiple keys are allocated in the same hash slot. This is used in order to implement multi-key operations in Redis Cluster.
rules:
IF the key contains a { character.
AND IF there is a } character on the right of {
AND IF there are one or more characters between the first occurrence of { and the first occurrence of }.
Examples:
{user1000}.following > hash key “user1000”
{user1000}.followers > hash key “user1000”
foo{}{bar} > hash key “foo{}{bar}”
foo{{bar}} > hash key “{bar”
foo{bar}{zap} > hash key “bar”
{}noMatterWhat > hash key while key
tips: 对于二进制key,为了确保整个key都被用于hash,可以另key以“{}”开头。
Cluster nodes attributes
unique name
唯一,当配置文件删除或者强行reset才会改变。
Redirection and resharding
MOVED Redirection
客户端可以向集群中的任何一个节点发消息,包括从节点。
处理过程:
1.能否处理if it is acceptable (that is, only a single key is mentioned in the query, or the multiple keys mentioned are all to the same hash slot)
2.归谁处理(查询slot–>node map)
3.处理,归自己处理,归其他节点处理,执行move指令。
示例:-MOVED 3999 127.0.0.1:6381
- Overview of Redis Cluster main components
- cluster-overview
- Spark Cluster Mode Overview
- Cluster Mode Overview
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- Redis Cluster
- redis cluster
- redis-cluster
- Redis Cluster
- redis cluster
- Redis --- Redis Cluster
- 用CornerStone配置SVN,HTTP及svn简单使用说明
- qt与mysql编程注意问题
- shell date命令使用
- 解决用userdel删除不掉用户的问题
- 用Android自带的signapk.jar + .x509.pem + .pk8签名应用程序
- Overview of Redis Cluster main components
- 【Useful VI】Easy VI Aborter 中止VI运行
- 使用Git上传项目代码到github
- PAT 素数对猜想 Java版本
- Android应用本地拒绝服务漏洞浅析
- DDL、DML和DCL的区别与理解
- POJ 3187 Backward Digit Sums
- hibernate.hbm2ddl.auto设置为update时数据库没有自动生成表结构
- Java wait() notify()方法使用实例讲解