Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

副本集主从切换问题 #1898

Closed
felixlcb opened this issue Apr 8, 2024 · 2 comments
Closed

副本集主从切换问题 #1898

felixlcb opened this issue Apr 8, 2024 · 2 comments

Comments

@felixlcb
Copy link

felixlcb commented Apr 8, 2024

线上遇到这样的问题, 海外的云mongo出现网络波动时,主从就切换了,但是服务器连接mongo认为是一直正常就没有触发重连机制,导致更新数据时用之前的主节点(网络波动后变成从节点)进行更新,就一直报非主节点,无法更新, 这种问题有什么好的解决办法

@ykxpb
Copy link
Contributor

ykxpb commented Apr 24, 2024

现在 4.2+ 版本的mongo,如果发生主从切换,是存在不会断联的问题。

这个问题在现在的版本还没有解决,作为解决方案之一,可以在发生主从之后,把旧的主库重启下解决。

@zhwryan
Copy link

zhwryan commented May 31, 2024

写一个心跳调用mongo的isMaster接口,返回false就主动断开重连

Repository owner locked and limited conversation to collaborators May 31, 2024
@cloudwu cloudwu converted this issue into discussion #1935 May 31, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants