首页 > 其他 > 详细

server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: Type: RSGhost 错误的解决方法

时间:2020-05-27 13:15:36      阅读:540      评论:0      收藏:0      [点我收藏+]

编写容器内运行的集成测试,需要用到 MongoDB 的 replica set,在程序连接数据库时报了这样的错:

server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: Type: RSGhost ...

原因是要连接的 ReplicaSet 找不到 Primary,只有一个 RSGhost,说明这个副本集还没初始化。

检查初始化脚本的输出日志,发现是有个脚本没挂载。

server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: Type: RSGhost 错误的解决方法

原文:https://www.cnblogs.com/flipped/p/12971539.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!