Git Product home page Git Product logo

mongoreplay's Introduction

Mongoreplay

Mongoreplay is no longer supported or maintained.

Purpose

mongoreplay is a traffic capture and replay tool for MongoDB. It can be used to inspect commands being sent to a MongoDB instance, record them, and replay them back onto another host at a later time.

Use cases

  • Preview how well your database cluster would perform a production workload under a different environment (storage engine, index, hardware, OS, etc.)
  • Reproduce and investigate bugs by recording and replaying the operations that trigger them
  • Inspect the details of what an application is doing to a mongo cluster (i.e. a more flexible version of mongosniff)

Quickstart

Building Tools

To build the tools, you need to have Go version 1.9 and up. go get will not work; you need to clone the repository to build it.

git clone https://github.com/mongodb-labs/mongoreplay.git
cd mongodb-labs/mongoreplay.git

To use build/test scripts in the repo, you MUST set GOROOT to your Go root directory.

export GOROOT=/usr/local/go

Quick build

The build.sh script builds all the tools, placing them in the bin directory. Pass any build tags (like ssl or sasl) as additional command line arguments.

./build.sh
./build.sh ssl
./build.sh ssl sasl

Manual Build

Source set_goenv.sh and run the set_goenv function to setup your GOPATH and architecture-specific configuration flags:

. ./set_goenv.sh
set_goenv

Set the environment variable to use local vendor folder Pass tags to the go build command as needed in order to build the tools with support for SSL and/or SASL. For example:

mkdir bin
export GO111MODULE=on
export GOSUMDB=off
export GOFLAGS=-mod=vendor

go build -o bin/mongoreplay main/mongoreplay.go
go build -o bin/mongoreplay -tags ssl main/mongoreplay.go
go build -o bin/mongoreplay -tags "ssl sasl" main/mongoreplay.go

Use Mongoreplay

Please follow the instructions in https://docs.mongodb.com/manual/reference/program/mongoreplay/

Testing

To run unit and integration tests:

./runTests.sh

If TOOLS_TESTING_UNIT is set to "true" in the environment, unit tests will run. Delete the environment variable will disable unittest test. If TOOLS_TESTING_INTEGRATION is set to "true" in the environment, integration tests will run. Delete the environment variable will disable integration test.

Integration tests require a mongod (running on port 33333) while unit tests do not.

To run the tests inside pcap_test.go, you need to download the testing pcap files from Amazon S3 to mongoreplay/testPcap bucket: boxes.10gen.com path: build/mongotape/ If the pcap files are not available, the tests inside pcap_test will be skpped.

mongoreplay's People

Contributors

huan-mongo avatar rychipman avatar

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.