添加Master节点到集群按照Redis集群一的方式,创建端口为7006的新实例,并启动该实例
添加Slave节点到集群
删除一个Slave节点#redis-trib del-node ip:port '<node-id>' redis-trib.rb del-node 127.0.0.1:7007 'c7ee2fca17cb79fe3c9822ced1d4f6c5e169e378' 删除一个Master节点删除master节点之前首先要使用reshard移除master的全部slot,然后再删除当前节点(目前只能把被删除master的slot迁移到一个节点上) redis-trib.rb reshard 127.0.0.1:7006 #根据提示选择要迁移的slot数量(ps:这里选择500) How many slots do you want to move (from 1 to 16384)? 500 #选择要接受这些slot的node-id What is the receiving node ID? f51e26b5d5ff74f85341f06f28f125b7254e61bf #选择slot来源: #all表示从所有的master重新分配, #或者数据要提取slot的master节点id,最后用done结束 Please enter all the source node IDs. Type 'all' to use all the nodes as source nodes for the hash slots. Type 'done' once you entered all the source nodes IDs. Source node #1:3375be2ccc321932e8853234ffa87ee9fde973ff Source node #2:done #打印被移动的slot后,输入yes开始移动slot以及对应的数据. #Do you want to proceed with the proposed reshard plan (yes/no)? yes #结束 #删除空master节点 redis-trib.rb del-node 127.0.0.1:7006 'c7ee2fca17cb79fe3c9822ced1d4f6c5e169e378' 转载请保留固定链接: https://linuxeye.com/Linux/2464.html |