Created
December 1, 2011 14:14
-
-
Save durran/1417023 to your computer and use it in GitHub Desktop.
MongoDB Monit Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check process mongodb | |
with pidfile "/var/lib/mongodb/mongod.lock" | |
start program = "/sbin/start mongodb" | |
stop program = "/sbin/stop mongodb" | |
if failed port 28017 protocol http | |
and request "/" with timeout 10 seconds then restart | |
if 5 restarts within 5 cycles then timeout |
I have my mongodb database in other server. This is my monit file:
check process mongodb
with pidfile "/var/lib/mongodb/mongod.lock"
start program = "/sbin/start mongodb"
stop program = "/sbin/stop mongodb"
if failed host 111.111.111.111 port 28017 protocol http
and request "/" with timeout 10 seconds then restart
if 5 restarts within 5 cycles then timeout
However I get Execution failed
or Not monitored
.
Thank you!
Are you sure about pidfile here?
On my ubuntu server, mongodb installed from 10gen repo, pidfile location is /var/run/mongodb.pid
I had same issue like above - Monit cannot read mongod.lock file...
So I moddified config and this one works for me:
check process mongod matching "/usr/bin/mongod"
group database
start program = "/sbin/start mongod"
stop program = "/sbin/stop mongod"
if failed host 127.0.0.1 port 27017 protocol http
and request "/" with timeout 10 seconds then restart
if 5 restarts within 5 cycles then timeout
(Ubuntu 14.04, MongoDb 2.6.6, Monit 5.6)
What to do if my MongoDb is authenticated ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
like it. Thanks