Giter Club home page Giter Club logo

mongo-op-throttler's Introduction

mongo-op-throttler

Applies a list of mongo operations at a limited speed.

Usage

mongo-op-throttler takes a oplog and runs the operations in the oplog against a Mongo at a fixed rate. It applies the operations in an idempotent way which means that inserts are converted to upserts, and the like. We do this so that even if we fail half-way through applying oplog operations we don't have to know where we failed and can simply re-run the job with the same input.

It has only been tested against the Mongo 2.4 version of oplogs, but in theory should work with other versions.

go run main.go --mongoURL localhost --path oplog.bson

You can specify the following flags

flag default description
--speed 1 Number of operations per second
--mongoURL localhost Mongo URL to run the operations against
--path /dev/stdin Oplog file to replay

Development

You can run the tests with:

make test

mongo-op-throttler's People

Contributors

kvigen avatar nathanleiby avatar xavi- avatar johnhuangclever avatar natebrennand avatar alsmola avatar peggyl avatar bgveenstra avatar rgarcia avatar renatoprime avatar clever-dan-torczynski avatar prime-time avatar

Watchers

Taylor Singletary avatar Ben Adida avatar Tim Wee avatar Nikhil Pandit avatar  avatar  avatar mohit avatar Colin Schimmelfing avatar  avatar James Cloos avatar Tyler B. avatar Kevin Shen avatar Jacob Simon avatar Sayan avatar jian avatar  avatar Vicky Enalen avatar Colin DuRant avatar Pamela Martinez avatar Alisha Sojar avatar  avatar Dan Sparks avatar Phil Nova avatar Anthony Fumagalli avatar Richard Wen avatar Asanka Dharma avatar  avatar  avatar  avatar  avatar Evan Shieh avatar  avatar Kofi Ohene-Adu avatar  avatar  avatar Nitsan Shai avatar Amir Valiani avatar  avatar  avatar Nathaniel Okun avatar Lucas Cook avatar

mongo-op-throttler's Issues

Issues in building the mongo-op-throttler

Hi,

I have configured the oplog-dump and its working fine, but i'm unable to build throttler as there is no go folder in it. I have used the go command given but didn't work. Is there any other steps?

Logs:


[root@Hostname ~]# go run main.go --mongoURL localhost --path /tmp/systemCopier859808198/local/oplog.rs.bson
main.go:11:2: cannot find package "github.com/Clever/mongo-op-throttler/apply" in any of:
/usr/lib/golang/src/github.com/Clever/mongo-op-throttler/apply (from $GOROOT)
/opt/mongo-op-throttler-master/go/src/github.com/Clever/mongo-op-throttler/apply (from $GOPATH)
main.go:12:2: cannot find package "github.com/Clever/pathio" in any of:
/usr/lib/golang/src/github.com/Clever/pathio (from $GOROOT)
/opt/mongo-op-throttler-master/go/src/github.com/Clever/pathio (from $GOPATH)
main.go:14:2: cannot find package "gopkg.in/mgo.v2" in any of:
/usr/lib/golang/src/gopkg.in/mgo.v2 (from $GOROOT)
/opt/mongo-op-throttler-master/go/src/gopkg.in/mgo.v2 (from $GOPATH)

[root@Hostname ~]# ll -lrth
total 60K
-rw-r--r-- 1 root root 1021 Nov 9 23:19 README.md
drwxr-xr-x 2 root root 4.0K Nov 9 23:19 operation
-rw-r--r-- 1 root root 575 Nov 9 23:19 Makefile
-rw-r--r-- 1 root root 704 Nov 9 23:19 main_test.go
-rw-r--r-- 1 root root 1.8K Nov 9 23:19 main.go
drwxr-xr-x 2 root root 4.0K Nov 9 23:19 launch
-rw-r--r-- 1 root root 769 Nov 9 23:19 Gopkg.toml
-rw-r--r-- 1 root root 1.7K Nov 9 23:19 Gopkg.lock
-rw-r--r-- 1 root root 5.2K Nov 9 23:19 golang.mk
-rw-r--r-- 1 root root 375 Nov 9 23:19 Dockerfile
drwxr-xr-x 2 root root 4.0K Nov 9 23:19 convert
-rw-r--r-- 1 root root 1.2K Nov 9 23:19 circle.yml
drwxr-xr-x 2 root root 4.0K Nov 9 23:19 bson
drwxr-xr-x 2 root root 4.0K Nov 9 23:19 apply


Could you please explain the steps involved to configure/build this tool. This seems to be very good utility for Mongo replication without replica-set.

Any help would be appreciated.

-Thanks.

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.