I setup mongodb on ubuntu 16.04 with:
echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
But I get these error when i try to start the service:
**~$** systemctl start mongodb
Failed to start mongodb.service: Unit mongodb.service is masked.
**~$** systemctl start mongod
Failed to start mongod.service: Unit mongod.service not found.
**~$** sudo service mongod start
Failed to start mongod.service: Unit mongod.service not found.
**~$** mongod
mongod --help for help and startup options
2016-09-04T11:20:59.074+0200 [initandlisten] MongoDB starting : pid=30207 port=27017 dbpath=/data/db 64-bit host=zantes
2016-09-04T11:20:59.074+0200 [initandlisten] db version v2.6.10
2016-09-04T11:20:59.074+0200 [initandlisten] git version: nogitversion
2016-09-04T11:20:59.074+0200 [initandlisten] OpenSSL version: OpenSSL 1.0.2g-fips 1 Mar 2016
2016-09-04T11:20:59.074+0200 [initandlisten] build info: Linux lgw01-12 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 BOOST_LIB_VERSION=1_58
2016-09-04T11:20:59.074+0200 [initandlisten] allocator: tcmalloc
2016-09-04T11:20:59.074+0200 [initandlisten] options: {}
2016-09-04T11:20:59.074+0200 [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
2016-09-04T11:20:59.074+0200 [initandlisten] dbexit:
2016-09-04T11:20:59.074+0200 [initandlisten] shutdown: going to close listening sockets...
2016-09-04T11:20:59.074+0200 [initandlisten] shutdown: going to flush diaglog...
2016-09-04T11:20:59.074+0200 [initandlisten] shutdown: going to close sockets...
2016-09-04T11:20:59.074+0200 [initandlisten] shutdown: waiting for fs preallocator...
2016-09-04T11:20:59.074+0200 [initandlisten] shutdown: lock for final commit...
2016-09-04T11:20:59.074+0200 [initandlisten] shutdown: final commit...
2016-09-04T11:20:59.074+0200 [initandlisten] shutdown: closing all files...
2016-09-04T11:20:59.074+0200 [initandlisten] closeAllFiles() finished
2016-09-04T11:20:59.074+0200 [initandlisten] dbexit: really exiting now
But when i check the status is active, please help me. I don't know what I have to do!
**~$** sudo systemctl status mongodb
**●** mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor prese
Active: active (running) since dom 2016-09-04 11:01:11 CEST; 20min ago
Docs: man:mongod(1)
Main PID: 27544 (mongod)
CGroup: /system.slice/mongodb.service
└─27544 /usr/bin/mongod --config /etc/mongodb.conf
set 04 11:01:11 zantes systemd[1]: Started An object/document-oriented databa
lines 1-9/9 (END)
I previously worked on c9 but it has so much problems and is slow, I need mongodb for working on my projects
(sorry for my bad englis)
Somewhere in the error message it says "dbpath (/data/db) does not exist". "/data/db" is the default directory in which mongodb stores its data files. You have to create it manually. It seems this path does not exist.
If you want to change this path, either pass --dbpath parameter to mongod or change the dbpath parameter value in mongodb.conf file.
if mongodbversion is >=4 and installed in ubuntu, use mongod instead of mongodb
sudo systemctl status mongod
sudo systemctl start mongod
sudo vi /etc/mongod.conf
otherwise , you will get following error with mongodb command
Failed to restart mongodb.service: Unit mongodb.service is masked.
Related
Hello I have a problem with my MongoDB it was working just fine and after I restart the server and scrapping something this show up.
When I ran command
$ mongo
It respond with
MongoDB shell version: 3.2.13
connecting to: test
2017-05-29T01:11:42.948+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
2017-05-29T01:11:42.948+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:229:14
#(connect):1:6
exception: connect failed
I also ran this command
$ mongod
and it have me this error message
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] MongoDB starting : pid=2530 port=27017 dbpath=/data/db 64-bit host=something
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] db version v3.2.13
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] git version: 23899209cad60aaafe114f6aea6cb83025ff51bc
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] allocator: tcmalloc
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] modules: none
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] build environment:
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] distmod: ubuntu1604
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] distarch: x86_64
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] target_arch: x86_64
2017-05-29T01:17:58.441+0000 I CONTROL [initandlisten] options: {}
2017-05-29T01:17:58.469+0000 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
2017-05-29T01:17:58.469+0000 I - [initandlisten] Fatal Assertion 28578
2017-05-29T01:17:58.469+0000 I - [initandlisten]
***aborting after fassert() failure
Then I tried
sudo service mongod start
sudo service mongod status
and it give me this fail error
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-05-29 01:24:29 UTC; 1min 29s ago
Docs: https://docs.mongodb.org/manual
Process: 3200 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=100)
Main PID: 3200 (code=exited, status=100)
May 29 01:24:29 something systemd[1]: Started High-performance, schema-free document-oriented database.
May 29 01:24:29 something systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a
May 29 01:24:29 something systemd[1]: mongod.service: Unit entered failed state.
May 29 01:24:29 something systemd[1]: mongod.service: Failed with result 'exit-code'.
I've tried deleted the socket file and give it a try but didn't work.
Thank you in advanced! :)
I am not sure if this is the correct answer or not. However, it appears to me that
2017-05-29T01:17:58.469+0000 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
is the main problem. Perhaps you could double check who owns this? also the permission?
It looks like this in my mongo:
Hopefully it helps
rm /var/lib/mongodb/mongod.lock
systemctl restart mongod
systemctl status mongod
I'm having some trouble starting up mongo. I am using it on a remote machine that I SSH into where. The remote machine is where I do everything (nothing is done on my own machine). Should I change the bind_ip from 127.0.0.1 to the remote machine's IP address? But regardless of whether I leave the IP as it is or change it to the IP of my remote machine, I get the same error message below:
melissa#simba:~$ mongo --version
MongoDB shell version: 2.6.11
melissa#simba:~$ sudo service mongod start
mongod start/running, process 10623
melissa#simba:~$ mongo
MongoDB shell version: 2.6.11
connecting to: test
2015-09-24T19:27:55.279+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-09-24T19:27:55.280+0000 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
My remote machine is: Ubuntu 11.10 (GNU/Linux 2.6.35.4-rscloud x86_64) where the user melissa is a sudoer.
And this is the message I get when starting mongod &
melissa#simba:~$ mongod
mongod --help for help and startup options
2015-09-24T19:40:20.706+0000 [initandlisten] MongoDB starting : pid=10656 port=27017 dbpath=/data/db 64-bit host=simba
2015-09-24T19:40:20.707+0000 [initandlisten] db version v2.6.11
2015-09-24T19:40:20.707+0000 [initandlisten] git version: d00c1735675c457f75a12d530bee85421f0c5548
2015-09-24T19:40:20.707+0000 [initandlisten] build info: Linux build4.ny.cbi.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-09-24T19:40:20.707+0000 [initandlisten] allocator: tcmalloc
2015-09-24T19:40:20.707+0000 [initandlisten] options: {}
2015-09-24T19:40:20.746+0000 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
2015-09-24T19:40:20.746+0000 [initandlisten] dbexit:
2015-09-24T19:40:20.746+0000 [initandlisten] shutdown: going to close listening sockets...
2015-09-24T19:40:20.746+0000 [initandlisten] shutdown: going to flush diaglog...
2015-09-24T19:40:20.746+0000 [initandlisten] shutdown: going to close sockets...
2015-09-24T19:40:20.746+0000 [initandlisten] shutdown: waiting for fs preallocator...
2015-09-24T19:40:20.746+0000 [initandlisten] shutdown: lock for final commit...
2015-09-24T19:40:20.746+0000 [initandlisten] shutdown: final commit...
2015-09-24T19:40:20.746+0000 [initandlisten] shutdown: closing all files...
2015-09-24T19:40:20.746+0000 [initandlisten] closeAllFiles() finished
2015-09-24T19:40:20.747+0000 [initandlisten] shutdown: removing fs lock...
2015-09-24T19:40:20.747+0000 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
2015-09-24T19:40:20.747+0000 [initandlisten] dbexit: really exiting now
More info:
melissa#simba:~$ ps -edaf | grep mongo
melissa 10748 10555 0 19:45 pts/1 00:00:00 grep --color=auto mongo
melissa#simba:~$ service mongod status
status: Unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
melissa#simba:~$ sudo service mongod status
mongod stop/waiting
melissa#simba:~$ ps -aux | grep mongo
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
melissa 10786 0.0 0.3 8148 904 pts/1 S+ 19:47 0:00 grep --color=auto mongo
melissa#simba:~$ mongod --shutdown
There doesn't seem to be a server running with dbpath: /data/db
Then I tried to change the permission based on this, but got a new error:
melissa#simba:~/meeth-app$ sudo chown -R `id -u` /data/db
[sudo] password for melissa:
melissa#simba:~/meeth-app$ mongo
MongoDB shell version: 2.6.11
connecting to: test
2015-09-25T01:57:54.966+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-09-25T01:57:54.967+0000 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
melissa#simba:~/meeth-app$ mongod &
[1] 16467
melissa#simba:~/meeth-app$ mongod --help for help and startup options
2015-09-25T01:55:07.366+0000 [initandlisten] MongoDB starting : pid=16467 port=27017 dbpath=/data/db 64-bit host=simba
2015-09-25T01:55:07.366+0000 [initandlisten] db version v2.6.11
2015-09-25T01:55:07.366+0000 [initandlisten] git version: d00c1735675c457f75a12d530bee85421f0c5548
2015-09-25T01:55:07.366+0000 [initandlisten] build info: Linux build4.ny.cbi.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-09-25T01:55:07.366+0000 [initandlisten] allocator: tcmalloc
2015-09-25T01:55:07.366+0000 [initandlisten] options: {}
2015-09-25T01:55:07.369+0000 [initandlisten] journal dir=/data/db/journal
2015-09-25T01:55:07.369+0000 [initandlisten] recover : no journal files present, no recovery needed
2015-09-25T01:55:07.370+0000 [initandlisten]
2015-09-25T01:55:07.370+0000 [initandlisten] ERROR: Insufficient free space for journal files
2015-09-25T01:55:07.370+0000 [initandlisten] Please make at least 3379MB available in /data/db/journal or use --smallfiles
2015-09-25T01:55:07.370+0000 [initandlisten]
2015-09-25T01:55:07.370+0000 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
2015-09-25T01:55:07.370+0000 [initandlisten] dbexit:
2015-09-25T01:55:07.370+0000 [initandlisten] shutdown: going to close listening sockets...
2015-09-25T01:55:07.370+0000 [initandlisten] shutdown: going to flush diaglog...
2015-09-25T01:55:07.370+0000 [initandlisten] shutdown: going to close sockets...
2015-09-25T01:55:07.370+0000 [initandlisten] shutdown: waiting for fs preallocator...
2015-09-25T01:55:07.370+0000 [initandlisten] shutdown: lock for final commit...
2015-09-25T01:55:07.370+0000 [initandlisten] shutdown: final commit...
2015-09-25T01:55:07.370+0000 [initandlisten] shutdown: closing all files...
2015-09-25T01:55:07.370+0000 [initandlisten] closeAllFiles() finished
2015-09-25T01:55:07.370+0000 [initandlisten] journalCleanup...
2015-09-25T01:55:07.370+0000 [initandlisten] removeJournalFiles
2015-09-25T01:55:07.371+0000 [initandlisten] shutdown: removing fs lock...
2015-09-25T01:55:07.371+0000 [initandlisten] dbexit: really exiting now
Permission for /data are wrong. Startup cannot write the PID file or likely the db files either. Try
sudo chmod -R mongodb /data
Here is what happened that made mongo work again. Btw, I'm on Ubuntu 11.10.
Change the owner of /data from root to mongodb: sudo chown -R mongodb /data.
Add a line to turn smallfiles on in /etc/mongod.conf: smallfiles = true
Do NOT run mongod & because it's not running from a place with the right permissions, instead do sudo service mongod start and you can open the mongo shell with mongo.
Thanks to r05c03 and oldlaptop from freenode irc #linux for their help.
Yesterday I have upgraded my Ubuntu 14.10 to 15.04. But which lead me to stop my work. I was working on chicagoboss and mongodb. i saw error that mongodb has crashed.
By typing just mongo got following error:
$ mongo
MongoDB shell version: 2.4.10
connecting to: test
Mon May 11 11:26:32.985 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed
Followed stackoverflow query and removed .lock file. Then tried to repair using
$sudo mongod --repair
Then got an error:
*********************************************************************
ERROR: dbpath (/data/db/) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************
I observed that in my mongodb.conf file dbpath is /var/lib/mongodb. Which is correct where I found all my mongodb databases.So I tried to set dbpath to the same location but getting error:
$ mongod --dbpath "/var/lib/mongodb"
Mon May 11 11:33:18.607 [initandlisten] MongoDB starting : pid=4450 port=27017 dbpath=/var/lib/mongodb 64-bit host=laxmikant-alphonso
Mon May 11 11:33:18.607 [initandlisten] db version v2.4.10
Mon May 11 11:33:18.607 [initandlisten] git version: e3d78955d181e475345ebd60053a4738a4c5268a
Mon May 11 11:33:18.607 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Mon May 11 11:33:18.607 [initandlisten] allocator: tcmalloc
Mon May 11 11:33:18.607 [initandlisten] options: { dbpath: "/var/lib/mongodb" }
Mon May 11 11:33:18.607 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /var/lib/mongodb/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
Mon May 11 11:33:18.607 dbexit:
Mon May 11 11:33:18.607 [initandlisten] shutdown: going to close listening sockets...
Mon May 11 11:33:18.607 [initandlisten] shutdown: going to flush diaglog...
Mon May 11 11:33:18.607 [initandlisten] shutdown: going to close sockets...
Mon May 11 11:33:18.607 [initandlisten] shutdown: waiting for fs preallocator...
Mon May 11 11:33:18.607 [initandlisten] shutdown: lock for final commit...
Mon May 11 11:33:18.607 [initandlisten] shutdown: final commit...
Mon May 11 11:33:18.607 [initandlisten] shutdown: closing all files...
Mon May 11 11:33:18.608 [initandlisten] closeAllFiles() finished
Mon May 11 11:33:18.608 [initandlisten] shutdown: removing fs lock...
Mon May 11 11:33:18.608 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
Mon May 11 11:33:18.608 dbexit: really exiting now
How can I resolve this issue. I want all my databases back.
Also I checked that I'm getting following error for service start:
$ sudo service mongodb start
Failed to start mongodb.service: Unit mongodb.service failed to load: No such file or directory.
$ mongod --dbpath "/var/lib/mongodb"
In that case, you start mongodb as yourself. And you probably don't have R/W permission on the data directory.
$ sudo service mongodb start
Now you start mongodb as a service and it will probably change its identity from root to "mongo" or something like that. On debian-like system, the configuration for mongodb is in /etc/init/mongodb.conf or preferably in /etc/mongodb.conf. See http://packages.ubuntu.com/utopic/amd64/mongodb-server/filelist. There you can change the database path.
BTW, check the permissions for your data directory. The user "mongo"-or-whatever should have write access there:
$ ls -l /var/lib/mongodb
I've had mongo running for a while on my dev server running Centos 6.5 and mongo 2.6.4.
But then I needed to install mysql for a different project and now suddenly mongo doesn't work.
I tried to re-install it and upgrade it to 2.6.5 at the same time. I've tried to start it and restart it:
# sudo service mongod restart
Stopping mongod: [FAILED]
Starting mongod: [FAILED]
Repairing it said I missed /data/db which I then created. The repair responds like this:
# sudo mongod --repair
2014-10-24T15:52:14.710-0400 [initandlisten] MongoDB starting : pid=1182 port=27017 dbpath=/data/db 64-bit host=myhost
2014-10-24T15:52:14.710-0400 [initandlisten] db version v2.6.5
2014-10-24T15:52:14.710-0400 [initandlisten] git version: e99d4fcb4279c0279796f237aa92fe3b64560bf6
2014-10-24T15:52:14.710-0400 [initandlisten] build info: Linux build8.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-10-24T15:52:14.710-0400 [initandlisten] allocator: tcmalloc
2014-10-24T15:52:14.710-0400 [initandlisten] options: { repair: true }
2014-10-24T15:52:14.726-0400 [initandlisten] repairDatabase local
2014-10-24T15:52:14.726-0400 [initandlisten] allocating new ns file /data/db/_tmp_repairDatabase_0/local.ns, filling with zeroes...
2014-10-24T15:52:14.843-0400 [FileAllocator] allocating new datafile /data/db/_tmp_repairDatabase_0/local.0, filling with zeroes...
2014-10-24T15:52:14.843-0400 [FileAllocator] creating directory /data/db/_tmp_repairDatabase_0/_tmp
2014-10-24T15:52:14.879-0400 [FileAllocator] done allocating datafile /data/db/_tmp_repairDatabase_0/local.0, size: 64MB, took 0.017 secs
2014-10-24T15:52:14.897-0400 [initandlisten] finished checking dbs
2014-10-24T15:52:14.897-0400 [initandlisten] dbexit:
2014-10-24T15:52:14.897-0400 [initandlisten] shutdown: going to close listening sockets...
2014-10-24T15:52:14.897-0400 [initandlisten] shutdown: going to flush diaglog...
2014-10-24T15:52:14.897-0400 [initandlisten] shutdown: going to close sockets...
2014-10-24T15:52:14.897-0400 [initandlisten] shutdown: waiting for fs preallocator...
2014-10-24T15:52:14.897-0400 [initandlisten] shutdown: closing all files...
2014-10-24T15:52:14.897-0400 [initandlisten] closeAllFiles() finished
2014-10-24T15:52:14.897-0400 [initandlisten] shutdown: removing fs lock...
2014-10-24T15:52:14.897-0400 [initandlisten] dbexit: really exiting now
Starting it again, and fails.
did this:
#semanage port -a -t mongodb_port_t -p tcp 27017
Killed
Trying to enter the mongo shell responds with this:
# mongo
MongoDB shell version: 2.6.5
connecting to: test
2014-10-24T15:59:40.243-0400 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2014-10-24T15:59:40.244-0400 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
I'm out of ideas. Any suggestions?
I installed mongodb using the information in this link. However, when I user the service mongod start command I get the following error. Can someone help me troubleshoot?
[Piyush#localhost ~]$ service mongod start
/etc/init.d/mongod: line 54: ulimit: open files: cannot modify limit: Operation not permitted
/etc/init.d/mongod: line 56: ulimit: max user processes: cannot modify limit: Operation not permitted
Starting mongod: runuser: using restricted shell /bin/false
runuser: cannot set groups: Operation not permitted
[FAILED]
[Piyush#localhost ~]$ sudo service mongod start
[sudo] password for Piyush:
Starting mongod: [FAILED]
I tried using --repair command. I get the following output for that:
[Piyush#localhost ~]$ sudo mongod --repair
2014-09-24T00:05:06.089-0400 [initandlisten] MongoDB starting : pid=2807 port=27017 dbpath=/data/db 64-bit host=localhost.localdomain
2014-09-24T00:05:06.089-0400 [initandlisten] db version v2.6.4
2014-09-24T00:05:06.089-0400 [initandlisten] git version: 3a830be0eb92d772aa855ebb711ac91d658ee910
2014-09-24T00:05:06.089-0400 [initandlisten] build info: Linux build7.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-09-24T00:05:06.089-0400 [initandlisten] allocator: tcmalloc
2014-09-24T00:05:06.090-0400 [initandlisten] options: { repair: true }
2014-09-24T00:05:06.106-0400 [initandlisten] finished checking dbs
2014-09-24T00:05:06.106-0400 [initandlisten] dbexit:
2014-09-24T00:05:06.106-0400 [initandlisten] shutdown: going to close listening sockets...
2014-09-24T00:05:06.106-0400 [initandlisten] shutdown: going to flush diaglog...
2014-09-24T00:05:06.106-0400 [initandlisten] shutdown: going to close sockets...
2014-09-24T00:05:06.106-0400 [initandlisten] shutdown: waiting for fs preallocator...
2014-09-24T00:05:06.106-0400 [initandlisten] shutdown: closing all files...
2014-09-24T00:05:06.106-0400 [initandlisten] closeAllFiles() finished
2014-09-24T00:05:06.107-0400 [initandlisten] shutdown: removing fs lock...
2014-09-24T00:05:06.107-0400 [initandlisten] dbexit: really exiting now
[EDIT 1]_____________________________________________________________________________
In the log file I see:
[root#localhost ~]# cat /var/log/mongodb/mongod.log.2014-09-24T16-00-32
2014-09-24T11:54:23.636-0400 ***** SERVER RESTARTED *****
2014-09-24T11:54:23.665-0400 [initandlisten] MongoDB starting : pid=3004 port=27017 dbpath=/var/lib/mongo 64-bit host=localhost.localdomain
2014-09-24T11:54:23.665-0400 [initandlisten] db version v2.6.4
2014-09-24T11:54:23.665-0400 [initandlisten] git version: 3a830be0eb92d772aa855ebb711ac91d658ee910
2014-09-24T11:54:23.665-0400 [initandlisten] build info: Linux build7.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-09-24T11:54:23.665-0400 [initandlisten] allocator: tcmalloc
2014-09-24T11:54:23.665-0400 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, storage: { dbPath: "/var/lib/mongo" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2014-09-24T11:54:23.680-0400 [initandlisten] journal dir=/var/lib/mongo/journal
2014-09-24T11:54:23.680-0400 [initandlisten] recover : no journal files present, no recovery needed
2014-09-24T11:54:23.680-0400 [initandlisten]
2014-09-24T11:54:23.680-0400 [initandlisten] ERROR: Insufficient free space for journal files
2014-09-24T11:54:23.680-0400 [initandlisten] Please make at least 3379MB available in /var/lib/mongo/journal or use --smallfiles
2014-09-24T11:54:23.680-0400 [initandlisten]
2014-09-24T11:54:23.681-0400 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
2014-09-24T11:54:23.681-0400 [initandlisten] dbexit:
2014-09-24T11:54:23.681-0400 [initandlisten] shutdown: going to close listening sockets...
2014-09-24T11:54:23.681-0400 [initandlisten] shutdown: going to flush diaglog...
2014-09-24T11:54:23.681-0400 [initandlisten] shutdown: going to close sockets...
2014-09-24T11:54:23.681-0400 [initandlisten] shutdown: waiting for fs preallocator...
2014-09-24T11:54:23.681-0400 [initandlisten] shutdown: lock for final commit...
2014-09-24T11:54:23.681-0400 [initandlisten] shutdown: final commit...
2014-09-24T11:54:23.681-0400 [initandlisten] shutdown: closing all files...
2014-09-24T11:54:23.681-0400 [initandlisten] closeAllFiles() finished
2014-09-24T11:54:23.681-0400 [initandlisten] journalCleanup...
2014-09-24T11:54:23.681-0400 [initandlisten] removeJournalFiles
2014-09-24T11:54:23.684-0400 [initandlisten] shutdown: removing fs lock...
2014-09-24T11:54:23.684-0400 [initandlisten] dbexit: really exiting now
The --repair flag is meant to repair a corrupt database, not to solve any permission problems
You obviously didn't follow the instructions of the link too closely, because he did start the service as root. ;) sudo may only allow certain parts of the init scripts to be executed with superuser rights by the user calling it. Others may (though they shouldn't) silently fail. As for init scripts at least: sudo != being root.
To fix the problem: sudo chown mongod -R /var/log/mongodb/ && sudo chown mongod -R /var/run/mongodb && sudo chown mongod -R /var/lib/mongo Then become root and try to run mongo manually with sudo -u mongod mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log. In case there are other problems left, mongodb will tell you. Fix those until starting mongodb manually as written above works flawless, then use the initscript from that point on.
Edit: corrected the --dbpath option as per comment