• Stars
    star
    154
  • Rank 242,095 (Top 5 %)
  • Language
    C++
  • Created about 8 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

mongosync is simple && useful tool to sync data between mongo replicaSet, it is developed by Qihoo's DBA and infrastructure team

README

中文wiki前往

1.Introduction

This simpe program is for transfering data between two mongo nodes, including:

  • data cloning;
  • oplog syncing(applying one mongo databbase's oplog to another mongo database) ;
  • oplog cloning(not applying, just storing the oplogs from source mongo database to another one)

2.Usage

  • Get the source code

    $ git clone https://github.com/Qihoo360/mongosync.git
  • Compile

    Enter the source code and typewrite:

    $ make

    after that, a "mongosync" named execution file appears in the $(MONGOSYNC_ROOT)/output directory, and also a "mongosync.conf" named config file

    SP:

    a. maybe some depenncies not installed in your machine, install them according to the tips(mostly sons, boost and ssl is needed)

    b. don't use c++11 to compile this program, otherwise will occur error

  • Exectution

    The program can launches with command line or config file,and the specified usage can be obtained by:

    $ cd output
    $ ./mongosync --help
    Follow is the mongosync-surpported options:
    --help                   to get the help message
    -c conf.file             use config file to start mongosync
    --src_srv arg            the source mongodb server's ip port
    --src_user arg           the source mongodb server's logging user
    --src_passwd arg         the source mongodb server's logging password
    --src_auth_db arg        the source mongodb server's auth db
    --src_use_mcr            force source connection to use MONGODB-CR password machenism
    --dst_srv arg            the destination mongodb server's ip port
    --dst_user arg           the destination mongodb server's logging user
    --dst_passwd arg         the destination mongodb server's logging password
    --dst_auth_db arg        the destination mongodb server's auth db
    --dst_use_mcr            force destination connection to use MONGODB-CR password machenism
    --db arg                 the source database to be cloned
    --dst_db arg             the destination database
    --coll arg               the source collection to be cloned
    --dst_coll arg           the destination collection
    --oplog                  whether to sync oplog
    --raw_oplog              whether to only clone oplog
    --op_start arg           the start timestamp to sync oplog
    --op_end arg             the start timestamp to sync oplog
    --dst_op_ns arg          the destination namespace for raw oplog mode
    --no_index               whether to clone the db or collection corresponding index
    --filter arg             the bson format string used to filter the records to be transfered

3.Performance

Rough testing under the situation:

  • Ping from this program's exectution's machine to the mongo db server's machine(two machines) is about 1.5ms
  • total about 36,400,000 documents;
  • database size about 1.09GB

transfering time is about 379 seconds(even qps: 96.04k).

SP: The bottleneck is writing, So using multiple threads(multi-conn) to accelerate the speed of that(but also limited by database server's writing speed).

More Repositories

1

RePlugin

RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Java
7,261
star
2

Atlas

A high-performance and stable proxy for MySQL, it is developed by Qihoo's DBA and infrastructure team
C
4,650
star
3

wayne

Kubernetes multi-cluster management and publishing platform
TypeScript
3,706
star
4

evpp

A modern C++ network library for developing high performance network services in TCP/UDP/HTTP protocols.
C++
3,564
star
5

ArgusAPM

Powerful, comprehensive (Android) application performance management platform. 360线上移动性能检测平台
Java
2,673
star
6

safe-rules

详细的C/C++编程规范指南,由360质量工程部编著,适用于桌面、服务端及嵌入式软件系统。
2,363
star
7

Quicksql

A Flexible, Fast, Federated(3F) SQL Analysis Middleware for Multiple Data Sources
Java
2,057
star
8

poseidon

A search engine which can hold 100 trillion lines of log data.
Go
1,966
star
9

QConf

Qihoo Distributed Configuration Management System
C++
1,865
star
10

hbox

AI on Hadoop
Java
1,727
star
11

phptrace

A tracing and troubleshooting tool for PHP scripts.
C
1,677
star
12

mysql-sniffer

mysql-sniffer is a network traffic analyzer tool for mysql, it is developed by Qihoo DBA and infrastructure team
C
845
star
13

huststore

High-performance Distributed Storage
C
823
star
14

doraemon

Doraemon is a Prometheus based monitor system
JavaScript
655
star
15

logkafka

Collect logs and send lines to Apache Kafka
C++
500
star
16

zeppelin

A Scalable, High-Performance Distributed Key-Value Platform
C++
399
star
17

tensornet

C++
316
star
18

qbusbridge

The Apache Kafka Client SDK
C++
292
star
19

360zhinao

360zhinao
Python
274
star
20

XSQL

Unified SQL Analytics Engine Based on SparkSQL
Scala
210
star
21

WatchAD2.0

WatchAD2.0是一款针对域威胁的日志分析与监控系统
CSS
206
star
22

zendAPI

The C++ wrapper of zend engine
C++
183
star
23

artdumper

从oat文件中dump出来dex的工具
C++
138
star
24

influx-proxy

influxdb HA
Go
128
star
25

kmemcache

linux kernel memcache server
C
126
star
26

XLearning-XDML

extremely distributed machine learning
Scala
123
star
27

simcc

A simple C++ common base library used in Qihoo 360
C++
116
star
28

nemo

A library that provide multiply data structure. Such as map, hash, list, set. We build these data structure base on rocksdb as the storage layer for Pika https://github.com/OpenAtomFoundation/pika .
C++
115
star
29

ngx_http_subrange_module

Split one big HTTP/Range request to multiple subrange requesets
C
107
star
30

blackwidow

A library implements REDIS commands(Strings, Hashes, Lists, Sorted Sets, Sets, Keys, HyperLogLog) based on rocksdb, as the storage layer for Pika https://github.com/OpenAtomFoundation/pika .
C++
99
star
31

QNAT

C
88
star
32

Mario

A Library that make the write from synchronous to asynchronous.
C++
78
star
33

Luwak

利用预训练语言模型从非结构化威胁报告中提取 MITRE ATT&CK TTP 信息
Python
68
star
34

mpic

A C++ embedded library of multiple processes framework developed and used at Qihoo360.
C++
50
star
35

nemo-rocksdb

Add TTL feature on rocksdb, and compatible with rocksdb
C++
44
star
36

dgl-operator

The DGL Operator makes it easy to run Deep Graph Library (DGL) graph neural network training on Kubernetes
Go
44
star
37

ironwill

Useful iOS components for your project. 健壮且有用的OC代码, 可以直接在你的iOS应用中使用.
Objective-C
37
star
38

elog

A erlang log nif
C++
28
star
39

rust-jsonnet

rust-jsonnet - The Google Jsonnet( operation data template language) for rust
Rust
24
star
40

zeppelin-gateway

Object Gateway Provide Applications with a RESTful Gateway to zeppelin
C++
23
star
41

zeppelin-client

Client Library for zeppelin
C++
21
star
42

luajit-jsonnet

The Google Jsonnet( operation data template language) for Luajit
C++
16
star
43

HTTPSLayer

PHP
16
star
44

CReSS

Cross-model Retrieval between 13C NMR Spectrum and Structure
Python
15
star
45

wayne-backend-plugins

Wayne backend plugins
Go
13
star
46

gpstall

Stall Postgres' insert command
C++
8
star
47

cloud-website

360 cloud official website
PHP
8
star
48

wayne-frontend-plugins

Wayne UI Plugins
TypeScript
7
star
49

SEEChat

一见多模态对话模型
Python
5
star
50

wiki

wiki for qihoo infrastructure team
2
star
51

se-office

se-office扩展,提供基于开放标准的全功能办公生产力套件,基于浏览器预览和编辑office。
JavaScript
1
star