hfqf:~ points$ sudo mongod --config /usr/local/etc/mongod.conf Password: Abort trap: 6 hfqf:~ points$ mongo MongoDB shell version v3.4.9 connecting to: mongodb://127.0.0.1:27017 2017-09-20T22:56:49.087+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused 2017-09-20T22:56:49.088+0800 E QUERY [thread1] Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:237:13 @(connect):1:6 exception: connect failed hfqf:~ points$
都什么年代了,docker 大法好 一条命令解决
docker run -d -p 27017:27017 --name=mongodb mongo --storageEngine wiredTiger