As mentioned above, this is probably related to BindIp, if you use mac and brew to install it, you will not find anything in /etc/mongod.conf, but you will find it in /usr/local/etc/mongod.conf
systemLog: destination: file path: /usr/local/var/log/mongodb/mongo.log logAppend: true storage: dbPath: /usr/local/var/mongodb net: bindIp: 127.0.0.1
Change BindIp with caution!
And the same goes for launching it to start using MongoDB manually:
mongod --config/usr/local/etc/mongod.conf
or configure autostart at login using launchd by typing:
brew services start mongodb
I also encountered corrupted data files on my local computer here:
/usr/local/var/mongodb
just deleted them and it worked, you can see in the log that the errors are like:
** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.6 before attempting an upgrade to 4.0; see http://dochub.mongodb.org/core/4.0-upgrade-fcv for more details. 2018-08-01T00:15:50.220+0200 NETWORK [initandlisten] shutdown: going to close listening sockets... 2018-08-01T00:15:50.220+0200 NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock 2018-08-01T00:15:50.224+0200 STORAGE [initandlisten] WiredTigerKVEngine shutting down 2018-08-01T00:15:50.303+0200 STORAGE [initandlisten] Downgrading WiredTiger datafiles. 2018-08-01T00:15:50.501+0200 STORAGE [initandlisten] WiredTiger message [1533075350:501686][3594:0x7fffb492e380], txn-recover: Main recovery loop: starting at 14/3712 2018-08-01T00:15:50.598+0200 STORAGE [initandlisten] WiredTiger message [1533075350:598867][3594:0x7fffb492e380], txn-recover: Recovering log 14 through 15 2018-08-01T00:15:50.664+0200 STORAGE [initandlisten] WiredTiger message [1533075350:663976][3594:0x7fffb492e380], txn-recover: Recovering log 15 through 15 2018-08-01T00:15:50.715+0200 STORAGE [initandlisten] WiredTiger message [1533075350:715398][3594:0x7fffb492e380], txn-recover: Set global recovery timestamp: 0 2018-08-01T00:15:51.002+0200 STORAGE [initandlisten] shutdown: removing fs lock... 2018-08-01T00:15:51.005+0200 CONTROL [initandlisten] now exiting 2018-08-01T00:15:51.005+0200 CONTROL [initandlisten] shutting down with code:62
source share