Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

最近在学redis, 有个疑问? 假如3主3从的redis分布式集群, 程序连接哪一个redis主实例(3个)? 假设连接 a机器ip:6379 , 如果它宕机了切换到 b的6379 怎么办? 望各位请教...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
682 views
Welcome To Ask or Share your Answers For Others

1 Answer

严格意义上reids是没有主从的,
并且redis集群的连接方式与单机连接方式不同,集群连接需要将所有节点的ip写入到配置文件中,客户端连接任意一个节点后由集群内部做分发连接到当前选举的主节点上.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...