欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

mongod --config /usr/local/etc/mongod.conf 无法启动

程序员文章站 2022-06-16 11:05:36
...
问题描述:
  使用命令:mongod --config /usr/local/etc/mongod.conf 无法启动mongodb,也不打印任何信息。之前用的都好好的,请问是什么原因呢?

输入mongod 打印:

liudeMacBook-Air:~ liu$ mongod
2016-05-09T15:05:42.632+0800 I CONTROL  [initandlisten] MongoDB starting : pid=867 port=27017 dbpath=/data/db 64-bit host=liudeMacBook-Air.local
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] db version v3.2.3
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] allocator: system
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] modules: none
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] build environment:
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten]     distarch: x86_64
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] options: {}
2016-05-09T15:05:42.633+0800 I STORAGE  [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] dbexit:  rc: 100

环境:osx(mac)

回复内容:

问题描述:

  使用命令:mongod --config /usr/local/etc/mongod.conf 无法启动mongodb,也不打印任何信息。之前用的都好好的,请问是什么原因呢?

输入mongod 打印:

liudeMacBook-Air:~ liu$ mongod
2016-05-09T15:05:42.632+0800 I CONTROL  [initandlisten] MongoDB starting : pid=867 port=27017 dbpath=/data/db 64-bit host=liudeMacBook-Air.local
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] db version v3.2.3
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] allocator: system
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] modules: none
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] build environment:
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten]     distarch: x86_64
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] options: {}
2016-05-09T15:05:42.633+0800 I STORAGE  [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2016-05-09T15:05:42.633+0800 I CONTROL  [initandlisten] dbexit:  rc: 100

环境:osx(mac)

从错误消息来看,很明确地说明了/data/db不存在,应该先检查这点。

2016-05-09T15:05:42.633+0800 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating

如有必要先建立这个目录再试

sudo mkdir /data/db
相关标签: php mongodb