skip to navigation
skip to content

Not Logged In

mongooplog-alt 0.1.1-dev

Improved alternative to official mongooplog utility.

Latest Version: 0.4.2



**mongooplog-alt** is the Python remake of `official mongooplog utility`_
(shipped with MongoDB starting from version 2.2.0). It reads oplog of a remote
server, and applies operations to the local server. This can be used to keep
independed replica set loosly synced (sort of one way replication), and may be
useful in various backup and migration scenarios.

``mongooplog-alt`` implements basic functionality of the official utility and
adds following features:

* tailable oplog reader: runs forever polling new oplog event which is extremly
  useful for keeping two independent replica sets in almost real-time sync.

* option to exclude one or more namespaces (i.e. dbs or collections) from
  being synced.

* works on mongodb 1.8.x, 2.0.x, and 2.2.x. Official utility supports 2.2.x

* at the time of writing (2.2.0), official ``mongooplog`` suffers from bug that
  limits its usage with replica sets (

.. _official mongooplog utility:


Using pip (preferred)::

    pip install --upgrade mongooplog-alt

Using easy_install::

    easy_install -U mongooplog-alt

Command-line options

Options common to original ``mongooplog``:

.. option:: --host <hostname><:port>, -h

    Hostname of the mongod server to which oplog operations are going to be
    applied. Default is "localhost"

.. option:: --port <number>

    Port of the mongod server to which oplog operations are going to be
    applied, if not specified in ``--host``. Default is 27017.

.. option:: --seconds <number>

    Number of seconds of latest operations to pull from the remote host.
    Default is 86400, or 24 hours.

Options specific to ``mongooplog-alt``:

.. option:: --follow, -f

   Wait for new data in oplog. Makes the utility polling oplog forever (until
   interrupted). New data is going to be applied immideately with at most one
   second delay.

.. option:: --exclude, -x

    List of space separated namespaces which should be ignored. Can be in form
    of ``dname`` or ``dbname.collection``.


Consider the following sample usage::

    mongooplog-alt --from --host -f --exclude logdb data.transactions --seconds 600

This command is going to take operations from the last 10 minutes from prod,
and apply them to dev. Database ``logdb`` and collection ``transactions`` of
``data`` database will be omitted. After operations for the last minutes will
be applied, command will wait for new changes to come, keep running until
Ctrl+C or other termination signal recieved.
File Type Py Version Uploaded on Size
mongooplog-alt-0.1.1-dev.linux-x86_64.exe (md5) MS Windows installer any 2012-09-11 65KB
mongooplog-alt-0.1.1-dev.tar.gz (md5) Source 2012-09-11 2KB
  • Downloads (All Versions):
  • 35 downloads in the last day
  • 193 downloads in the last week
  • 718 downloads in the last month