Logo

dev-resources.site

for different kinds of informations.

How to Rebuild MongoDB Replica-Set Node Fast in Few Minutes

Published at
7/15/2022
Categories
mongodb
database
replication
rebuild
Author
abhishekjaindba
Author
15 person written this
abhishekjaindba
open
How to Rebuild MongoDB Replica-Set Node Fast in Few Minutes

It sometimes happens that the MongoDB replica set node goes out of sync from replica set members and, due to high lag, cannot synchronise itself from the replica set. There are traditional ways to remove the replica set node from the cluster and add it back but the issue arises when your database size is too big and node sync takes hours or days. Also in some cases, it degrades the performance. You simply use the following steps and rebuild your replica set member in a few minutes.

Step1
Remove the node from cluster

Prod:PRIMARY> rs.remove(":27017")
Step2
login to ssh to Secondary Node and delete all the content of mongodb directory folder

Step3
Log in to the Primary node. If you donโ€™t know who is primary run this command rs. slave(ok) from any node and then run rs.status(). rs. status will give you the [rimary node IP address or Hostname. Just ssh or login to primary and shut the MongoDB services

--Stop MongoDB

Read more: https://thedbadmin.com/how-to-rebuild-mongodb-replica-set-node-fast-in-few-minutes/

replication Article's
30 articles in total
Favicon
How to Set Up PostgreSQL Logical Replication: Use Cases and Step-by-Step Guide.
Favicon
How to enable AWS S3 replication between Global AWS Region and AWS China
Favicon
System design: Database Partitioning, Sharding, and Replication
Favicon
Easy Postgresql 16 Replication on Ubuntu
Favicon
On Frameworks for Implementing Distributed Protocols
Favicon
MSSQL Replication By T-SQL & Docker containers on Linux
Favicon
Cluster Linking in Confluent Platform
Favicon
Multi-AZ PostgreSQL COMMIT wait events: WALSync, SyncRep & XactSync
Favicon
On Implementation of Distributed Protocols
Favicon
The Story Behind Replica_IO
Favicon
ELT Using Airbyte Replication
Favicon
Review of NAKIVO Backup & Replication: A Comprehensive Office 365 Data Loss Prevention Solution
Favicon
Cross-account S3 replication: encrypted and non-encrypted objects
Favicon
PostgreSQL's Logical Replication
Favicon
Safeguarding Your Virtual Realm: Mastering VMware Backup and Restore with Veeam
Favicon
Syncing Databases: How to Do It and Best Practices
Favicon
Rethink the way you share the data between micro-services with Change-Data-Capture
Favicon
AWS DynamoDB Global Tables - Multi-Region, Multi-Active Replication
Favicon
AWS Cross-Region S3 Bucket Replication
Favicon
Kafka: Let's talk (again) about replication
Favicon
YugabyteDB: Achieving High Availability and Disaster Recovery with Two Dataย Centers
Favicon
How to setup AWS S3 bucket replication
Favicon
Debezium vs DBConvert Streams: Which Offers Superior Performance in Data Streaming?
Favicon
What is MySQL Replication ?
Favicon
Cross-cluster async replication with YugabyteDB xCluster
Favicon
Data Indexing, Replication, and Sharding: Basic Concepts
Favicon
Basic Replication in Redis
Favicon
How to Rebuild MongoDB Replica-Set Node Fast in Few Minutes
Favicon
Quarks Replication for a scalable solution
Favicon
How easy to setup Master-master replication in CouchDB

Featured ones: