1
votes

I am trying to run start mongo from the folder with command

./mongod --dbpath /opt/mangodb_install/data/db/ --logpath /opt/mangodb_install/mongod.log --port 27018 --fork 

but i m getting an error

[root@staging bin]# ./mongo MongoDB shell version v3.4.2-rc0 connecting to: mongodb://127.0.0.1:27017 2017-12-05T12:30:30.978+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused 2017-12-05T12:30:30.979+0530 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

1

1 Answers

0
votes

You changed port from the standard (27017) into 27018. So you must to define the port for mongo.

Try this:

mongo --port 27018