Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Sentinel failover does not happen when node went down #12753

Open
zhaozhiguang opened this issue Nov 12, 2023 · 1 comment
Open

[BUG] Sentinel failover does not happen when node went down #12753

zhaozhiguang opened this issue Nov 12, 2023 · 1 comment

Comments

@zhaozhiguang
Copy link

Describe the bug

Sentinel failover does not happen when node went down.
Log display

Failed to resolve hostname 'redis1'

when I execute

docker stop redis1

To reproduce

env detail:
deploy redis with sentinel in High Availiability mode(cluster size =3)

docker image redis:6.2.8
docker network create -d bridge mybridge

redis1.conf

port 6379
bind 0.0.0.0
protected-mode no
replica-announce-ip "redis1"

redis2.conf

port 6379
bind 0.0.0.0
protected-mode no
replica-announce-ip "redis1"
replicaof redis1 6379

redis3.conf

port 6379
bind 0.0.0.0
protected-mode no
replica-announce-ip "redis1"
replicaof redis1 6379

sentinel1.conf

bind 0.0.0.0
protected-mode no
port 26379
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel monitor mymaster redis1 6379 2
sentinel down-after-milliseconds mymaster 3000
sentinel failover-timeout mymaster 60000
sentinel announce-ip "sentinel1"

sentinel2.conf

bind 0.0.0.0
protected-mode no
port 26379
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel monitor mymaster redis1 6379 2
sentinel down-after-milliseconds mymaster 3000
sentinel failover-timeout mymaster 60000
sentinel announce-ip "sentinel2"

sentinel3.conf

bind 0.0.0.0
protected-mode no
port 26379
sentinel announce-hostnames yes
sentinel resolve-hostnames yes
sentinel monitor mymaster redis1 6379 2
sentinel down-after-milliseconds mymaster 3000
sentinel failover-timeout mymaster 60000
sentinel announce-ip "sentinel3"

When I execute 'docker stop redis', the Docker will remove the host name mapping, but this situation can be understood as the node being unhealthy and causing a failover

Expected behavior

failover should start within configure time and slave nodes should be able to serve the request.

Additional information

1)when node went down failover is not happening and always getting resolve hostname error.

@zhaozhiguang
Copy link
Author

Something was described incorrectly
redis2.conf

port 6379
bind 0.0.0.0
protected-mode no
replica-announce-ip "redis2"
replicaof redis1 6379

redis3.conf

port 6379
bind 0.0.0.0
protected-mode no
replica-announce-ip "redis3"
replicaof redis1 6379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant