Problem description: {code...} input mongod print: {code...} environment: osx (mac) Problem description:
Run the command mongod -- config/usr/local/etc/mongod. conf to start mongodb without printing any information. I used it all well before. Why?
Input mongod to print:
liudeMacBook-Air:~ liu$ mongod2016-05-09T15:05:42.632+0800 I CONTROL [initandlisten] MongoDB starting : pid=867 port=27017 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:
Run the command mongod -- config/usr/local/etc/mongod. conf to start mongodb without printing any information. I used it all well before. Why?
Input mongod to print:
liudeMacBook-Air:~ liu$ mongod2016-05-09T15:05:42.632+0800 I CONTROL [initandlisten] MongoDB starting : pid=867 port=27017 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)
The error messages clearly indicate/data/db
Does not exist. Check this point first.
T15: 05: 42.633 + 0800 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory/data/db not found., terminating
Create this directory and try again if necessary
sudo mkdir /data/db