Problem Description:
使用命令:mongod --config /usr/local/etc/mongod.conf 无法启动mongodb,也不打印任何信息。之前用的都好好的,请问是什么原因呢?
Enter Mongod print:
liudemacbook-air:~ liu$ mongod2016-05-09t15:05:42.632+0800 I CONTROL [Initandlisten] MongoDB starting:pid=867 port=270 dbpath=/data/db 64-bit host=liudemacbook-air.local2016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] DB version v3.2.32016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece79372016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] Allocator: system2016-05-09t15:05:42.633+0800 I control [Initandlisten] modules:none2016-05-09t15:05:42.633+0800 i control [ Initandlisten] Build environment:2016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] distarch:x86_642016-05-09t15 : 05:42.633+0800 i control [Initandlisten] target_arch:x86_642016-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., terminating2016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] dbexit:rc:100
Environment: OSX (MAC)
Reply content:
Problem Description:
使用命令:mongod --config /usr/local/etc/mongod.conf 无法启动mongodb,也不打印任何信息。之前用的都好好的,请问是什么原因呢?
Enter Mongod print:
liudemacbook-air:~ liu$ mongod2016-05-09t15:05:42.632+0800 I CONTROL [Initandlisten] MongoDB starting:pid=867 port=270 dbpath=/data/db 64-bit host=liudemacbook-air.local2016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] DB version v3.2.32016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece79372016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] Allocator: system2016-05-09t15:05:42.633+0800 I control [Initandlisten] modules:none2016-05-09t15:05:42.633+0800 i control [ Initandlisten] Build environment:2016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] distarch:x86_642016-05-09t15 : 05:42.633+0800 i control [Initandlisten] target_arch:x86_642016-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., terminating2016-05-09t15:05:42.633+0800 I CONTROL [Initandlisten] dbexit:rc:100
Environment: OSX (MAC)
From the error message, it is clear that /data/db
there is no, you should check this first.
2016-05-09t15:05:42.633+0800 I STORAGE [Initandlisten] exception in initandlisten:29 Data directory/data/db not found., Terminating
If necessary, first set up this directory and try again.
sudo mkdir /data/db