This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

About

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 in a 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 sync only selected databases/collections.
  • option to exclude one or more namespaces (i.e. dbs or collections) from being synced.
  • ability to “rename” dbs/collections on fly, i.e. destination namespaces can differ from the original ones.
  • works on mongodb 1.8.x, 2.0.x, and 2.2.x. Official utility only supports version 2.2.x and higher.
  • save last processed timestamp to file, resume from saved point later.
  • at the time of writing (2.2.0), official mongooplog suffers from bug that limits its usage with replica sets (https://jira.mongodb.org/browse/SERVER-6915)

Installation

Using pip (preferred):

pip install --upgrade mongooplog-alt

Using easy_install:

easy_install -U mongooplog-alt

Command-line options

Options common to original mongooplog:

--from <hostname><:port>
  Hostname of the mongod server from which oplog operations are going to be
  pulled.

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

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

--port <number>

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

-s SECONDS, --seconds SECONDS

  seconds to go back. If not set, try read timestamp from --resume-file.
  If the file not found, assume --seconds=86400 (24 hours)

Options specific to mongooplog-alt:

--to
  An alias for ``--host``.

--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.

--exclude, -x

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

 --ns

   Process only these namespaces, ignoring all others. Space separated list of
   strings in form of ``dname`` or ``dbname.collection``.

 --rename [ns_old=ns_new [ns_old=ns_new ...]]

   Rename database(s) and/or collection(s). Operations on namespace ``ns_old``
   from the source server will be applied to namespace ``ns_new`` on the
   destination server.

 --resume-file FILENAME

   resume from timestamp read from this file and write last processed
   timestamp back to this file (default is mongooplog.ts).
   Pass empty string or 'none' to disable this feature.

Example usages

Consider the following sample usage:

mongooplog-alt --from prod.example.com:28000 --to dev.example.com:28500 -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.

Testing

Tests for mongooplog-alt are written in javascript using test harness which is used for testing MongoDB iteself. You can run the whole suite with:

mongo tests/suite.js

Note, that you will need existing writable /data/db dir.

Tests produce alot of output. Succesfull execution ends with line like this:

ReplSetTest stopSet *** Shut down repl set - test worked ****
Release History

Release History

0.4.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1-dev

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0-dev

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
mongooplog-alt-0.4.2.tar.gz (6.0 kB) Copy SHA256 Checksum SHA256 Source Feb 12, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting