I have a computer and I have configured one master and two slave Redis on it Three Redis Sentinels have been configured But the sentinels have no effect
How can Redis Sentinels connect and switch between main nodes?
Redis version 7.2.4
redis-1
- command
info replication
# Replication
role:master
connected_slaves:2
slave0:ip=192.168.0.200,port=6381,state=online,offset=112,lag=1
slave1:ip=192.168.0.200,port=6380,state=online,offset=112,lag=1
master_failover_state:no-failover
master_replid:11ccc77e30f5ac466f92c53cf4db287054ee727f
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:112
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1
repl_backlog_histlen:112
- Log
27548:C 22 Feb 2024 15:16:09.432 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
27549:C 22 Feb 2024 15:16:09.432 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27549:C 22 Feb 2024 15:16:09.432 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=27549, just started
27549:C 22 Feb 2024 15:16:09.432 * Configuration loaded
27549:M 22 Feb 2024 15:16:09.433 * Increased maximum number of open files to 10032 (it was originally set to 1024).
27549:M 22 Feb 2024 15:16:09.433 * monotonic clock: POSIX clock_gettime
27549:M 22 Feb 2024 15:16:09.433 * Running mode=standalone, port=6379.
27549:M 22 Feb 2024 15:16:09.434 * Server initialized
27549:M 22 Feb 2024 15:16:09.452 * Reading RDB base file on AOF loading...
27549:M 22 Feb 2024 15:16:09.453 * Loading RDB produced by version 7.2.4
27549:M 22 Feb 2024 15:16:09.453 * RDB age 1291 seconds
27549:M 22 Feb 2024 15:16:09.453 * RDB memory usage when created 0.83 Mb
27549:M 22 Feb 2024 15:16:09.453 * RDB is base AOF
27549:M 22 Feb 2024 15:16:09.453 * Done loading RDB, keys loaded: 1, keys expired: 0.
27549:M 22 Feb 2024 15:16:09.453 * DB loaded from base file appendonly.aof.3.base.rdb: 0.019 seconds
27549:M 22 Feb 2024 15:16:09.453 * DB loaded from append only file: 0.019 seconds
27549:M 22 Feb 2024 15:16:09.453 * Opening AOF incr file appendonly.aof.3.incr.aof on server start
27549:M 22 Feb 2024 15:16:09.453 * Ready to accept connections tcp
27549:M 22 Feb 2024 15:16:10.356 * Replica 192.168.0.200:6381 asks for synchronization
27549:M 22 Feb 2024 15:16:10.356 * Full resync requested by replica 192.168.0.200:6381
27549:M 22 Feb 2024 15:16:10.356 * Replication backlog created, my new replication IDs are '11ccc77e30f5ac466f92c53cf4db287054ee727f' and '0000000000000000000000000000000000000000'
27549:M 22 Feb 2024 15:16:10.356 * Delay next BGSAVE for diskless SYNC
27549:M 22 Feb 2024 15:16:10.356 * Replica 192.168.0.200:6380 asks for synchronization
27549:M 22 Feb 2024 15:16:10.356 * Full resync requested by replica 192.168.0.200:6380
27549:M 22 Feb 2024 15:16:10.356 * Delay next BGSAVE for diskless SYNC
27549:M 22 Feb 2024 15:16:15.370 * Starting BGSAVE for SYNC with target: replicas sockets
27549:M 22 Feb 2024 15:16:15.370 * Background RDB transfer started by pid 27584
27584:C 22 Feb 2024 15:16:15.372 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
27549:M 22 Feb 2024 15:16:15.372 * Diskless rdb transfer, done reading from pipe, 2 replicas still up.
27549:M 22 Feb 2024 15:16:15.420 * Background RDB transfer terminated with success
27549:M 22 Feb 2024 15:16:15.420 * Streamed RDB transfer with replica 192.168.0.200:6381 succeeded (socket). Waiting for REPLCONF ACK from replica to enable streaming
27549:M 22 Feb 2024 15:16:15.420 * Synchronization with replica 192.168.0.200:6381 succeeded
27549:M 22 Feb 2024 15:16:15.420 * Streamed RDB transfer with replica 192.168.0.200:6380 succeeded (socket). Waiting for REPLCONF ACK from replica to enable streaming
27549:M 22 Feb 2024 15:16:15.420 * Synchronization with replica 192.168.0.200:6380 succeeded
- config
bind 0.0.0.0
port 6379
protected-mode no
requirepass 111111
masterauth 111111
loglevel notice
logfile "/opt/downsoft/redis-7.2.4/logs/redis-1.log"
# RDP 配置 (直接保存最终数据)
save 900 1
# dir /config/
# AOF 配置 (保存每一条命令输入)
appendonly yes
appendfilename "appendonly.aof"
appenddirname "appendonlydir"
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 1k
daemonize yes
redis-2
- command
info replication
# Replication
role:slave
master_host:192.168.0.200
master_port:6379
master_link_status:up
master_last_io_seconds_ago:7
master_sync_in_progress:0
slave_read_repl_offset:350
slave_repl_offset:350
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:11ccc77e30f5ac466f92c53cf4db287054ee727f
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:350
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1
repl_backlog_histlen:350
- Log
27550:C 22 Feb 2024 15:16:09.435 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
27555:C 22 Feb 2024 15:16:09.435 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27555:C 22 Feb 2024 15:16:09.435 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=27555, just started
27555:C 22 Feb 2024 15:16:09.435 * Configuration loaded
27555:S 22 Feb 2024 15:16:09.436 * Increased maximum number of open files to 10032 (it was originally set to 1024).
27555:S 22 Feb 2024 15:16:09.436 * monotonic clock: POSIX clock_gettime
27555:S 22 Feb 2024 15:16:09.436 * Running mode=standalone, port=6380.
27555:S 22 Feb 2024 15:16:09.436 * Server initialized
27555:S 22 Feb 2024 15:16:09.452 * Reading RDB base file on AOF loading...
27555:S 22 Feb 2024 15:16:09.452 * Loading RDB produced by version 7.2.4
27555:S 22 Feb 2024 15:16:09.453 * RDB age 1291 seconds
27555:S 22 Feb 2024 15:16:09.453 * RDB memory usage when created 0.83 Mb
27555:S 22 Feb 2024 15:16:09.453 * RDB is base AOF
27555:S 22 Feb 2024 15:16:09.453 * Done loading RDB, keys loaded: 1, keys expired: 0.
27555:S 22 Feb 2024 15:16:09.453 * DB loaded from base file appendonly.aof.3.base.rdb: 0.016 seconds
27555:S 22 Feb 2024 15:16:09.453 * DB loaded from append only file: 0.016 seconds
27555:S 22 Feb 2024 15:16:09.453 * Opening AOF incr file appendonly.aof.3.incr.aof on server start
27555:S 22 Feb 2024 15:16:09.453 * Ready to accept connections tcp
27555:S 22 Feb 2024 15:16:10.355 * Connecting to MASTER 192.168.0.200:6379
27555:S 22 Feb 2024 15:16:10.355 * MASTER <-> REPLICA sync started
27555:S 22 Feb 2024 15:16:10.355 * Non blocking connect for SYNC fired the event.
27555:S 22 Feb 2024 15:16:10.355 * Master replied to PING, replication can continue...
27555:S 22 Feb 2024 15:16:10.356 * Partial resynchronization not possible (no cached master)
27555:S 22 Feb 2024 15:16:15.370 * Full resync from master: 11ccc77e30f5ac466f92c53cf4db287054ee727f:0
27555:S 22 Feb 2024 15:16:15.372 * MASTER <-> REPLICA sync: receiving streamed RDB from master with EOF to disk
27555:S 22 Feb 2024 15:16:15.372 * MASTER <-> REPLICA sync: Flushing old data
27555:S 22 Feb 2024 15:16:15.372 * MASTER <-> REPLICA sync: Loading DB in memory
27555:S 22 Feb 2024 15:16:15.437 * Loading RDB produced by version 7.2.4
27555:S 22 Feb 2024 15:16:15.437 * RDB age 0 seconds
27555:S 22 Feb 2024 15:16:15.437 * RDB memory usage when created 0.97 Mb
27555:S 22 Feb 2024 15:16:15.437 * Done loading RDB, keys loaded: 1, keys expired: 0.
27555:S 22 Feb 2024 15:16:15.437 * MASTER <-> REPLICA sync: Finished with success
27555:S 22 Feb 2024 15:16:15.437 * Creating AOF incr file temp-appendonly.aof.incr on background rewrite
27555:S 22 Feb 2024 15:16:15.437 * Background append only file rewriting started by pid 27588
27588:C 22 Feb 2024 15:16:15.471 * Successfully created the temporary AOF base file temp-rewriteaof-bg-27588.aof
27588:C 22 Feb 2024 15:16:15.472 * Fork CoW for AOF rewrite: current 0 MB, peak 0 MB, average 0 MB
27555:S 22 Feb 2024 15:16:15.570 * Background AOF rewrite terminated with success
27555:S 22 Feb 2024 15:16:15.570 * Successfully renamed the temporary AOF base file temp-rewriteaof-bg-27588.aof into appendonly.aof.4.base.rdb
27555:S 22 Feb 2024 15:16:15.570 # Error trying to rename the temporary AOF incr file appendonlydir/temp-appendonly.aof.incr into appendonlydir/appendonly.aof.4.incr.aof: No such file or directory
27555:S 22 Feb 2024 15:16:15.570 * Removing the temp incr aof file temp-appendonly.aof.incr in the background
27555:S 22 Feb 2024 15:16:15.671 * Creating AOF incr file temp-appendonly.aof.incr on background rewrite
27555:S 22 Feb 2024 15:16:15.672 * Background append only file rewriting started by pid 27589
27589:C 22 Feb 2024 15:16:15.700 * Successfully created the temporary AOF base file temp-rewriteaof-bg-27589.aof
27589:C 22 Feb 2024 15:16:15.701 * Fork CoW for AOF rewrite: current 0 MB, peak 0 MB, average 0 MB
27555:S 22 Feb 2024 15:16:15.772 * Background AOF rewrite terminated with success
27555:S 22 Feb 2024 15:16:15.772 * Successfully renamed the temporary AOF base file temp-rewriteaof-bg-27589.aof into appendonly.aof.4.base.rdb
27555:S 22 Feb 2024 15:16:15.772 * Successfully renamed the temporary AOF incr file temp-appendonly.aof.incr into appendonly.aof.4.incr.aof
27555:S 22 Feb 2024 15:16:15.810 * Removing the history file appendonly.aof.3.incr.aof in the background
27555:S 22 Feb 2024 15:16:15.810 * Removing the history file appendonly.aof.3.base.rdb in the background
27555:S 22 Feb 2024 15:16:15.845 * Background AOF rewrite finished successfully
- conf
bind 0.0.0.0
port 6380
protected-mode no
requirepass 111111
# 从机连接主机
replicaof 192.168.0.200 6379
masterauth 111111
loglevel notice
logfile "/opt/downsoft/redis-7.2.4/logs/redis-2.log"
# RDP 配置 (直接保存最终数据)
save 900 1
# dir /config/
# AOF 配置 (保存每一条命令输入)
appendonly yes
appendfilename "appendonly.aof"
appenddirname "appendonlydir"
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 1k
daemonize yes
redis-3
- command
info replication
# Replication
role:slave
master_host:192.168.0.200
master_port:6379
master_link_status:up
master_last_io_seconds_ago:9
master_sync_in_progress:0
slave_read_repl_offset:826
slave_repl_offset:826
slave_priority:100
slave_read_only:1
replica_announced:1
connected_slaves:0
master_failover_state:no-failover
master_replid:11ccc77e30f5ac466f92c53cf4db287054ee727f
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:826
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1
repl_backlog_histlen:826
- Log
27556:C 22 Feb 2024 15:16:09.437 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
27561:C 22 Feb 2024 15:16:09.438 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27561:C 22 Feb 2024 15:16:09.438 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=27561, just started
27561:C 22 Feb 2024 15:16:09.438 * Configuration loaded
27561:S 22 Feb 2024 15:16:09.438 * Increased maximum number of open files to 10032 (it was originally set to 1024).
27561:S 22 Feb 2024 15:16:09.438 * monotonic clock: POSIX clock_gettime
27561:S 22 Feb 2024 15:16:09.438 * Running mode=standalone, port=6381.
27561:S 22 Feb 2024 15:16:09.439 * Server initialized
27561:S 22 Feb 2024 15:16:09.452 * Reading RDB base file on AOF loading...
27561:S 22 Feb 2024 15:16:09.453 * Loading RDB produced by version 7.2.4
27561:S 22 Feb 2024 15:16:09.453 * RDB age 1291 seconds
27561:S 22 Feb 2024 15:16:09.453 * RDB memory usage when created 0.83 Mb
27561:S 22 Feb 2024 15:16:09.453 * RDB is base AOF
27561:S 22 Feb 2024 15:16:09.453 * Done loading RDB, keys loaded: 1, keys expired: 0.
27561:S 22 Feb 2024 15:16:09.453 * DB loaded from base file appendonly.aof.3.base.rdb: 0.014 seconds
27561:S 22 Feb 2024 15:16:09.453 * DB loaded from append only file: 0.014 seconds
27561:S 22 Feb 2024 15:16:09.453 * Opening AOF incr file appendonly.aof.3.incr.aof on server start
27561:S 22 Feb 2024 15:16:09.453 * Ready to accept connections tcp
27561:S 22 Feb 2024 15:16:10.355 * Connecting to MASTER 192.168.0.200:6379
27561:S 22 Feb 2024 15:16:10.355 * MASTER <-> REPLICA sync started
27561:S 22 Feb 2024 15:16:10.355 * Non blocking connect for SYNC fired the event.
27561:S 22 Feb 2024 15:16:10.355 * Master replied to PING, replication can continue...
27561:S 22 Feb 2024 15:16:10.356 * Partial resynchronization not possible (no cached master)
27561:S 22 Feb 2024 15:16:15.370 * Full resync from master: 11ccc77e30f5ac466f92c53cf4db287054ee727f:0
27561:S 22 Feb 2024 15:16:15.372 * MASTER <-> REPLICA sync: receiving streamed RDB from master with EOF to disk
27561:S 22 Feb 2024 15:16:15.372 * MASTER <-> REPLICA sync: Flushing old data
27561:S 22 Feb 2024 15:16:15.372 * MASTER <-> REPLICA sync: Loading DB in memory
27561:S 22 Feb 2024 15:16:15.419 * Loading RDB produced by version 7.2.4
27561:S 22 Feb 2024 15:16:15.419 * RDB age 0 seconds
27561:S 22 Feb 2024 15:16:15.419 * RDB memory usage when created 0.97 Mb
27561:S 22 Feb 2024 15:16:15.419 * Done loading RDB, keys loaded: 1, keys expired: 0.
27561:S 22 Feb 2024 15:16:15.419 * MASTER <-> REPLICA sync: Finished with success
27561:S 22 Feb 2024 15:16:15.419 * Creating AOF incr file temp-appendonly.aof.incr on background rewrite
27561:S 22 Feb 2024 15:16:15.420 * Background append only file rewriting started by pid 27587
27587:C 22 Feb 2024 15:16:15.454 * Successfully created the temporary AOF base file temp-rewriteaof-bg-27587.aof
27587:C 22 Feb 2024 15:16:15.455 * Fork CoW for AOF rewrite: current 0 MB, peak 0 MB, average 0 MB
27561:S 22 Feb 2024 15:16:15.470 * Background AOF rewrite terminated with success
27561:S 22 Feb 2024 15:16:15.470 * Successfully renamed the temporary AOF base file temp-rewriteaof-bg-27587.aof into appendonly.aof.4.base.rdb
27561:S 22 Feb 2024 15:16:15.470 * Successfully renamed the temporary AOF incr file temp-appendonly.aof.incr into appendonly.aof.4.incr.aof
27561:S 22 Feb 2024 15:16:15.515 * Removing the history file appendonly.aof.3.incr.aof in the background
27561:S 22 Feb 2024 15:16:15.515 * Removing the history file appendonly.aof.3.base.rdb in the background
27561:S 22 Feb 2024 15:16:15.645 * Background AOF rewrite finished successfully
- conf
bind 0.0.0.0
port 6381
protected-mode no
requirepass 111111
replicaof 192.168.0.200 6379
masterauth 111111
loglevel notice
logfile "/opt/downsoft/redis-7.2.4/logs/redis-3.log"
# RDP 配置 (直接保存最终数据)
save 900 1
#dir
# AOF 配置 (保存每一条命令输入)
appendonly yes
appendfilename "appendonly.aof"
appenddirname "appendonlydir"
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 1k
daemonize yes
redis-Sentinel-1
- command
>SENTINEL MASTER mymaster
name
mymaster
ip
192.168.0.200
port
6379
runid
flags
s_down,master,disconnected
link-pending-commands
0
link-refcount
1
last-ping-sent
803085
last-ok-ping-reply
803085
last-ping-reply
755
s-down-time
773040
down-after-milliseconds
30000
info-refresh
0
role-reported
master
role-reported-time
803085
config-epoch
0
num-slaves
0
num-other-sentinels
0
quorum
2
failover-timeout
180000
parallel-syncs
1
> info Sentinel
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_tilt_since_seconds:-1
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=sdown,address=192.168.0.200:6379,slaves=0,sentinels=1
- Log
27562:X 22 Feb 2024 15:16:09.439 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
27567:X 22 Feb 2024 15:16:09.440 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27567:X 22 Feb 2024 15:16:09.440 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=27567, just started
27567:X 22 Feb 2024 15:16:09.440 * Configuration loaded
27567:X 22 Feb 2024 15:16:09.440 * Increased maximum number of open files to 10032 (it was originally set to 1024).
27567:X 22 Feb 2024 15:16:09.440 * monotonic clock: POSIX clock_gettime
27567:X 22 Feb 2024 15:16:09.441 * Running mode=sentinel, port=26379.
27567:X 22 Feb 2024 15:16:09.441 * Sentinel ID is 4de59c9e10aa7a3e39dd7d9c01c956549e73c56b
27567:X 22 Feb 2024 15:16:09.441 # +monitor master mymaster 192.168.0.200 6379 quorum 2
27567:X 22 Feb 2024 15:16:39.484 # +sdown master mymaster 192.168.0.200 6379
- conf
protected-mode no
port 26379
daemonize yes
pidfile "/var/run/redis-sentinel-1.pid"
loglevel notice
logfile "/opt/downsoft/redis-7.2.4/logs/redis-sentinel-1.log"
sentinel announce-ip "192.168.0.200"
dir "/tmp"
sentinel monitor mymaster 192.168.0.200 6379 2
sentinel auth-user mymaster 111111
acllog-max-len 128
sentinel deny-scripts-reconfig yes
sentinel resolve-hostnames no
sentinel announce-hostnames no
latency-tracking-info-percentiles 50 99 99.9
user default on nopass sanitize-payload ~* &* +@all
sentinel config-epoch mymaster 0
sentinel leader-epoch mymaster 1
sentinel current-epoch 1
sentinel myid 4de59c9e10aa7a3e39dd7d9c01c956549e73c56b
redis-Sentinel-2
- command
SENTINEL MASTER mymaster
name
mymaster
ip
192.168.0.200
port
6379
runid
flags
s_down,master,disconnected
link-pending-commands
0
link-refcount
1
last-ping-sent
1328600
last-ok-ping-reply
1328600
last-ping-reply
541
s-down-time
1298596
down-after-milliseconds
30000
info-refresh
0
role-reported
master
role-reported-time
1328600
config-epoch
0
num-slaves
0
num-other-sentinels
0
quorum
2
failover-timeout
180000
parallel-syncs
1
> info sentinel
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_tilt_since_seconds:-1
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=sdown,address=192.168.0.200:6379,slaves=0,sentinels=1
- Log
27568:X 22 Feb 2024 15:16:09.442 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
27573:X 22 Feb 2024 15:16:09.442 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27573:X 22 Feb 2024 15:16:09.442 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=27573, just started
27573:X 22 Feb 2024 15:16:09.442 * Configuration loaded
27573:X 22 Feb 2024 15:16:09.442 * Increased maximum number of open files to 10032 (it was originally set to 1024).
27573:X 22 Feb 2024 15:16:09.442 * monotonic clock: POSIX clock_gettime
27573:X 22 Feb 2024 15:16:09.443 * Running mode=sentinel, port=26380.
27573:X 22 Feb 2024 15:16:09.443 * Sentinel ID is 422097d72074deaf4dbacb2c59c3494d0ff8022b
27573:X 22 Feb 2024 15:16:09.443 # +monitor master mymaster 192.168.0.200 6379 quorum 2
27573:X 22 Feb 2024 15:16:39.446 # +sdown master mymaster 192.168.0.200 6379
- conf
protected-mode no
port 26380
daemonize yes
pidfile "/var/run/redis-sentinel-2.pid"
loglevel notice
logfile "/opt/downsoft/redis-7.2.4/logs/redis-sentinel-2.log"
sentinel announce-ip "192.168.0.200"
dir "/tmp"
sentinel monitor mymaster 192.168.0.200 6379 2
sentinel auth-user mymaster 111111
acllog-max-len 128
sentinel deny-scripts-reconfig yes
sentinel resolve-hostnames no
sentinel announce-hostnames no
latency-tracking-info-percentiles 50 99 99.9
user default on nopass sanitize-payload ~* &* +@all
sentinel config-epoch mymaster 0
sentinel leader-epoch mymaster 1
sentinel current-epoch 1
sentinel myid 422097d72074deaf4dbacb2c59c3494d0ff8022b
redis-Sentinel-3
- command
> SENTINEL MASTER mymaster
name
mymaster
ip
192.168.0.200
port
6379
runid
flags
s_down,master,disconnected
link-pending-commands
0
link-refcount
1
last-ping-sent
1512466
last-ok-ping-reply
1512466
last-ping-reply
239
s-down-time
1482429
down-after-milliseconds
30000
info-refresh
0
role-reported
master
role-reported-time
1512466
config-epoch
0
num-slaves
0
num-other-sentinels
0
quorum
2
failover-timeout
180000
parallel-syncs
1
> info sentinel
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_tilt_since_seconds:-1
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=sdown,address=192.168.0.200:6379,slaves=0,sentinels=1
- log
27574:X 22 Feb 2024 15:16:09.443 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
27579:X 22 Feb 2024 15:16:09.444 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27579:X 22 Feb 2024 15:16:09.444 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=27579, just started
27579:X 22 Feb 2024 15:16:09.444 * Configuration loaded
27579:X 22 Feb 2024 15:16:09.444 * Increased maximum number of open files to 10032 (it was originally set to 1024).
27579:X 22 Feb 2024 15:16:09.444 * monotonic clock: POSIX clock_gettime
27579:X 22 Feb 2024 15:16:09.445 * Running mode=sentinel, port=26381.
27579:X 22 Feb 2024 15:16:09.445 * Sentinel ID is 273a1c37f7e8811103640b9e223de970c28388dd
27579:X 22 Feb 2024 15:16:09.445 # +monitor master mymaster 192.168.0.200 6379 quorum 2
27579:X 22 Feb 2024 15:16:39.480 # +sdown master mymaster 192.168.0.200 6379
- conf
protected-mode no
port 26381
daemonize yes
pidfile "/var/run/redis-sentinel-3.pid"
loglevel notice
logfile "/opt/downsoft/redis-7.2.4/logs/redis-sentinel-3.log"
sentinel announce-ip "192.168.0.200"
dir "/tmp"
sentinel monitor mymaster 192.168.0.200 6379 2
sentinel auth-user mymaster 111111
acllog-max-len 128
sentinel deny-scripts-reconfig yes
sentinel resolve-hostnames no
sentinel announce-hostnames no
latency-tracking-info-percentiles 50 99 99.9
user default on nopass sanitize-payload ~* &* +@all
sentinel config-epoch mymaster 0
sentinel leader-epoch mymaster 1
sentinel current-epoch 1
sentinel myid 273a1c37f7e8811103640b9e223de970c28388dd
Comment From: LiHanGod
I have solved it. Delete the old configuration and replace it with a new one. The IP configuration for Redis master-slave needs to be completely consistent with the configuration for Redis Sentry monitoring. 192.168.0.200 matches 192.168.0.200, 127.0.0.1 matches 127.0.0.1