Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.
/ mongo-watchdog Public archive

Watches local MongoDB instance to ensure it can write to disk

License

Notifications You must be signed in to change notification settings

levenlabs/mongo-watchdog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongo-watchdog

Starting in Mongo 4.2 the Storage Node Watchdog is available in Community editions of Mongo and therefore this service is no longer necessary and is no longer supported.

MongoDB only supports a disk watchdog in the Enterprise edition. This small binary can be run and will kill the local mongod if it remains unresponsive for a set amount of time. It is based off the process described in SERVER-14139.

Every --update-interval the binary tries to update a document in the local DB and if it fails consecutively for more than --failure-threshold amount of time the mongod process is killed, which should trigger the other secondaries to perform an election.

Installing

You can use go to build and install the binary by running:

go get github.com/levenlabs/mongo-watchdog

You can also download the latest release for your platform.

Usage

./mongo-watchdog [--addr=127.0.0.1:27017] [--socket-timeout=30s] [--update-interval=15s] [--failure-threshold=2m]