在上篇文章中介绍了Redis主从模式的优点和缺点,哨兵模式是建立在主从模式基础之上的,主从模式中一点主节点发生故障,必须引入手工切换,而哨兵模式则可以解决这个问题。
docker-compose.yml
本文示例在一主两从的Redis服务基础之上添加三个哨兵(Sentinel),示例的yml文件如下所示:
liumiaocn:redis liumiao$ cat docker-compose.yml
version: '2'
services:
# redis master
master:
image: redis:6.0.4
container_name: redis-master
restart: always
command: redis-server --port 6379 --requirepass liumiaocn@server --appendonly yes
ports:
- 6379:6379
volumes:
- ./data:/data
# redis slave 1
slave1:
image: redis:6.0.4
container_name: redis-slave-1
restart: always
command: redis-server --slaveof 192.168.31.242 6379 --port 6380 --requirepass liumiaocn@server --masterauth liumiaocn@server --appendonly yes
ports:
- 6380:6380
volumes:
- ./data:/data
# redis slave 2
slave2:
image: redis:6.0.4
container_name: redis-slave-2
restart: always
command: redis-server --slaveof 192.168.31.242 6379 --port 6381 --requirepass liumiaocn@server --masterauth liumiaocn@server --appendonly yes
ports:
- 6381:6381
volumes:
- ./data:/data
# reids sentinel 1
sentinel1:
image: redis:6.0.4
container_name: redis-sentinel-1
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
restart: always
ports:
- 26379:26379
volumes:
- ./sentinel1.conf:/usr/local/etc/redis/sentinel.conf
# reids sentinel 2
sentinel2:
image: redis:6.0.4
container_name: redis-sentinel-2
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
restart: always
ports:
- 26380:26379
volumes:
- ./sentinel2.conf:/usr/local/etc/redis/sentinel.conf
# reids sentinel 3
sentinel3:
image: redis:6.0.4
container_name: redis-sentinel-3
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
restart: always
ports:
- 26381:26379
volumes:
- ./sentinel3.conf:/usr/local/etc/redis/sentinel.conf
liumiaocn:redis liumiao$
配置文件信息
liumiaocn:redis liumiao$ cat sentinel1.conf
port 26379
dir "/tmp"
sentinel monitor redismaster 192.168.31.242 6379 2
sentinel down-after-milliseconds redismaster 30000
sentinel parallel-syncs redismaster 1
sentinel deny-scripts-reconfig yes
sentinel auth-pass redismaster liumiaocn@server
sentinel failover-timeout redismaster 180000
liumiaocn:redis liumiao$ diff sentinel1.conf sentinel2.conf
liumiaocn:redis liumiao$ diff sentinel1.conf sentinel3.conf
liumiaocn:redis liumiao$
启动服务
启动确认
liumiaocn:redis liumiao$ docker-compose up -d
Creating network "redis_default" with the default driver
Creating redis-sentinel-1 ... done
Creating redis-master ... done
Creating redis-slave-1 ... done
Creating redis-sentinel-2 ... done
Creating redis-sentinel-3 ... done
Creating redis-slave-2 ... done
liumiaocn:redis liumiao$
服务确认
liumiaocn:redis liumiao$ docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------------
redis-master docker-entrypoint.sh redis ... Up 0.0.0.0:6379->6379/tcp
redis-sentinel-1 docker-entrypoint.sh redis ... Up 0.0.0.0:26379->26379/tcp, 6379/tcp
redis-sentinel-2 docker-entrypoint.sh redis ... Up 0.0.0.0:26380->26379/tcp, 6379/tcp
redis-sentinel-3 docker-entrypoint.sh redis ... Up 0.0.0.0:26381->26379/tcp, 6379/tcp
redis-slave-1 docker-entrypoint.sh redis ... Up 6379/tcp, 0.0.0.0:6380->6380/tcp
redis-slave-2 docker-entrypoint.sh redis ... Up 6379/tcp, 0.0.0.0:6381->6381/tcp
liumiaocn:redis liumiao$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d6084a0e9d2e redis:6.0.4 "docker-entrypoint.s…" 48 seconds ago Up 46 seconds 6379/tcp, 0.0.0.0:6381->6381/tcp redis-slave-2
c0370c9f685a redis:6.0.4 "docker-entrypoint.s…" 48 seconds ago Up 46 seconds 0.0.0.0:6379->6379/tcp redis-master
e751670b0059 redis:6.0.4 "docker-entrypoint.s…" 48 seconds ago Up 46 seconds 6379/tcp, 0.0.0.0:26381->26379/tcp redis-sentinel-3
ad5a080315d3 redis:6.0.4 "docker-entrypoint.s…" 48 seconds ago Up 46 seconds 6379/tcp, 0.0.0.0:26380->26379/tcp redis-sentinel-2
c55e3c715994 redis:6.0.4 "docker-entrypoint.s…" 48 seconds ago Up 45 seconds 6379/tcp, 0.0.0.0:26379->26379/tcp redis-sentinel-1
34a10aac06fe redis:6.0.4 "docker-entrypoint.s…" 48 seconds ago Up 46 seconds 6379/tcp, 0.0.0.0:6380->6380/tcp redis-slave-1
liumiaocn:redis liumiao$
确认master信息
liumiaocn:redis liumiao$ redis-cli -p 26379
127.0.0.1:26379> sentinel master redismaster
1) "name"
2) "redismaster"
3) "ip"
4) "192.168.31.242"
5) "port"
6) "6379"
7) "runid"
8) "a2b5ed263dd7532ad2dca170bf6606592305890a"
9) "flags"
10) "master"
11) "link-pending-commands"
12) "0"
13) "link-refcount"
14) "1"
15) "last-ping-sent"
16) "0"
17) "last-ok-ping-reply"
18) "841"
19) "last-ping-reply"
20) "841"
21) "down-after-milliseconds"
22) "30000"
23) "info-refresh"
24) "4943"
25) "role-reported"
26) "master"
27) "role-reported-time"
28) "115686"
29) "config-epoch"
30) "0"
31) "num-slaves"
32) "2"
33) "num-other-sentinels"
34) "2"
35) "quorum"
36) "2"
37) "failover-timeout"
38) "180000"
39) "parallel-syncs"
40) "1"
127.0.0.1:26379>
确认slave信息
可以看到如下两个从节点信息
127.0.0.1:26379> sentinel slaves redismaster
1) 1) "name"
2) "192.168.240.1:6381"
3) "ip"
4) "192.168.240.1"
5) "port"
6) "6381"
7) "runid"
8) "9f9a35cdaa78c958eb85208f4cafbebf1d5f9ecb"
9) "flags"
10) "slave"
11) "link-pending-commands"
12) "0"
13) "link-refcount"
14) "1"
15) "last-ping-sent"
16) "0"
17) "last-ok-ping-reply"
18) "347"
19) "last-ping-reply"
20) "347"
21) "down-after-milliseconds"
22) "30000"
23) "info-refresh"
24) "1908"
25) "role-reported"
26) "slave"
27) "role-reported-time"
28) "162585"
29) "master-link-down-time"
30) "0"
31) "master-link-status"
32) "ok"
33) "master-host"
34) "192.168.31.242"
35) "master-port"
36) "6379"
37) "slave-priority"
38) "100"
39) "slave-repl-offset"
40) "36642"
2) 1) "name"
2) "192.168.240.1:6380"
3) "ip"
4) "192.168.240.1"
5) "port"
6) "6380"
7) "runid"
8) "059a12b5d15417adfcd02cbd635779071cb624cc"
9) "flags"
10) "slave"
11) "link-pending-commands"
12) "0"
13) "link-refcount"
14) "1"
15) "last-ping-sent"
16) "0"
17) "last-ok-ping-reply"
18) "348"
19) "last-ping-reply"
20) "348"
21) "down-after-milliseconds"
22) "30000"
23) "info-refresh"
24) "1907"
25) "role-reported"
26) "slave"
27) "role-reported-time"
28) "162591"
29) "master-link-down-time"
30) "0"
31) "master-link-status"
32) "ok"
33) "master-host"
34) "192.168.31.242"
35) "master-port"
36) "6379"
37) "slave-priority"
38) "100"
39) "slave-repl-offset"
40) "36642"
127.0.0.1:26379>
整体日志信息
liumiaocn:redis liumiao$ docker-compose logs
Attaching to redis-slave-2, redis-master, redis-sentinel-3, redis-sentinel-2, redis-sentinel-1, redis-slave-1
redis-slave-2 | 1:C 07 Jun 2020 01:42:29.377 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-slave-2 | 1:C 07 Jun 2020 01:42:29.377 # Redis version=6.0.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-slave-2 | 1:C 07 Jun 2020 01:42:29.377 # Configuration loaded
redis-slave-2 | 1:S 07 Jun 2020 01:42:29.380 * Running mode=standalone, port=6381.
redis-slave-2 | 1:S 07 Jun 2020 01:42:29.380 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis-slave-2 | 1:S 07 Jun 2020 01:42:29.380 # Server initialized
redis-slave-2 | 1:S 07 Jun 2020 01:42:29.380 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis-slave-2 | 1:S 07 Jun 2020 01:42:29.383 * Ready to accept connections
redis-slave-2 | 1:S 07 Jun 2020 01:42:29.383 * Connecting to MASTER 192.168.31.242:6379
redis-slave-2 | 1:S 07 Jun 2020 01:42:29.383 * MASTER <-> REPLICA sync started
redis-slave-2 | 1:S 07 Jun 2020 01:42:29.384 * Non blocking connect for SYNC fired the event.
redis-slave-2 | 1:S 07 Jun 2020 01:42:30.214 * Master replied to PING, replication can continue...
redis-slave-2 | 1:S 07 Jun 2020 01:42:30.218 * Partial resynchronization not possible (no cached master)
redis-slave-2 | 1:S 07 Jun 2020 01:42:30.221 * Full resync from master: f242fca3ad938609e70c192a0c492b4bfa97fc31:0
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.250 * MASTER <-> REPLICA sync: receiving 175 bytes from master to disk
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.251 * MASTER <-> REPLICA sync: Flushing old data
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.252 * MASTER <-> REPLICA sync: Loading DB in memory
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.255 * Loading RDB produced by version 6.0.4
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.256 * RDB age 1 seconds
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.256 * RDB memory usage when created 2.24 Mb
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.256 * MASTER <-> REPLICA sync: Finished with success
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.258 * Background append only file rewriting started by pid 22
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.290 * AOF rewrite child asks to stop sending diffs.
redis-slave-2 | 22:C 07 Jun 2020 01:42:31.290 * Parent agreed to stop sending diffs. Finalizing AOF...
redis-slave-2 | 22:C 07 Jun 2020 01:42:31.290 * Concatenating 0.00 MB of AOF diff received from parent.
redis-slave-2 | 22:C 07 Jun 2020 01:42:31.293 * SYNC append only file rewrite performed
redis-slave-2 | 22:C 07 Jun 2020 01:42:31.294 * AOF rewrite: 0 MB of memory used by copy-on-write
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.350 * Background AOF rewrite terminated with success
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.352 * Residual parent diff successfully flushed to the rewritten AOF (0.00 MB)
redis-slave-2 | 1:S 07 Jun 2020 01:42:31.355 * Background AOF rewrite finished successfully
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:29.974 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:29.974 # Redis version=6.0.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:29.974 # Configuration loaded
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:29.976 * Running mode=sentinel, port=26379.
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:29.976 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:29.983 # Sentinel ID is 96f68c8a1b158d081d3c1268d220e82c5c480abb
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:29.983 # +monitor master redismaster 192.168.31.242 6379 quorum 2
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:31.177 * +sentinel sentinel 1b9edaa4b9ef749ee8c12a10c10b65a2a34542a1 192.168.240.2 26379 @ redismaster 192.168.31.242 6379
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:31.617 * +sentinel sentinel 3258fb06b016bbdeecd506e08b343284c918a276 192.168.240.5 26379 @ redismaster 192.168.31.242 6379
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:40.274 * +slave slave 192.168.240.1:6380 192.168.240.1 6380 @ redismaster 192.168.31.242 6379
redis-sentinel-1 | 1:X 07 Jun 2020 01:42:40.280 * +slave slave 192.168.240.1:6381 192.168.240.1 6381 @ redismaster 192.168.31.242 6379
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:29.587 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:29.587 # Redis version=6.0.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:29.587 # Configuration loaded
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:29.589 * Running mode=sentinel, port=26379.
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:29.589 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:29.597 # Sentinel ID is 3258fb06b016bbdeecd506e08b343284c918a276
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:29.597 # +monitor master redismaster 192.168.31.242 6379 quorum 2
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:31.178 * +sentinel sentinel 1b9edaa4b9ef749ee8c12a10c10b65a2a34542a1 192.168.240.2 26379 @ redismaster 192.168.31.242 6379
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:31.990 * +sentinel sentinel 96f68c8a1b158d081d3c1268d220e82c5c480abb 192.168.240.7 26379 @ redismaster 192.168.31.242 6379
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:40.269 * +slave slave 192.168.240.1:6380 192.168.240.1 6380 @ redismaster 192.168.31.242 6379
redis-sentinel-3 | 1:X 07 Jun 2020 01:42:40.275 * +slave slave 192.168.240.1:6381 192.168.240.1 6381 @ redismaster 192.168.31.242 6379
redis-master | 1:C 07 Jun 2020 01:42:29.638 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-master | 1:C 07 Jun 2020 01:42:29.638 # Redis version=6.0.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-master | 1:C 07 Jun 2020 01:42:29.638 # Configuration loaded
redis-master | 1:M 07 Jun 2020 01:42:29.643 * Running mode=standalone, port=6379.
redis-master | 1:M 07 Jun 2020 01:42:29.643 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis-master | 1:M 07 Jun 2020 01:42:29.643 # Server initialized
redis-master | 1:M 07 Jun 2020 01:42:29.643 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis-master | 1:M 07 Jun 2020 01:42:29.645 * Ready to accept connections
redis-master | 1:M 07 Jun 2020 01:42:30.219 * Replica 192.168.240.1:6380 asks for synchronization
redis-master | 1:M 07 Jun 2020 01:42:30.219 * Full resync requested by replica 192.168.240.1:6380
redis-master | 1:M 07 Jun 2020 01:42:30.219 * Replication backlog created, my new replication IDs are 'f242fca3ad938609e70c192a0c492b4bfa97fc31' and '0000000000000000000000000000000000000000'
redis-master | 1:M 07 Jun 2020 01:42:30.219 * Starting BGSAVE for SYNC with target: disk
redis-master | 1:M 07 Jun 2020 01:42:30.220 * Background saving started by pid 19
redis-master | 1:M 07 Jun 2020 01:42:30.220 * Replica 192.168.240.1:6381 asks for synchronization
redis-master | 1:M 07 Jun 2020 01:42:30.220 * Full resync requested by replica 192.168.240.1:6381
redis-master | 1:M 07 Jun 2020 01:42:30.221 * Waiting for end of BGSAVE for SYNC
redis-master | 19:C 07 Jun 2020 01:42:30.224 * DB saved on disk
redis-master | 19:C 07 Jun 2020 01:42:30.224 * RDB: 0 MB of memory used by copy-on-write
redis-master | 1:M 07 Jun 2020 01:42:30.250 * Background saving terminated with success
redis-master | 1:M 07 Jun 2020 01:42:30.256 * Synchronization with replica 192.168.240.1:6380 succeeded
redis-master | 1:M 07 Jun 2020 01:42:30.258 * Synchronization with replica 192.168.240.1:6381 succeeded
redis-slave-1 | 1:C 07 Jun 2020 01:42:29.633 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-slave-1 | 1:C 07 Jun 2020 01:42:29.633 # Redis version=6.0.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-slave-1 | 1:C 07 Jun 2020 01:42:29.633 # Configuration loaded
redis-slave-1 | 1:S 07 Jun 2020 01:42:29.641 * Running mode=standalone, port=6380.
redis-slave-1 | 1:S 07 Jun 2020 01:42:29.641 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis-slave-1 | 1:S 07 Jun 2020 01:42:29.641 # Server initialized
redis-slave-1 | 1:S 07 Jun 2020 01:42:29.641 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis-slave-1 | 1:S 07 Jun 2020 01:42:29.644 * Ready to accept connections
redis-slave-1 | 1:S 07 Jun 2020 01:42:29.645 * Connecting to MASTER 192.168.31.242:6379
redis-slave-1 | 1:S 07 Jun 2020 01:42:29.645 * MASTER <-> REPLICA sync started
redis-slave-1 | 1:S 07 Jun 2020 01:42:29.647 * Non blocking connect for SYNC fired the event.
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.214 * Master replied to PING, replication can continue...
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.218 * Partial resynchronization not possible (no cached master)
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.221 * Full resync from master: f242fca3ad938609e70c192a0c492b4bfa97fc31:0
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.255 * MASTER <-> REPLICA sync: receiving 175 bytes from master to disk
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.470 * MASTER <-> REPLICA sync: Flushing old data
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.471 * MASTER <-> REPLICA sync: Loading DB in memory
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.476 * Loading RDB produced by version 6.0.4
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.476 * RDB age 0 seconds
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.476 * RDB memory usage when created 2.24 Mb
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.477 * MASTER <-> REPLICA sync: Finished with success
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.478 * Background append only file rewriting started by pid 21
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.510 * AOF rewrite child asks to stop sending diffs.
redis-slave-1 | 21:C 07 Jun 2020 01:42:30.510 * Parent agreed to stop sending diffs. Finalizing AOF...
redis-slave-1 | 21:C 07 Jun 2020 01:42:30.510 * Concatenating 0.00 MB of AOF diff received from parent.
redis-slave-1 | 21:C 07 Jun 2020 01:42:30.512 * SYNC append only file rewrite performed
redis-slave-1 | 21:C 07 Jun 2020 01:42:30.513 * AOF rewrite: 0 MB of memory used by copy-on-write
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.555 * Background AOF rewrite terminated with success
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.557 * Residual parent diff successfully flushed to the rewritten AOF (0.00 MB)
redis-slave-1 | 1:S 07 Jun 2020 01:42:30.559 * Background AOF rewrite finished successfully
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:29.122 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:29.122 # Redis version=6.0.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:29.122 # Configuration loaded
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:29.123 * Running mode=sentinel, port=26379.
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:29.123 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:29.130 # Sentinel ID is 1b9edaa4b9ef749ee8c12a10c10b65a2a34542a1
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:29.130 # +monitor master redismaster 192.168.31.242 6379 quorum 2
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:31.617 * +sentinel sentinel 3258fb06b016bbdeecd506e08b343284c918a276 192.168.240.5 26379 @ redismaster 192.168.31.242 6379
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:31.991 * +sentinel sentinel 96f68c8a1b158d081d3c1268d220e82c5c480abb 192.168.240.7 26379 @ redismaster 192.168.31.242 6379
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:40.318 * +slave slave 192.168.240.1:6380 192.168.240.1 6380 @ redismaster 192.168.31.242 6379
redis-sentinel-2 | 1:X 07 Jun 2020 01:42:40.325 * +slave slave 192.168.240.1:6381 192.168.240.1 6381 @ redismaster 192.168.31.242 6379
liumiaocn:redis liumiao$