• 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以后不会有这个问题,但显然我遇到了。  

     

  • 相关阅读:
    【题解】NOIP2016换教室
    【题解】平面最近点对(加强版)
    [atcoder002E] Candy Piles [博弈论]
    [AGC002D] Stamp Rally [并查集+整体二分]
    [ACG001E] BBQ hard [dp]
    [BJOI2006][bzoj1001] 狼抓兔子 [最小割]
    [usaco jan 09] 安全路径 travel [最短路径树]
    [usaco jan 09] 气象牛 baric [dp]
    [poj1741] tree [点分治]
    [NOI2009] 植物大战僵尸 [网络流]
  • 原文地址:https://www.cnblogs.com/avincross/p/6351765.html
Copyright © 2020-2023  润新知