mongodb: no reachable servers
滿天的星座
滿天的星座 2017-05-02 09:18:05
0
2
815

OS X 环境下用 brew 安装 mongodb 之后
按照官方文档上的教程 import 一个 json 文件
输入:

mongoimport --db test --collection restaurants --drop --file primer-dataset.json

过程中 出现报错

Failed: error connnecting to db server: no reachable servers

求解决方案

已经尝试过的解决方案:
1.mongoimport --host=127.0.0.1 --port=27017 --db test --collection restaurants --drop --file primer-dataset.json
2.brew update && brew upgrade


补充:
1.启动mongodb之后导入文件,报错:

Failed: error processing document #9870: unexpected EOF

滿天的星座
滿天的星座

reply all(2)
某草草
It looks like the data file is damaged, open it with vi and take a look at the data file to be imported.

Are you sure your mongodb is started?

漂亮男人

What version of MongoDB is it? This problem will not occur after 3.0.7. Also, is --replSet enabled but not in node? Finally, I checked it for you. Someone had a similar problem and solved it through mongorestore dump --host=127.0.0.1.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!