卸載或重新安裝Redis集群
1.如果需要修改端口號,則需要將原來的Redis各節點的服務器卸載,並重新安裝,
卸載服務命令如下:
D:/Redis/redis-server.exe --service-uninstall --service-name Redis6382 D:/Redis/redis-server.exe --service-uninstall --service-name Redis6381 D:/Redis/redis-server.exe --service-uninstall --service-name Redis6380
注意:如果只是想重新安裝集群,可以跳過第一步;
2.停止當前Redis集群各節點的服務,然后刪除對應的數據文件 *.aof 和配置文件 *.conf
如圖中的 appendonly.6380.aof、appendonly.6381.aof、appendonly.6382.aof 和 nodes.6380.conf、nodes.6381.conf、nodes.6382.conf
3.重啟所有Redis節點服務,然后再使用以下命令進行創建
redis-trib.rb create --replicas 0 127.0.0.1:6380 127.0.0.1:6381 127.0.0.1:6382
如何搭建Redis集群,請查看下面的鏈接