The mongoDB service failed to start (exception: connect failed)

[root@localhost bin]# ./mongo
MongoDB shell version v3.4.5
connecting to: mongodb://
2017-11-20T11:10:49.895+0800 W NETWORK  [thread1] Failed to connect to                                                                                        :27017, in(checking socket for error after poll), reason: Connection refused
2017-11-20T11:10:49.896+0800 E QUERY    [thread1] Error: couldn't connect to ser                                                                                        ver, connection attempt failed :
exception: connect failed

The reason is that the database location is not specified

 ./mongod --dbpath /data/db

If your database directory is not /data/db, you can use the -dbpath to specify

. Start service


Read More: