opsync v0.16.2
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.
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago