Home

Awesome

mongodb-sharding-docker-compose

:whale: docker-compose stack that allows you to turn on a full MongoDB sharded cluster with the following components :

:warning: Of course this is for development purpose only

# Usage :
$ git clone git@github.com:jfollenfant/mongodb-sharding-docker-compose.git
$ mongodb-sharding-docker-compose
$ ./up.sh

You can also edit mongo-auth.init.js to change admin credentials before turning up the cluster

admin = db.getSiblingDB("admin")
admin.createUser(
  {
     user: "admin",
     pwd: "admin",
     roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] 
  }
)

:tropical_drink: Then you should be able to log into the cluster:

$ docker exec -it mongodbdocker_mongo-router-01_1 mongo admin  -u'admin' -p'admin'
MongoDB shell version v3.4.2
connecting to: mongodb://127.0.0.1:27017/admin
MongoDB server version: 3.4.2
mongos>

:beer: And turn it down with:

$ ./down.sh

TODO :construction: