Posts

Showing posts from July, 2024
  Setting Up MongoDB Replication on CentOS: A Step-by-Step Guide By Rama Srinivas Kasilanka MongoDB replication is a powerful feature that enhances data availability and reliability. By creating multiple copies of your data, you can ensure that your database remains operational even if one or more servers fail. In this guide, we’ll walk you through the process of setting up MongoDB replication on CentOS. Prerequisites Before we begin, make sure you have the following: Three CentOS servers with root or sudo privileges MongoDB installed on each server Network connectivity between the servers For the purpose of this guide, we'll refer to the servers as: Primary :  mongo1.example.com  (IP: 192.168.1.1) Secondary :  mongo2.example.com  (IP: 192.168.1.2) Arbiter :  mongo3.example.com  (IP: 192.168.1.3) Step 1: Configure MongoDB on Each Server First, we need to configure each MongoDB instance to participate in a replica set. Edit the MongoDB Configuration Fil...

Installing MongoDB on CentOS

  Installing MongoDB on CentOS: A Step-by-Step Guide MongoDB is a popular NoSQL database known for its flexibility, scalability, and ease of use. In this guide, we will walk you through the process of installing MongoDB on a CentOS operating system. Prerequisites Before we begin, ensure that you have the following: A CentOS server with root or sudo privileges An internet connection Step 1: Update the System First, update your system packages to the latest versions. sudo yum update -y Step 2: Add MongoDB Repository To install MongoDB, we need to add its repository to the system. Create a /etc/yum.repos.d/mongodb-org-6.0.repo file using a text editor like nano or vi .       sudo nano /etc/yum.repos.d/mongodb-org-6.0.repo      2.Add the following content to the file: [mongodb-org-6.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/6.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/serv...