[redis]docker 启动 7.0.5 版本的3个哨兵 当2个哨兵容器的ip 地址一样时,在第3个哨兵里执行 sentinel sentinels mymaster 返回的其他哨兵信息只有1个

2023-12-08 591 views
1

1、sentinel 启动命令 docker run --name redis-sentinel -v /data/redis-sentinel/conf/:/bitnami/redis-sentinel/conf/ -d bitnami/redis-sentinel:7.0.5

2、查看3个哨兵的ip docker inspect redis-sentinel

192.168.62.129 image

192.168.62.130 image

192.168.62.136 image

3、在129节点的哨兵里查看其他哨兵 image

4、在另外2个节点的哨兵里查看其他哨兵 image

127.0.0.1:26379> sentinel sentinels mymaster
1)  1) "name"
    2) "0dc5ea185da218d2da8754bc5a299696d4a5e006"
    3) "ip"
    4) "172.17.0.3"
    5) "port"
    6) "26379"
    7) "runid"
    8) "0dc5ea185da218d2da8754bc5a299696d4a5e006"
    9) "flags"
   10) "sentinel"
   11) "link-pending-commands"
   12) "0"
   13) "link-refcount"
   14) "1"
   15) "last-ping-sent"
   16) "0"
   17) "last-ok-ping-reply"
   18) "504"
   19) "last-ping-reply"
   20) "504"
   21) "down-after-milliseconds"
   22) "30000"
   23) "last-hello-message"
   24) "552"
   25) "voted-leader"
   26) "?"
   27) "voted-leader-epoch"
   28) "0"
2)  1) "name"
    2) "da884625a617f3c74683f73e249780edecd35e4f"
    3) "ip"
    4) "172.17.0.6"
    5) "port"
    6) "26379"
    7) "runid"
    8) "da884625a617f3c74683f73e249780edecd35e4f"
    9) "flags"
   10) "s_down,sentinel"
   11) "link-pending-commands"
   12) "19"
   13) "link-refcount"
   14) "1"
   15) "last-ping-sent"
   16) "3322768"
   17) "last-ok-ping-reply"
   18) "3322768"
   19) "last-ping-reply"
   20) "3322768"
   21) "s-down-time"
   22) "3292720"
   23) "down-after-milliseconds"
   24) "30000"
   25) "last-hello-message"
   26) "120"
   27) "voted-leader"
   28) "?"
   29) "voted-leader-epoch"
   30) "0"
127.0.0.1:26379> 

回答