Instant MongoDB sharded cluster
8.3K
This repository provides a Vagrantfile, Dockerfile and a bootstrap script to create MongoDB Cluster using a virtual machine built on Virtualbox software hypervisor. After setup is complete shared MongoDB sharded cluster on a single virtual machine running on your local machine.
MongoDB cluster consisted of the following docker containers
There unfortunately some hard-coded timeouts due to timing issues with MongoDB.
Install Virtualbox based off the installation instructions.
First, install Homebrew.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Install VirtualBox and Vagrant using Brew Cask.
brew tap phinze/homebrew-cask
brew install brew-cask
brew cask install virtualbox
brew cask install vagrant
git clone [email protected]:jacksoncage/mongo-docker.git
cd mongo-docker
vagrant up
This will pull all the images from Docker index and setup Mongodb sharded cluster.
vagrant ssh
./docker/start_cluster.sh"
You should now be able connect to mongos1 and the new sharded cluster:
MongoDB Cluster is now ready to use
Connect to cluster by:
$ mongo --port 49550
To re-initiate cluster run start_cluster.sh again. To rebuild vagrant vagrant destroy and then vagrant up
Data is stored at ./docker_mongodb_cluster/mongodata/ and are excluded from version control. Data will be persistent even for a vagrant destroy as it's mounted into vagrant and then needed container as well. To remove all data rm -rf ./docker_mongodb_cluster/mongodata/*
Content type
Image
Digest
sha256:4e3b343c6…
Size
225.5 MB
Last updated
almost 11 years ago
docker pull jacksoncage/mongo