The error message is as follows:
[Email protected] bin]# MONGO
MongoDB Shell version V3.4.6-22-ga109a23
Connecting to:mongodb://127.0.0.1:27017
2017-10-16t10:57:28.624+0800 W NETWORK [Thread1] Failed to connect to 127.0.0.1:27017, in (checking socket for error after Poll), Reason:connection refused
2017-10-16t10:57:28.625+0800 E QUERY [thread1] error:couldn ' t connect to server 127.0.0.1:27017, connection attempt faile B |
[Email protected]/mongo/shell/mongo.js:237:13
@ (Connect): 1:6
Exception:connect failed
Workaround:
1. Go to the/data/db directory and delete the Mongo.lock file
2. Enter the/mongodb/bin directory and execute the./mongod
3. Re-open a window to execute./mongo--dbpath=/data/platform/mongodb/data/db/
Note that the DB path is added to the boot, otherwise the startup fails. You also need to consider permissions issues.
4. Start successfully
MONGO Database start error