Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

哨兵主从切换后,freeredis并不能做到主从切换 #180

Open
L-960 opened this issue Mar 15, 2024 · 3 comments
Open

哨兵主从切换后,freeredis并不能做到主从切换 #180

L-960 opened this issue Mar 15, 2024 · 3 comments

Comments

@L-960
Copy link

L-960 commented Mar 15, 2024

环境:
Linux,.net6.0, FreeRedis1.0.3,redis一主二从三哨兵

代码中使用方式:
哨兵方式连接,全局单例RedisClient。

复现过程:
停掉redis主节点,哨兵已选举出新的主节点,但是freeredis一直尝试连接之前的主节点,报错信息如下:
System.Exception: 【172.24.43.38:10031/0】状态不可用,等待后台检查程序恢复方可使用。Connection refused
【172.24.43.38:10031/0】Next recovery time:03/13/2024 09:42:48
【172.24.43.38:10031/0】Next recovery time: 03/13/2024 09:42:54 (Connection refused)
...

@2881099
Copy link
Owner

2881099 commented Mar 15, 2024

172.24.43.38:10031

是否能联通

@L-960
Copy link
Author

L-960 commented Mar 16, 2024

172.24.43.38:10031

是否能联通

回答:

之前是可以联通的,我停掉以后就不能联通了。

补充:

172.24.43.38:10031是之前的master节点,我通过RedisClient的哨兵方式连接的。

但是我停掉master节点以后,哨兵已经选举出来了新的master节点,但是freeredis这边一直在尝试连接之前的master节点,也就是我停掉的172.24.43.38:10031。

@2881099
Copy link
Owner

2881099 commented Mar 17, 2024

说明哨兵还没有切换过来

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants