Utilities for inspecting and manipulating the MongoDB oplog.
By Dan McKinley - dan@etsy.com - http://mcfunley.com
This package contains utilities for manipulating a MongoDB oplog, which can be necessary in recovery scenarios. The tools are:
oplog-count - counts the number of events in the oplog after a certain date and time. oplog-trim - deletes events from the oplog after a certain date and time.
The easiest way to install is using setuptools.
$ easy_install oplogutils
To install from source, extract the tarball and use the following commands.
$ python setup.py build $ sudo python setup.py install
oplog-trim --host=myhost.domain.com --port=27017 --remove-after="2010-05-22 03:42:00"
oplogutils comes with a fairly complete unit test suite. The suite requires the mongod program to be somewhere in the $PATH. To run the tests, use:
python setup.py test
- The MongoDB website
- See articles tagged MongoDB on the Etsy developer blog for some use cases.
- 05-30-2010 - Added --version switch to commands. Test fixes.
- 05-30-2010 - Added oplogutils to cheeseshop.
- 05-21-2010 - Initial release.