I want to restart mongodb(the code is in a .bat file) by nodejs , if it was stopped by accident.
Is there any module can do this job?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Based on your latest two comments, there’s a few things that you should take note of.
You are unable to restart the mongo windows service because there is a lock file. The CPU increases because mongod is attempting an automatic restart.
When the mongod process/service is uncleanly shutdown, there will be a lock file under your data path. Perform a
diron the data directory and I believe that you will find the lock filemongod.lockthere.You do not need to reboot your PC, simply remove the lock file (you may need to disable the service to do that) and restart the service.
There two SERVER tickets that are related to the restart behaviour on Windows –
Ticket 3582 – this fix (where an automatic restart of
mongodno longer occurs) is from version 2.1.0 onwards. 2.1.x is the development branch.MongoDB 2.2.0-rc0 was recently released and is ready for testing. It is the culmination of the 2.1.x development series.
2.2 Release Notes: http://docs.mongodb.org/manual/release-notes/2.2
Downloads: http://www.mongodb.org/downloads
Change Log: https://jira.mongodb.org/browse/SERVER/fixforversion/11218
Ticket 2, which is currently in the planning stage and will be a longer-term fix.