以刪除節(jié)點(diǎn):?192.168.148.117:9001@19001?為例:
1.?檢查此節(jié)點(diǎn)是否有slave節(jié)點(diǎn) ,如果有slave節(jié)點(diǎn) 啤月,先刪除對應(yīng)的slave節(jié)點(diǎn)
2.?重新分配此節(jié)點(diǎn)192.168.148.117:9001?數(shù)據(jù)slot到其它節(jié)點(diǎn),?執(zhí)行:
redis-cli --cluster reshard 192.168.148.117:9001@19001 -a 'password'
如果提示 : not agree?一類肌索,則需執(zhí)行修復(fù)指令:
redis-cli --cluster check 192.168.148.117:9001? -a 'password'
redis-cli --cluster fix 192.168.148.117:9001??-a 'password'
3.?執(zhí)行完畢后,再次重新重分配命令:
redis-cli --cluster reshard 192.168.148.117:9001@19001 -a 'password'
根據(jù)提示輸入要移動(dòng)的slot數(shù)量饭聚,?接收slot的nodes ID(名稱) 逸雹,? ?遷移出的nodes ID(名稱)這里輸入此次需移出節(jié)點(diǎn)的node名稱
執(zhí)行完畢后,會收到提示遷移完成俐镐;
此時(shí)查看到nodes狀態(tài)矫限,可以發(fā)現(xiàn)此節(jié)點(diǎn)192.168.148.117:9001@19001? slot數(shù)據(jù)已經(jīng)不存在;?表示遷移成功佩抹;
4.?執(zhí)行刪除節(jié)點(diǎn)命令:
redis-cli --cluster del-node 192.168.148.117:9001@19001 1350b6ec95c282a71e57d95cb9f5be2deeceb21e -a 'password'
可收到提示叼风,刪除節(jié)點(diǎn)成功,節(jié)點(diǎn)關(guān)閉棍苹;
5.?查次cluster nodes狀態(tài)无宿,可發(fā)現(xiàn)節(jié)點(diǎn)node已經(jīng)被成功刪除;?
大功告成!