Coder Social home page Coder Social logo

kurosakikaer / go-mongo-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from caosiyang/go-mongo-sync

0.0 0.0 0.0 18 KB

An oplog based realtime & concurrent sync tool for MongoDB from a replica set to another. It is not updated in time. Refer to https://github.com/caosiyang/py-mongo-sync

Go 100.00%

go-mongo-sync's Introduction

go-mongo-sync

An oplog based realtime sync tool for MongoDB written in Go.
Source should be a replica set and destination could be a mongod/mongos instance or member of replica set.

Feature

  • initial sync including collections and indexes
  • oplog based increment sync
  • concurrent oplog replaying

Note

  • the following databases are ignored: 'admin', 'local'
  • collections that starts with 'system.' are ignored, e.g.: 'system.users', 'system.profile'

Usage

# ./go-mongo-sync --help
Usage of ./go-mongo-sync:
  -from="": source, a member of replica-set, value should be a hostportstr like 'host:port'
  -to="": destination, a mongos or mongod instance, value should be a hostportstr like 'host:port'
  -direct-connect=false: for source only, disable the automatic replica set server discovery logic and force the use of servers provided only (even if secondaries)
  -ignore-index=false: not create index for collections
  -oplog=false: replay oplog only
  -start-optime=0: start optime, the number of seconds elapsed since January 1 1970 UTC, use this with '--oplog'
  -upsert=false: upsert documents in initial sync, insert documents if not set

TODO

  • support authentication for source and destination

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.