1 / 14
文档名称:

redis客户端和工具集(ppt课件).pptx

格式:pptx   大小:927KB   页数:14页
下载后只包含 1 个 PPTX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

redis客户端和工具集(ppt课件).pptx

上传人:1017848967 2021/11/6 文件大小:927 KB

下载得到文件列表

redis客户端和工具集(ppt课件).pptx

相关文档

文档介绍

文档介绍:Redis 客户端和工具集
潘海龙
平安健康互联网
2018-03-29
建立集群
节点可用性检测

(if cluster_enabled==1?)
3、是否已经为其他集群成员(if cluster_known_nodes==1?)

配置slot和节点role
对主节点进行slot分配(addslots),cluster_state become ok and cluster_slots_assigned become not null
为每个节点设置不同的config_epoch(set-config-epoch)
节点加入集群(CLUSTER MEET)
主从配置(replicate)
Reshard
redis- reshard --from 36f35d6a4b7e124fa36769f3ba8abb31ac1c56dd,7aafe0d0318cba23837b9833c1398eb315329539,9eb273fc679d2687e40db8fc78e8d4654cb10c3f,ea71af515c10cbe6574176760728a4f2dfa03eaa,00403a9e516ba69ad1b22d629c44c36a2a0d6fc9,d77f827188851248ee6860ff984be9c965768445 --to aa9f6da7fab5ee3de97320dd5f31a32797eb67ee --slots 1365 --yes :7011
计算需要的slot
775行 通过slot个数对源节点进行排序,slot多的排在前面
776行-778行 计算源节点的slot总个数
779行-785行 可以看到按照节点占slot总数的百分比来迁移slot,及slot个数越多的节点将被迁移更多。还可以看到slot节点最多的节点会为slot的最大整数
786行-791行 将slot的分派到节点的信息插入moved变量中
客户端初始化
节点选择
场景:
Master: :7013 Slave: :8013
过程:
startup_nodes
(60)
Kill :7013
Set a 1
客户端反应:
ConnectionError (:7013)
Remove connection(:7013)
Random node(:7012)
MoveError(MOVED 15495 :8013)
update partitial node and slot information(::7013)
Send command(:8013)
命令接口调用主要涉及三个重要环节,
()

()
Set a 1转换为Redis协议
[set,a ,1]
AOF分析
模拟客户端