如何解决MongoError:在replicaset中找不到主要内容

时间:2017-03-17 17:59:48

标签: node.js mongodb

我在Windows中使用MongoDB(版本3.4)作为其数据库运行节点js应用程序。在运行节点js服务器时突然出现此错误之前,它运行正常:

MongoError: no primary found in replicaset
at C:\Users\common\server\nodeapp\node_modules\mongodb-core\lib\topologies\replset.js:524:28 

在Windows命令提示符下,我使用命令mongod启动mongo db,最后显示以下消息:

2017-01-12T21:02:30.286+0530 I NETWORK  [thread1] connection accepted from 127.0.0.1:53591 #3 (3 connections now open)
2017-01-12T21:02:30.294+0530 I NETWORK  [thread1] connection accepted from 127.0.0.1:53592 #4 (4 connections now open)
2017-01-12T21:02:30.320+0530 I -        [conn4] end connection 127.0.0.1:53592 (4 connections now open)
2017-01-12T21:02:30.321+0530 I -        [conn2] end connection 127.0.0.1:53590 (4 connections now open)
2017-01-12T21:02:30.321+0530 I -        [conn3] end connection 127.0.0.1:53591 (4 connections now open)

我卸载了Mongo DB并再次安装并重新创建了data / db目录,但问题仍然存在。你能建议一个解决方案吗?

0 个答案:

没有答案