Alex Rivera | Logout

Cannot restart mongodb on Ubuntu 11.04

Asked 2012-04-09T11:33:05.353
14

I have installed mongodb and when i typing the following command i am getting these messages

root@amila:~# service mongodb status    
mongodb stop/waiting
root@amila:~# service mongodb restart    
restart: Unknown instance:     
root@amila:~# service mongodb stop    
stop: Unknown instance: 

I want to restart mongodb.but unable to restart.

EDIT: here is the /etc/mongodb.conf

dbpath=/var/lib/mongodb logpath=/var/log/mongodb/mongodb.log

logappend=true

bind_ip = 127.0.0.1
auth = true

Edit
Report

1 Answer

9

Sorry if you consider this "SO archeology".

I don't know if this is the same issue, but I'm facing something similiar right now. End of my log:

Mon Nov 19 10:25:37 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
Mon Nov 19 10:25:37 dbexit: 
Mon Nov 19 10:25:37 [initandlisten] shutdown: going to close listening sockets...
Mon Nov 19 10:25:37 [initandlisten] shutdown: going to flush diaglog...
Mon Nov 19 10:25:37 [initandlisten] shutdown: going to close sockets...
Mon Nov 19 10:25:37 [initandlisten] shutdown: waiting for fs preallocator...
Mon Nov 19 10:25:37 [initandlisten] shutdown: lock for final commit...
Mon Nov 19 10:25:37 [initandlisten] shutdown: final commit...
Mon Nov 19 10:25:37 [initandlisten] shutdown: closing all files...
Mon Nov 19 10:25:37 [initandlisten] closeAllFiles() finished
Mon Nov 19 10:25:37 dbexit: really exiting now

So I think the lock file is not closed properly (for example when shutting down). You should use

mongod --repair

But it didn't work for me, so I just removed /var/lib/mongodb/mongod.lock and then started the server. This is not the secure way, and there is possibility, that data in your database is corrupt if you do so.

answered 2012-11-19T10:06:42.787

Your Answer