Select Protector > Add to open the Add Protector window:
On the General tab:
In the Service to protect field, choose the MongoDB Windows Service.
It's named MongoDB Server (MongoDB).
Occasionally MongoDB doesn't restart properly after a power failure, system crash or other unexpected shutdown
(see bug SERVER-4373 for the details).
To protect yourself against those situations, create a batch file that removes the mongodb.lock file from the
db directory:
Specify that batch file in the
Run this command prior to restarting the service section at the bottom of the window.
This will ensure that MongoDB comes up "clean" if it ever crashes and inadvertently leaves the lock file behind:
If you find that the MongoDB windows service occasionally gets stuck in the "Stopping" or "Starting" state,
click over to the Extras tab and check the corresponding options:
Click the Save button. In a second or two, an entry for MongoDB will show up in the Service Protector window.
At this point, MongoDB is already being monitored by Service Protector:
That's it! Next time your computer boots, MongoDB will start and Service Protector will begin monitoring the service to promptly restart it if it fails.
We encourage you to edit MongoDB in Service Protector and check out the many other settings that make the database run better in your environment.
For example, send email alerts when the service fails, restart MongoDB nightly to cure annoying memory leaks, and much more.
Trouble protecting the MongoDB Windows Service?
From Service Protector, select Protector > Report Activity > Today to bring up an HTML report detailing the interaction between Service Protector and MongoDB.
Browse the Service Protector FAQ for answers to commonly asked questions and troubleshooting tips.