cargomedia/puppet-packages — pull request #578 by kris-lab (2014-04-25 09:10:11+00:00)
Title: Mongodb monit check: increase timeout or cycles to prevent restart on db start

IMO timeout should be 30sec or cycles should be 10 (maybe even more)
```
if failed port 27017 with timeout 30 seconds for 2 cycles then restart
```
or
```
if failed port 27017 with timeout 10 seconds for 6 cycles then restart
```

It looks like `monit` restarts `mongodb` before it fully loads!

```
2014-04-25T08:34:30.769+0000 [signalProcessingThread] dbexit: really exiting now
2014-04-25T08:34:31.123+0000 ***** SERVER RESTARTED *****
2014-04-25T08:34:31.127+0000 [initandlisten] MongoDB starting : pid=24430 port=27017 dbpath=/var/lib/mong$
2014-04-25T08:34:31.127+0000 [initandlisten] db version v2.6.0
2014-04-25T08:34:31.127+0000 [initandlisten] git version: 1c1c76aeca21c5983dc178920f5052c298db616c
2014-04-25T08:34:31.127+0000 [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.32-431.3.1.el6.x8$
2014-04-25T08:34:31.127+0000 [initandlisten] allocator: tcmalloc
2014-04-25T08:34:31.127+0000 [initandlisten] options: { config: "/etc/mongodb/mongod_standalone.conf", ne$
2014-04-25T08:34:31.150+0000 [initandlisten] journal dir=/var/lib/mongodb/mongod_standalone/journal
2014-04-25T08:34:31.150+0000 [initandlisten] recover : no journal files present, no recovery needed
2014-04-25T08:34:31.150+0000 [initandlisten] preallocating a journal file /var/lib/mongodb/mongod_standal$
2014-04-25T08:34:34.047+0000 [initandlisten] File Preallocator Progress: 807403520/1073741824 $
2014-04-25T08:34:37.243+0000 [initandlisten] File Preallocator Progress: 933232640/1073741824 $
2014-04-25T08:34:40.263+0000 [initandlisten] File Preallocator Progress: 1038090240/1073741824$
2014-04-25T08:34:49.791+0000 [signalProcessingThread] got signal 15 (Terminated), will terminate after cu$
2014-04-25T08:34:49.791+0000 [signalProcessingThread] now exiting
2014-04-25T08:34:49.791+0000 [signalProcessingThread] dbexit:
2014-04-25T08:34:49.792+0000 [signalProcessingThread] shutdown: going to close listening sockets...
2014-04-25T08:34:49.792+0000 [signalProcessingThread] shutdown: going to flush diaglog...
2014-04-25T08:34:49.792+0000 [signalProcessingThread] shutdown: going to close sockets...
2014-04-25T08:34:49.792+0000 [signalProcessingThread] shutdown: waiting for fs preallocator...
2014-04-25T08:34:49.792+0000 [signalProcessingThread] shutdown: lock for final commit...
2014-04-25T08:34:49.792+0000 [signalProcessingThread] shutdown: final commit...
2014-04-25T08:34:49.792+0000 [signalProcessingThread] shutdown: closing all files...
2014-04-25T08:34:49.792+0000 [signalProcessingThread] closeAllFiles() finished
2014-04-25T08:34:49.792+0000 [signalProcessingThread] journalCleanup...
2014-04-25T08:34:49.792+0000 [signalProcessingThread] removeJournalFiles
2014-04-25T08:35:05.712+0000 [signalProcessingThread] shutdown: removing fs lock...
2014-04-25T08:35:05.713+0000 [signalProcessingThread] dbexit: really exiting now
2014-04-25T08:35:06.013+0000 ***** SERVER RESTARTED *****
2014-04-25T08:35:06.017+0000 [initandlisten] MongoDB starting : pid=24572 port=27017 dbpath=/var/lib/mong$
2014-04-25T08:35:06.017+0000 [initandlisten] db version v2.6.0
2014-04-25T08:35:06.017+0000 [initandlisten] git version: 1c1c76aeca21c5983dc178920f5052c298db616c
2014-04-25T08:35:06.017+0000 [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.32-431.3.1.el6.x8$
2014-04-25T08:35:06.017+0000 [initandlisten] allocator: tcmalloc
```
So restarted at `08:35:05` and monit mail at `08:34:06`
```
Connection failed Service mongod_standalone

Date: Fri, 25 Apr 2014 08:34:06
Action: restart
Host: www1.denkmal.org
Description: failed, cannot open a connection to INET[localhost:27017] via TCP

Your faithful employee,
Monit
```