as a service, must stop the service manually before shutting down the server?
usually it'd start and stop as the windows start and stop.
---
installed mongodb as a windows service,
after I start the service and then stop it,
net start mongodb
net stop mongodb
the logfile is :
__________________________________________________
[initandlisten] MongoDB starting:pid=2044 port=27017 dbpath=c:\mongodata 64-bit
[initandlisten] db version v1.8.0-rc0, pdfile version 4.5
[initandlisten] git version: 65a7e81df0747b6bc9380b78e0182192bacdb4d0
[initandlisten] build sys info: windows (6,1,7600,2,'') BOOST_LIB_VERSION=1_42
[initandlisten] waiting for connections on port 27017
[websvr] web admin interface listening on port 28017
shutdown: going to close listening sockets...
closing listening socket: 248
closing listening socket: 260
shutdown: going to flush diaglog...
shutdown: going to close sockets...
shutdown: waiting for fs preallocator...
shutdown: closing all files...
closeAllFiles() finished
shutdown: removing fs lock...
__________________________________________________
the mongod.lock is deleted automatically, and can start the service again .
but if I start the service and then stop the server (and restart the server),
net start mongodb
shutdown
(power on again)
the logfile is :
__________________________________________________
[initandlisten] MongoDB starting:pid=1524 port=27017 dbpath=c:\mongodata 64-bit
[initandlisten] db version v1.8.0-rc0, pdfile version 4.5
[initandlisten] git version: 65a7e81df0747b6bc9380b78e0182192bacdb4d0
[initandlisten] build sys info: windows (6,1,7600,2,'') BOOST_LIB_VERSION=1_42
[initandlisten] waiting for connections on port 27017
[websvr] web admin interface listening on port 28017
CTRL_LOGOFF_EVENT signal (ignored)
CTRL_LOGOFF_EVENT signal (ignored)
CTRL_SHUTDOWN_EVENT signal (ignored)
__________________________________________________
and can not start the service any more, because of old lock file, terminating
seems that it receives the CTRL_SHUTDOWN_EVENT signal,
but doesn't delete the lock file. (ignored? )
as a service, must stop the service manually before shutting down the server?
usually it'd start and stop as the windows start and stop.
maybe ignore the .lock file?
see also:
http://jira.mongodb.org/browse/SERVER-2160
Mongodb reports successful start even when it fails to start
exception in initAndListen std::exception: old lock file, terminating
>
> I'm not a windows expert, but it looks like the shutdown signal is
> ignored when you shutdown your machine, which causes mongodb to get
> killed. On shutdown, can you invoke net stop mongodb somewhere ?
>
usually services should start and stop as the windows start and stop.
> invoke net stop mongodb somewhere on shutdown ?
don't think this's a good idea.
--
this only happens on the new beta version.
version 1.65 or 1.74 is OK.
check again,
seems that at version 1.65 or 1.74 ,
it also says "the shutdown signal is ignored "
and don't delete the mongod.lock file.
but the service can start anyway.
seems that only after 1.6.5 and 1.7.4 ,
from 1.7.5 , mongodb begin to delete the mongod.lock
after stopping, and check if the mongod.lock exists
before starting,
and then the problem exists:
>
> If you are just seing this with 1.8.rc0 please log an issue at
>
> http://jira.mongodb.org.
no, this happens on the new beta versions, include 1.7.5 1.7.6 .1.8.rc0 .
version 1.6.5 or 1.7.4 is OK.
>
> Do you see anything in event log? If the service doesn't shutdown properly,
> you should see some messages,
event log?
lots of error messages. about 10 errors every seconds:
The Mongo DB service terminated unexpectedly.
It has done this 1 time(s). The following corrective action
will be taken in 0 milliseconds: Restart the service.
the mongod.exe process keeps running , killing itself , and restart
if using this command " net stop mongodb "
there's these event log:
The Mongo DB service entered the stopped state.
The Mongo DB service was successfully sent a stop control.
but if just shutdown or restart the server, there's no such messages.
at version 1.6.5 or 1.7.4, there's no these messages either,
but version 1.6.5 or 1.7.4 seems not checking the mongod.lock
mongodb seems to check the mongod.lock file from version 1.7.5,
am i right ?
at version 1.6.5 or 1.7.4, the mongod.lock file wouldn't be deleted
after system restart, but it doesn't check if the mongod.lock exists
and can start the service with no problem.
>
> For the restart problem, I noticed a similar problem in the latest version as
well.
> It looks like that when mongodb is installed as a service,
> its recovery policy is set to restart immediately.
> This means if you have a mongodb lock file left in there,
> it will keep restarting forever.
its recovery policy is set to restart immediately ?
sorry but what does this mean? and how to change this behavior?