Skip to content

Docker based Mongo Replicas cluster of three nodes.

Notifications You must be signed in to change notification settings

abdul/mongo-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongo Replicas running as Docker containers.

Inspiration and most of code/configuration comes from [this blog post] (http://www.tothenew.com/blog/mongodb-replica-set-using-docker-networking-and-docker-compose/) (Thanks to [Navjot Singh] (http://www.tothenew.com/blog/author/navjot/) -- Author of the post).

Information

  • PRIMARY - <DOCKER_MACHINE_IP:27017>
  • SECONDARY - <DOCKER_MACHINE_IP:27018>
  • SECONDARY - <DOCKER_MACHINE_IP:27019>

Running

Verifying - Failover Situations (if Secondary becomes Primary)

  • Stop Primary (master) service - docker-compose stop mongodb-master
  • Connect to one of Secondary (slave):
    • mongo <DOCKER_MACHINE_IP:27018> or docker run -it abdul/alpine-mongo:latest mongo <DOCKER_MACHINE_IP:27018>
    • Or, * mongo <DOCKER_MACHINE_IP:27019> or docker run -it abdul/alpine-mongo:latest mongo <DOCKER_MACHINE_IP:27019>
  • Verify if data (imported/added earlier on Primary) is available

About

Docker based Mongo Replicas cluster of three nodes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages