Git Product home page Git Product logo

mongo-utils's Introduction

mongo-utils

Simple MongoDB sharding utilities

parallel_restore/parallel_restore.sh:

Wrapper around mongorestore to restore databases in parallel

bash parallel_restore.sh localhost:27017 ~/dump 2

Sharding/shard_databases.py

Copy databases and collections from one cluster to another, and shard them in destination cluster

Usage: shard_databases.py [options]

Options:
  -h, --help            show this help message and exit
  --source=SRC          Source host details
  --dest=DST            Destination host details
  -k SHARDKEY, --key=SHARDKEY
                        Shard key name (default _id)
  -f, --force           Force by dropping database if exists in destination
example:
python shard_databases.py --source secondary_replica_server:27017 --dest sharded_mongos_server:27017 --force --key _id

Sharding/shard_single_database.py

Copy a database and all its collections from one cluster to another, and shard them in destination cluster

Usage: shard_single_database.py [options]

Options:
  -h, --help            show this help message and exit
  --source=SRC          Source host details
  --dest=DST            Destination host details
  --db=DB               Shard only specified database
  -k SHARDKEY, --key=SHARDKEY
                        Shard key name (default _id)
  -f, --force           Force by dropping database if exists in destination
example: 
python shard_single_database.py --source secondary_replica_server:27017 --dest sharded_mongos_server:27017 --force --db testdb1 --key shardKey

sharding/validate_db.py

Validate all databases and collections checksum (count) from source to destination based on timestamp

Usage: validate_db.py [options]

Options:
  -h, --help            show this help message and exit
  --source=SRC          Source host details
  --dest=DST            Destination host details
  -c COLLECTIONS, --collections=COLLECTIONS
                        List of collections to be validates (default all)
example:
python validate_db.py --source secondary_replica_server:27017 --dest sharded_mongos_server:27017 -c "test1 test2"

sharding/shard_all_collections.py

Shard all collections in the server

Usage: shard_all_collections.py [options]

Options:
  -h, --help  show this help message and exit
  --host=SRC  host details
example:
python shard_all_collections --host sharded_mongos_server:27017

mongo-utils's People

Contributors

vanuganti avatar

Stargazers

Sergio Prada avatar skondla avatar Serhii Shyman avatar Adrian Silva avatar  avatar Deshi Xiao avatar

Watchers

 avatar James Cloos avatar

mongo-utils's Issues

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.