0
sudo service mongodb start

Failed to start mongodb.service: Unit mongodb.service is masked.

What should I do? help me..

~$ mongo MongoDB shell version: 3.2.3 connecting to: test 2016-02-26T17:40:18.552+0200 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused 2016-02-26T17:40:18.552+0200 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:224:14 @(connect):1:6

exception: connect failed

Pardeep Dhingra
  • 3,916
  • 7
  • 30
  • 56
oznur
  • 1
  • 1
  • did you even search for this? Seems to be answered on ask-ubuntu: http://askubuntu.com/questions/617097/mongodb-2-6-does-not-start-on-ubuntu-15-04 – chriskelly Feb 26 '16 at 15:54

2 Answers2

0

I think it's sudo service mongod start - please note the lack of b in mongod

Tudor Constantin
  • 26,330
  • 7
  • 49
  • 72
  • I tried it but failed $ sudo service mongod start Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory. – oznur Feb 26 '16 at 15:50
0

I find the solution:

sudo mongod --dbpath /var/lib/mongodb/ --journal

Different terminal is opening and mongo command is starting with

TheNikCD
  • 191
  • 1
  • 2
  • 18
oznur
  • 1
  • 1