Rancher is a platform for deploying dockerized applications. In this link-ed post, you’ll read how to use it to cluster a Node.js application with a replicated MongoDB backend.
The article was first published on the Rancher blog by Hussein Galal.
Since the availability of Rancher’s Beta release a few weeks ago, I’ve been pretty excited about the new scheduling and service discovery capabilities in the platform. To help people understand the impact of these capabilities, today I’m going to show how to use these features to deploy a fully clustered and HA implementation of a Node.js application.
I’m going to use Let’s Chat as our example application, It is an excellent open-source, Slack-like team chat application. Deploying a single Let’s Chat app with a Mongo backend is incredibly easy, and there is an excellent Docker compose file already available to do this. However, my goal was to build a clustered and highly available setup, that could handle host failure, so I will run several MongoDB containers and set up a replica set to replicate the data between those containers. The replica set has the ability to elect a new primary server when the master goes down.
You may read the complete article here.