首頁 > 後端開發 > php教程 > mongod --config /usr/local/etc/mongod.conf 无法启动

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

WBOY
發布: 2016-06-06 20:09:27
原創
2693 人瀏覽過

问题描述:

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

输入mongod 打印:

<code>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</code>
登入後複製
登入後複製

环境:osx(mac)

回复内容:

问题描述:

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

输入mongod 打印:

<code>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</code>
登入後複製
登入後複製

环境: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

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

<code>sudo mkdir /data/db
</code>
登入後複製
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板