Menu

Building a MongoDB Cluster using Docker Containers

This post explains the steps I've taken to build a cluster of 3 MongoDB servers, each one of whom is contained in a Docker container.

I've done this as an experiment in learning Docker yet the resulting cluster can be used by anyone who wants to quickly bring up a MongoDB cluster to gain a deeper understanding of MongoDB replica sets etc.

Now you might have a problem with routing inside the cluster. The container from which you initiated the cluster will have used its hostname rather than IP address. The other two containers need an IP address to route to, so lets change that.