副本集主从切换问题
#1935
Replies: 3 comments
-
现在 4.2+ 版本的mongo,如果发生主从切换,是存在不会断联的问题。 这个问题在现在的版本还没有解决,作为解决方案之一,可以在发生主从之后,把旧的主库重启下解决。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
写一个心跳调用mongo的isMaster接口,返回false就主动断开重连 |
Beta Was this translation helpful? Give feedback.
0 replies
-
写个mongo服务,搞个连接池,设个上限,请求打过来动态增加,监控errmsg写失败,断开重新拿一个 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
线上遇到这样的问题, 海外的云mongo出现网络波动时,主从就切换了,但是服务器连接mongo认为是一直正常就没有触发重连机制,导致更新数据时用之前的主节点(网络波动后变成从节点)进行更新,就一直报非主节点,无法更新, 这种问题有什么好的解决办法
Beta Was this translation helpful? Give feedback.
All reactions