Mongodb错误处理

MongoDB shell version: 3.0.6
connecting to: test
Server has startup warnings: 
2017-01-26T17:25:54.657+0800 I CONTROL  [initandlisten] 
2017-01-26T17:25:54.657+0800 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000  

通过终端ulimit -a显示,指的是 -n openfile选项

$mongoimport --db test --collection restaurants --drop --file ~/downloads/primer-dataset.json
2017-01-26T17:27:11.882+0800	[........................] test.restaurants	0.0 B/11.3 MB (0.0%)
2017-01-26T17:27:12.409+0800	Failed: error connecting to db server: no reachable servers
2017-01-26T17:27:12.409+0800	imported 0 documents

$ mongorestore dump --host=127.0.0.1
2017-01-26T17:27:42.124+0800	building a list of dbs and collections to restore from dump dir
2017-01-26T17:27:42.125+0800	Failed: error scanning filesystem: error reading root dump folder: open dump: no such file or directory

$ mongoimport --host=127.0.0.1 --db test --collection restaurants --drop --file ~/downloads/primer-dataset.json
2017-01-26T17:32:44.206+0800	connected to: 127.0.0.1
2017-01-26T17:32:44.207+0800	dropping: test.restaurants
2017-01-26T17:32:45.572+0800	imported 25359 documents

百思不得其解,按照官网代码敲出来的,不过没用。加上--host=127.0.0.1来让mongodb知道host是本机。网上说3.0.7以后不会有这个问题,但显然我遇到了。  

 

转载于:https://www.cnblogs.com/avincross/p/6351765.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值