D
D
Denis D.2015-02-01 19:13:44
MongoDB
Denis D., 2015-02-01 19:13:44

Why doesn't Mongo start on Ubuntu 14.04?

I'm learning Node and now I'm trying to write a simple application for robots with a base. Installed MongoDB following the tutorial from here . After installation, I typed it in the terminal mongoand got such an unpleasant picture:

$ mongo
MongoDB shell version: 2.6.7
connecting to: test
2015-02-01T18:00:22.765+0200 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-02-01T18:00:22.765+0200 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed

Attempts to fix it using the method below were unsuccessful (although the solution is very common on the Internet):
sudo rm /var/lib/mongodb/mongod.lock   
sudo -u mongodb mongod -f /etc/mongodb.conf --repair 
sudo service mongodb start

It may be important to mention that running mongodnotifies that the directory /data/db/but creating it at the root of the system does not solve the problem. Below is the output of the command:
$ mongod
mongod --help for help and startup options
Sun Feb  1 18:10:19.528 [initandlisten] MongoDB starting : pid=8204 port=27017 dbpath=/data/db/ 64-bit host=Linux-Work-Laptop
Sun Feb  1 18:10:19.528 [initandlisten] db version v2.4.9
Sun Feb  1 18:10:19.528 [initandlisten] git version: nogitversion
Sun Feb  1 18:10:19.528 [initandlisten] build info: Linux orlo 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 BOOST_LIB_VERSION=1_54
Sun Feb  1 18:10:19.528 [initandlisten] allocator: tcmalloc
Sun Feb  1 18:10:19.528 [initandlisten] options: {}
Sun Feb  1 18:10:19.528 [initandlisten] exception in initAndListen: 10296 
*********************************************************************
 ERROR: dbpath (/data/db/) does not exist.
 Create this directory or give existing directory in --dbpath.
 See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************
, terminating
Sun Feb  1 18:10:19.528 dbexit: 
Sun Feb  1 18:10:19.528 [initandlisten] shutdown: going to close listening sockets...
Sun Feb  1 18:10:19.528 [initandlisten] shutdown: going to flush diaglog...
Sun Feb  1 18:10:19.528 [initandlisten] shutdown: going to close sockets...
Sun Feb  1 18:10:19.528 [initandlisten] shutdown: waiting for fs preallocator...
Sun Feb  1 18:10:19.528 [initandlisten] shutdown: lock for final commit...
Sun Feb  1 18:10:19.528 [initandlisten] shutdown: final commit...
Sun Feb  1 18:10:19.528 [initandlisten] shutdown: closing all files...
Sun Feb  1 18:10:19.528 [initandlisten] closeAllFiles() finished
Sun Feb  1 18:10:19.528 dbexit: really exiting now

How to solve this problem? Perhaps I installed it incorrectly, or I don't notice something?
I will be very grateful for your help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Shein, 2015-02-01
@denysd

How is the team going sudo service mongodb start, is it successful? See what's in the logs /var/log/mongodb/. Do not start the server mongodfrom your user, check if there is one running through ps aux | grep mongodand kill, if there is, you can through sudo service mongodb stop(stop through the startup manager) and sudo pkill mongod(all mongod processes).

C
cyd, 2016-01-22
@cyd

I encountered a similar situation only with version 3.2.1.
In the logs /var/log/mongofb/:

2016-01-22T15:04:27.580+0300 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
2016-01-22T15:04:27.580+0300 I - [initandlisten ] Fatal Assertion 28578
2016-01-22T15:04:27.580+0300 I - [initandlisten]
Deleting mongodb-27017.sock helped.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question