Redis Sentinel did not work correctly when restart
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kolla-ansible |
Fix Released
|
Undecided
|
Liping Mao |
Bug Description
Problem:
Redis Sentinel did not work correctly when restart.
Reproduce:
a). Boot redis and redis sentinel on three controllers.
b). restart redis sentinel container.
c). Check sentinels number increase from 3 to 4.
# redis-cli -h $IP -p 26379
info
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_
sentinel_
sentinel_
master0:
d). if you restart the container again, the sentinels on other node will increase 1 again.
e). In this case, if some redis failed, the cluster will not work properly in take over redis master case.
Root cause:
In the case, we use kolla COPY_ALWAYS, kolla will copy configuration for /etc/redis/
So we can set up sentinel myid in /etc/redis/
Changed in kolla-ansible: | |
assignee: | nobody → Liping Mao (limao) |
Reviewed: https:/ /review. openstack. org/594177 /git.openstack. org/cgit/ openstack/ kolla-ansible/ commit/ ?id=735d085bc72 ca7cc774c8612ed 0d373e018610c5
Committed: https:/
Submitter: Zuul
Branch: master
commit 735d085bc72ca7c c774c8612ed0d37 3e018610c5
Author: Liping Mao (limao) <email address hidden>
Date: Tue Aug 21 21:40:29 2018 +0800
Fix redis sentinel change myid every time when it restarted
If you use COPY_ALWAYS, kolla will overwrite /etc/redis/ redis.conf.
But Redis Sentinel will store myid in this file. So when it restart,
Redis Sentinel will regenerate new myid every time. Redis Sentinel
cluster will see more and more sentinel, This patch use hash value
with hostname as sentinel myid.
Change-Id: I6d9403231e41ba ac177f29c58e67b a605795385d
Closes-bug: #1788179