0.16.2 • Published 9 years ago

opsync v0.16.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

opsync

Monitors the MongoDB oplog and applies new operations to other servers. All entries are passed through a filter, which sends oplog entries that match the database, collection and operation, specified in the configuration file, to a priority queue. If there is a valid connection to a remote server, the entry is pulled from the queue and replayed remotely - otherwise it will stay in queue until a connection is established. The queue is maintained in the local database, allowing persistency across reboots. Each remote server has it's own priority queue.

Install

npm install -g opsync

Setup

Make sure to start the MongoDB server as a singleton replica set

mongod --replSet name
mongo --eval 'rs.initiate()'

If you are starting mongodb as a service, put replSet = name in your configuration file.

Usage

opsync -f /path/to/config.json

Configuration

Example config

{
  "uri": "http://127.0.0.1:1886",
  "description": "test1",
  "databases": {
    "database1": {
      "priority": 1,
      "collections": {
        "users": {
          "priority": 10,
          "operations": ["insert", "update"]
        },
        "documents": {
          "priority": 100
        },
        "data": {
          "priority": 100
        }
      }
    }
  },
  "remotes": [
    {
      "uri": "http://10.10.11.2:1886",
      "description": "test2",
      "map": {
        "database1": "database2"
      }
    }
  ]
}

Stats

To start an experimental stats server, set environment variable OPSYNC_ENABLE_STATS=true. This will start a statsd server on port 8125 and port 8126 which will aggregate program stats and save in mongodb (as specified in settings.js).

Tests

To run the test, run vagrant up, see. This may take a while to provision the test machines, but hang in there - alternatively just don't run the integration tests.

0.16.2

9 years ago

0.16.1

9 years ago

0.16.0

9 years ago

0.15.2

10 years ago

0.12.5

10 years ago

0.12.1

10 years ago

0.6.1

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.11

10 years ago

0.3.10

10 years ago

0.3.8

10 years ago

0.3.6

10 years ago

0.3.5

10 years ago

0.3.4

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago