MongoDB Cluster with 3 Linux Instances
Setup MongoDB Cluster
Prerequisite
Configuration and installation
Update && Upgrade the system
sudo apt-get update -y && sudo apt-get upgrade -yhostnameSet the Hostname in each server
sudo hostnamectl set-hostname myhostname
Server Hostname Configuration

To add the MongoDB GPG key


Install MongoDB
Start MongoDB Service

Enable MongoDB to Start on the Boot
Verify Installation


Enable Replication in Each Server's
MongoDB Configuration File:-






Starting the Replica Set and Adding Members:

Conclusion
PreviousSet up a MongoDB Cluster using 3 Linux InstancesNextSetup Ansible Linux Instance and Application deployment on Instances
Last updated