QingCloudAppcenter / Redis

Source repo for Redis Apps on QingCloud.
Apache License 2.0
1 stars 9 forks source link

防止集群互串引发的 bug #99

Closed MrYourM closed 3 years ago

MrYourM commented 3 years ago

app: redis cluster 情况:主节点被迁移后,由于从节点变为了主节点,导致原主节点无法起来 处理方式:

image

MrYourM commented 3 years ago

https://github.com/QingCloudAppcenter/redis/blob/master/ansible/roles/redis-cluster/files/opt/app/bin/node/redis-cluster.sh#L565 改为如下即可

myClusterIps="${myClusterIps%|*}|Epoch)"
hlwanghl commented 3 years ago

https://github.com/QingCloudAppcenter/redis/blob/master/ansible/roles/redis-cluster/files/opt/app/bin/node/redis-cluster.sh#L565 改为如下即可

myClusterIps="${myClusterIps%|*}|Epoch)"

这种情况下 nodes-6379.conf 内容是什么样?这段代码是判断有无集群外的 IP 混进来,不是一回事吧。

MrYourM commented 3 years ago

conf 文件比 cluster nodes 多了一个 var Epoch 类的信息,过滤掉就好了

hlwanghl commented 3 years ago

conf 文件比 cluster nodes 多了一个 var Epoch 类的信息,过滤掉就好了

最后多一行是吧?过滤尽量准确一些,不要把正常的行误删。

MrYourM commented 3 years ago