Must remove Mongod.lock every time I startup

4,734 views
Skip to first unread message

Calvin Froedge

unread,
Mar 17, 2011, 7:52:30 AM3/17/11
to mongodb-user
For some reason, every time I shut my mac os x off and then restart,
mongodb does not start automatically. When I do:

sudo mongod start

I get this:

**************
old lock file: /data/db/mongod.lock. probably means unclean shutdown
recommend removing file and running --repair
see: http://dochub.mongodb.org/core/repair for more information
*************

Then I do sudo rm /data/db/mongod.lock

and

sudo mongod

And everything boots up and Mongo works fine.

Besides being a local annoyance, I'm thinking about my production
deployment, where for whatever reason the server may experience
downtime and then come back up. How can I fix this issue so that
mongod starts as soon as my system does, without the need to remove
the old lock file?

Nat

unread,
Mar 17, 2011, 8:09:29 AM3/17/11
to mongod...@googlegroups.com
Did you install mongod as a service in init.d or start it manually before the reboot?
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Eliot Horowitz

unread,
Mar 17, 2011, 10:41:05 AM3/17/11
to mongod...@googlegroups.com
This means mongo is not getting shut down properly when you shut down
your computer.
In production, for clean restarts you should make sure mongo gets shut
down cleanly.
For unclean shutdown, you either need to repair after, or use --journal with 1.8

Harvester of Sorrow

unread,
Apr 13, 2011, 3:20:43 AM4/13/11
to mongodb-user
Hello,

I have the same problem on Windows 7 64 bit:

"C:\data\mongodb-win32-x86_64-1.8.0\bin\mongod" --bind_ip 127.0.0.1
--logpath "c:\mongo\logs" --logappend --dbpath "c:\mongo\data" --
directoryperdb --service

this is the service command

I always shut down the computer using start->shutdown, so the shut
down is always a clean one. This may be a bug?

If I manually stop the service, and start it, the problem doesn not
appear. This problem appears only at shutting down windows and
starting it.

Thank you.

On Mar 17, 5:41 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> This means mongo is not getting shut down properly when you shut down
> your computer.
> In production, for clean restarts you should make sure mongo gets shut
> down cleanly.
> For unclean shutdown, you either need to repair after, or use --journal with 1.8
>
> On Thu, Mar 17, 2011 at 7:52 AM, Calvin Froedge
>
>
>
>
>
>
>
> <cal...@creativelogicmedia.com> wrote:
> > For some reason, every time I shut my mac os x off and then restart,
> > mongodb does not start automatically.  When I do:
>
> > sudo mongod start
>
> > I get this:
>
> > **************
> > old lock file: /data/db/mongod.lock.  probably means unclean shutdown
> > recommend removing file and running --repair
> > see:http://dochub.mongodb.org/core/repairfor more information

Nat

unread,
Apr 13, 2011, 3:26:54 AM4/13/11
to mongod...@googlegroups.com
Try 1.8.1. It just got fixed recently.
-----Original Message-----
From: Harvester of Sorrow <npan...@gmail.com>
Sender: mongod...@googlegroups.com
Date: Wed, 13 Apr 2011 00:20:43
To: mongodb-user<mongod...@googlegroups.com>
Reply-To: mongod...@googlegroups.com

Harvester of Sorrow

unread,
Apr 13, 2011, 4:36:35 AM4/13/11
to mongodb-user
if used this : mongod --bind_ip 127.0.0.1 --logpath c:\mongo\logs --
logappend --dbpath c:\mongo\data --directoryperdb --install

I get this output in cmd:

C:\data\mongodb-win32-x86_64-1.8.1\bin>mongod --bind_ip 127.0.0.1 --
logpath c:\m
ongo\logs --logappend --dbpath c:\mongo\data --directoryperdb --
install
all output going to: c:\mongo\logs
Creating service MongoDB.
Service creation successful.
Service can be started from the command line via 'net start
"MongoDB"'.


but when starting service i get this error:

Windows could not start the Mongo DB service on Local Computer

Error 193: 0xc1

Any idea?

Thanks
> > > see:http://dochub.mongodb.org/core/repairformore information

Harvester of Sorrow

unread,
Apr 13, 2011, 4:47:56 AM4/13/11
to mongodb-user
Fixed it. I had a file called mongod in the bin folder (how did it get
there, I don't know :) )

Nat

unread,
Apr 13, 2011, 4:48:11 AM4/13/11
to mongodb-user
If you open services.msc, go to mongodb and check the properties. You
should see something like

"C:\data\mongodb-xxxxxxxxx\bin\mongod" --service --logpath c:\data
\test.log

- What do you see in there?
- What account do you use to start it?
- What is the current service status?
- Do you see any error in eventlog?
Reply all
Reply to author
Forward
0 new messages