在python连接redis的哨兵集群时,报如下错误,redis.exceptions.ResponseError: unknown command 'SENTINEL'

原因,python连接redis的哨兵模式,直接连接redis主服务器的ip和端口,192.168.1.23, 6379

redis的哨兵模式与其他mongodb的副本集模式,连接模式不一样,所以习惯思维

实际上redis的哨兵模式,有专门的服务和端口,和redis的服务是完全分开的"192.168.1.24",26379

from redis.sentinel import Sentinel

sentinel_list = [("192.168.1.23",26379),("192.168.1.24",26379)  #这里是哨兵服务器启动的IP和端口
my_sentinel = Sentinel(sentinel_list)

相关文章:

  • 2022-12-23
  • 2021-12-08
  • 2022-01-18
  • 2021-10-12
  • 2021-09-12
  • 2021-09-08
  • 2022-12-23
猜你喜欢
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-05-22
  • 2021-04-07
  • 2021-09-09
相关资源
相似解决方案