-3

MongoDB shell version v3.4.7

connecting to: mongodb://127.0.0.1:27017

2018-05-10T10:54:49.810+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused

2018-05-10T10:54:49.810+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

Wenfang Du
  • 8,804
  • 9
  • 59
  • 90
  • The `mongod` server is not running. Ubuntu 17 is a development branch anyway. There is no official support on the platform so it would be recommended that you use a stable OS which is actually supported by MongoDB. But bottom line is your server is not running and installing from unsupported packages on an unsupported OS will do that. – Neil Lunn May 10 '18 at 05:31
  • There's also literally hundreds of resources on correct installation instructions out there. If you actually tried anything before it would be wise to indicate what you did. Otherwise we can't do much more than point you to the existing documentation and tell you to follow it. – Neil Lunn May 10 '18 at 05:33

1 Answers1

1

Before anything check if Mongo is running

ps -aux | grep mongo or

/etc/init.d/mongodb status # give MongoDB version < 2.6 /etc/init.d/mongod status # for MongoDB version >= 2.6

or

service mongod status (you need to be root or to prefix it with sudo).

or

Mongo log file /var/log/mongo/mongo.log can give you valuable information

kenji_getpowered
  • 338
  • 2
  • 10