MongoDB——shutting down with code:100

xiaoxiao2021-02-27  391

Ubuntu启动时错误

按照README文档,解压完mongodb压缩文件之后执行./mongod  输入启动命令,出现如下情况:  ./mongod  2017-05-03T02:44:28.693-0700 I CONTROL [initandlisten] MongoDB starting : pid=2286 port=27017 dbpath=/data/db 64-bit host=ubuntu  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] db version v3.4.4  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] git version: 888390515874a9debd1b6c5d36559ca86b44babd  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g-fips 1 Mar 2016  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] allocator: tcmalloc  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] modules: none  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] build environment:  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] distmod: ubuntu1604  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] distarch: x86_64  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] target_arch: x86_64  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] options: {}  2017-05-03T02:44:28.694-0700 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating  2017-05-03T02:44:28.694-0700 I NETWORK [initandlisten] shutdown: going to close listening sockets...  2017-05-03T02:44:28.694-0700 I NETWORK [initandlisten] shutdown: going to flush diaglog...  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] now exiting  2017-05-03T02:44:28.694-0700 I CONTROL [initandlisten] shutting down with code:100 

出现错误,shutting down with code:100。  通过运行:  sudo ./mongod解决,启动之后可通过

netstat -lanp | grep "27017"

查看是否正常启动

tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN - unix 2 [ ACC ] STREAM LISTENING 27064 - /

如上启动正常,默认端口27017

转载请注明原文地址: https://www.6miu.com/read-2334.html

最新回复(0)