Deploy a 3-Node MongoDB 4.0 Replica Set with X.509 Authentication + Self Signed Certificates
9 min readJun 9, 2018
This article will guide you through the process of setting up a MongoDB cluster that will utilise X.509 authentication with self signed certificates. Our cluster will consist of 3 nodes that will be deployed as a replica set. I will also include tips along the way to help your workflow.
An overview of the walkthrough:
- Installation of MongoDB on your VPSs. This article documents Red Hat CentOS7 installation, but I will outline the official MongoDB resources you can refer to for installation on your OS.
- Adding a admin user to your nodes.
- Attaching an XFS formatted volume that will serve as your means of data storage.
- Adding hostnames for each of your cluster nodes and configuring your firewall.
- Creating a X.509 certificate for each node using a self signed CA.
- Configuring MongoDB for a X.509 Authentication replica set.
- Initialising a replica set.
Why Choose MongoDB?
Before you undertake the task of deploying MongoDB as your means of data storage, make sure it is the right solution for you. MongoDB is a document oriented database offering a flexible…