Skip to content

Some Vagrant definitions we use for experiments in user group sessions.

Notifications You must be signed in to change notification settings

BryanDonovan/vagrant-mongo-shards

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant MongoDB Sharding Definitions

Purpose

This is forked from MUGBerlin/vagrant-machines. Vagrant is a nice way to experiment with technologies without polluting your own machine with software.

Preconditions

Please follow the install instructions at http://vagrantup.com/.

What it Does

This sets up 4 servers with MongoDB connected via a host-only network.

Startup:

vagrant up

The startup can take a while.

The IP addresses of the 3 shard servers are

  • shard01.local
  • shard02.local
  • shard03.local

The IP adress of the configserver and mongos instance is

  • configsrv.local

Each server has the same setup. If you want to connect to a certain server via ssh use (e.g. shard01):

vagrant ssh shard01

Connect to the MongoDB instances from your host:

mongo --host configsrv.local --port 27017

Add the shards

sh.addShard( "shard01.local:27017" )
sh.addShard( "shard02.local:27017" )
sh.addShard( "shard03.local:27017" )

Set chunk size to something demo usable (optional)

use config
db.settings.save( { _id:"chunksize", value: 1 } )

Problems

  • IP already used within your network
    • open the vagrant fiel and change the ip of all nodes: xxx.vm.network :hostonly, "10.0.0.24"

Links

Useful link to the MongoDB documentation: http://docs.mongodb.org/manual/administration/sharding/

About

Some Vagrant definitions we use for experiments in user group sessions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%