SlideShare a Scribd company logo
1 of 18
MongDB Backup & Disaster
Recover
Elankumaran Srinivasan
Why Backup & Disaster Recovery ?
Application MongoDB
Driver
Company’s Data Centre
1. Possible network issue between the data center & other external cloud services.
2. Cloud cluster down or unreachable or terminated accidentally or data deleted accidentally
Application MongoDB
Driver
Company’s Data Centre
Disaster recovery strategy is essential to quickly get access to the minimum required data and keep the
application depending on the critical data running with smallest down time.
Key Measurement Parameters For DR
1. Minimum time required to spin up a new cluster with snapshot data.
a) Account for snapshot data download/transfer time.
b) Cluster setup, restore and configure time.
2. Time lag between live mirrored secondary cluster and the primary cluster.
3. Can the data be restored into clusters of any topology?
Production Cluster On MongoDB Atlas
• Sharded Cluster.
• Two replica sets.
• Each replica set has 3 nodes. One primary and two secondary.
• 6 mongos running on the same hosts as 6 mongod.
• Config servers running as a 3 node replica set.
• Snapshots taken twice a day.
• Automatic, periodic snapshots. Useful for point in time recovery.
• Snapshots stored on Amazon S3.
• All mongos are part of a load balancer. Applications connect to these mongos through load
balancer.
Production Cluster On MongoDB Atlas
Shard#1 Shard#2
Instance Port
mongod 27017
mongos 37017
Primary
Secondary Secondary
mongos
mongos mongos
Load Balancer For Mongos Nodes
Application
MongoDB Driver
Mongocfg
(Primary)
Mongocfg
(Sec)
Mongocfg
(Sec)
Primary
Secondary Secondary
mongos
mongos mongos
Disaster Recovery (Different Approaches)
Create new cluster in
company’s data center &
restore snapshot
MongoDB Atlas
MongoDB Atlas
(Create a new cluster & restore
snapshot)
Spin up a new cluster
on AWS and restore
Data Restore Considerations
Different Topology
Mongo Cluster
• Restore into a sharded cluster.
• Restore into a stand alone node or a replica set.
• Restore into a cluster with similar topology as Production.
• Restore into a cluster with with a different topology.
Restoring Snapshot to a new Cluster on MongoDB Atlas
After selecting restore my snapshot, select the new
cluster that you provisioned on MongoDB Atlas
Downloading the Snapshot to restore into non-Atlas Environment
Steps to restore a sharded cluster ( Same Topology)
Restoring data into a new sharded cluster involves the following steps:
1. Setting up and restoring data into mongod sharded servers.
2. Setting up config servers as a replica set.
3. Setting up mongos (routers) and hooking them up to the config servers.
4. Adding sharded nodes(configured in step #1) via mongos
Steps to restore a sharded cluster ( Same Topology)
1. a. Set up a new cluster with the same topology as Production. Don’t start any of the mongo services.
1. b. Restore the snapshot into one of the mongod nodes. Lets assume in a path /data/db
1. c. Start the mongod on the node while pointing to the restored data path.
mongod --dbpath /data/db --replSet <replName> --shardsvr
1.d. Connect to mongo shell on the node and initiate a new replica set.
mongo
rs.initate()
Example : mongod --dbpath /data/db --replSet rs0 --shardsvr
Steps to restore a sharded cluster ( Same Topology)
1. e. While connected to the mongo shell , configure the replica set.
rs.initiate( { _id : "rs1", members: [ { _id : 0, host : ”s1-mongo1:27017" } ] })
1.g. Repeat steps 1.b through 1.f for replica set ”r1 ” and hosts s2-mongo1, s2-mongo2 and s2-mongo3
1. f. Add the other members of the replica set.
rs.add(”s2-mongo1”)
rs.add(”s3-mongo1”)
Steps to restore a sharded cluster ( Same Topology) - Contd…
2.a. Setup the 3 config servers as replica set. Start mongod as config servers for each node.
mongod --configsvr --replSet configReplSet
mongo
rs.initiate( { _id: "configReplSet", configsvr: true, members: [ { _id: 0, host:
”config01:27019" }, { _id: 1, host: ”config02:27019" }, { _id: 2, host:
”config03:27019" } ] } )
2.b. Log into one of the config server to set up the replica set and add other members to the replicaset.
Steps to restore a sharded cluster ( Same Topology) - Contd…
3.a. Setup 6 mongos by executing the following command on each of the mongos nodes.
mongos --configdb configReplSet/config01:27019,config02:27019,config03:27019
Steps to restore a sharded cluster ( Same Topology) - Contd…
4.a. Add shard#1 into the cluster. In order to do this, connect to one of the mongos shells and execute
the following command.
mongo mong01-router:27017/admin
sh.addShard( "rs0/s1-mongo1:27017,s1-mongo2:27017,s1-mongo3:27017" )
4.b. Add the nodes for shard#2 to the cluster.
sh.addShard( "rs1/s2mongo1:27017,s2-mongo2:27017,s2-mongo3:27017" )
Steps to restore to a single replica set.
Restoring data into a single replica set.
1. Setting up and restoring data into mongod servers. Follow the same instructions
as in Slide #10 and Slide #11 .
2. Non-Sharded cluster does not have mongos & mongod config servers.
Live Mirrored Stand By Cluster
Application MongoDB
Driver
Company’s Data Centre
Mongo-mirror
application
Replicate into
The Mongo connector utility can be used to migrate data from one cluster to another. This can be used to setup a live
secondary stand by cluster.
Reference : https://github.com/mongodb-labs/mongo-connector
Setting Up Mongo Mirror
Shard#2 Shard#2
Primary
Secondary Secondary
mongos
mongos mongos
Primary
Secondary Secondary
mongos
mongos mongos
Shard#1 Shard#2
Primary
Secondary Secondary
mongos
mongos mongos
Primary
Secondary Secondary
mongos
mongos mongos
Mongo
connector
Mongo
connector

More Related Content

What's hot

The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDBvaluebound
 
Best Practices for Managing MongoDB with Ops Manager
Best Practices for Managing MongoDB with Ops ManagerBest Practices for Managing MongoDB with Ops Manager
Best Practices for Managing MongoDB with Ops ManagerMongoDB
 
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나Amazon Web Services Korea
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...Amazon Web Services Korea
 
When to Use MongoDB...and When You Should Not...
When to Use MongoDB...and When You Should Not...When to Use MongoDB...and When You Should Not...
When to Use MongoDB...and When You Should Not...MongoDB
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architectureBishal Khanal
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMike Dirolf
 
Masterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationMasterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationAmazon Web Services
 
05. 마이크로서비스 아키텍처 환경에서의 SSO 구축방안
05. 마이크로서비스 아키텍처 환경에서의 SSO 구축방안05. 마이크로서비스 아키텍처 환경에서의 SSO 구축방안
05. 마이크로서비스 아키텍처 환경에서의 SSO 구축방안Opennaru, inc.
 
Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...
 Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra... Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...
Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...HostedbyConfluent
 
Advanced Ops Manager Topics
Advanced Ops Manager TopicsAdvanced Ops Manager Topics
Advanced Ops Manager TopicsMongoDB
 
데이터베이스 운영, 서버리스로 걱정 끝! - 윤석찬, AWS 테크에반젤리스트 - AWS Builders Online Series
데이터베이스 운영, 서버리스로 걱정 끝! - 윤석찬, AWS 테크에반젤리스트 - AWS Builders Online Series데이터베이스 운영, 서버리스로 걱정 끝! - 윤석찬, AWS 테크에반젤리스트 - AWS Builders Online Series
데이터베이스 운영, 서버리스로 걱정 끝! - 윤석찬, AWS 테크에반젤리스트 - AWS Builders Online SeriesAmazon Web Services Korea
 
Architecting Security and Governance Across Multi Accounts
Architecting Security and Governance Across Multi AccountsArchitecting Security and Governance Across Multi Accounts
Architecting Security and Governance Across Multi AccountsAmazon Web Services
 
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...Amazon Web Services Korea
 
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)Amazon Web Services Korea
 

What's hot (20)

The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
 
Best Practices for Managing MongoDB with Ops Manager
Best Practices for Managing MongoDB with Ops ManagerBest Practices for Managing MongoDB with Ops Manager
Best Practices for Managing MongoDB with Ops Manager
 
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
 
When to Use MongoDB...and When You Should Not...
When to Use MongoDB...and When You Should Not...When to Use MongoDB...and When You Should Not...
When to Use MongoDB...and When You Should Not...
 
Microservices Decomposition Patterns
Microservices Decomposition PatternsMicroservices Decomposition Patterns
Microservices Decomposition Patterns
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Masterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationMasterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormation
 
Introduction to Amazon DynamoDB
Introduction to Amazon DynamoDBIntroduction to Amazon DynamoDB
Introduction to Amazon DynamoDB
 
05. 마이크로서비스 아키텍처 환경에서의 SSO 구축방안
05. 마이크로서비스 아키텍처 환경에서의 SSO 구축방안05. 마이크로서비스 아키텍처 환경에서의 SSO 구축방안
05. 마이크로서비스 아키텍처 환경에서의 SSO 구축방안
 
AWS DynamoDB and Schema Design
AWS DynamoDB and Schema DesignAWS DynamoDB and Schema Design
AWS DynamoDB and Schema Design
 
Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...
 Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra... Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...
Disaster Recovery Options Running Apache Kafka in Kubernetes with Rema Subra...
 
Advanced Ops Manager Topics
Advanced Ops Manager TopicsAdvanced Ops Manager Topics
Advanced Ops Manager Topics
 
데이터베이스 운영, 서버리스로 걱정 끝! - 윤석찬, AWS 테크에반젤리스트 - AWS Builders Online Series
데이터베이스 운영, 서버리스로 걱정 끝! - 윤석찬, AWS 테크에반젤리스트 - AWS Builders Online Series데이터베이스 운영, 서버리스로 걱정 끝! - 윤석찬, AWS 테크에반젤리스트 - AWS Builders Online Series
데이터베이스 운영, 서버리스로 걱정 끝! - 윤석찬, AWS 테크에반젤리스트 - AWS Builders Online Series
 
Architecting Security and Governance Across Multi Accounts
Architecting Security and Governance Across Multi AccountsArchitecting Security and Governance Across Multi Accounts
Architecting Security and Governance Across Multi Accounts
 
Event Storming and Saga
Event Storming and SagaEvent Storming and Saga
Event Storming and Saga
 
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon DynamoDB기반 글로벌 서비스 개발 방법 (김준형 솔루션즈 아키텍트)
 

Similar to MongoDB Backup & Disaster Recovery

Getting started with replica set in MongoDB
Getting started with replica set in MongoDBGetting started with replica set in MongoDB
Getting started with replica set in MongoDBKishor Parkhe
 
MongoDB Replication and Sharding
MongoDB Replication and ShardingMongoDB Replication and Sharding
MongoDB Replication and ShardingTharun Srinivasa
 
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaSMariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaSJelastic Multi-Cloud PaaS
 
Setting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSetting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSudheer Kondla
 
Percona Cluster Installation with High Availability
Percona Cluster Installation with High AvailabilityPercona Cluster Installation with High Availability
Percona Cluster Installation with High AvailabilityRam Gautam
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Mydbops
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & IntroductionJerwin Roy
 
Avi Apelbaum - RAC
Avi Apelbaum - RAC Avi Apelbaum - RAC
Avi Apelbaum - RAC gridcontrol
 
Setting up mongo replica set
Setting up mongo replica setSetting up mongo replica set
Setting up mongo replica setSudheer Kondla
 
Percona Cluster with Master_Slave for Disaster Recovery
Percona Cluster with Master_Slave for Disaster RecoveryPercona Cluster with Master_Slave for Disaster Recovery
Percona Cluster with Master_Slave for Disaster RecoveryRam Gautam
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB
 
Training Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & RecoveryTraining Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & RecoveryContinuent
 
Upgrading to MongoDB 4.0 from older versions
Upgrading to MongoDB 4.0 from older versionsUpgrading to MongoDB 4.0 from older versions
Upgrading to MongoDB 4.0 from older versionsAntonios Giannopoulos
 
Percona Live 2017 ­- Sharded cluster tutorial
Percona Live 2017 ­- Sharded cluster tutorialPercona Live 2017 ­- Sharded cluster tutorial
Percona Live 2017 ­- Sharded cluster tutorialAntonios Giannopoulos
 
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...Uri Cohen
 
Sharding
ShardingSharding
ShardingMongoDB
 
Back to Basics Webinar 3: Introduction to Replica Sets
Back to Basics Webinar 3: Introduction to Replica SetsBack to Basics Webinar 3: Introduction to Replica Sets
Back to Basics Webinar 3: Introduction to Replica SetsMongoDB
 

Similar to MongoDB Backup & Disaster Recovery (20)

Getting started with replica set in MongoDB
Getting started with replica set in MongoDBGetting started with replica set in MongoDB
Getting started with replica set in MongoDB
 
MongoDB Replication and Sharding
MongoDB Replication and ShardingMongoDB Replication and Sharding
MongoDB Replication and Sharding
 
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaSMariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
 
Mongo db roma replication and sharding
Mongo db roma replication and shardingMongo db roma replication and sharding
Mongo db roma replication and sharding
 
Setting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSetting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutes
 
Percona Cluster Installation with High Availability
Percona Cluster Installation with High AvailabilityPercona Cluster Installation with High Availability
Percona Cluster Installation with High Availability
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
 
Mongodb replication
Mongodb replicationMongodb replication
Mongodb replication
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & Introduction
 
Avi Apelbaum - RAC
Avi Apelbaum - RAC Avi Apelbaum - RAC
Avi Apelbaum - RAC
 
Setting up mongo replica set
Setting up mongo replica setSetting up mongo replica set
Setting up mongo replica set
 
Percona Cluster with Master_Slave for Disaster Recovery
Percona Cluster with Master_Slave for Disaster RecoveryPercona Cluster with Master_Slave for Disaster Recovery
Percona Cluster with Master_Slave for Disaster Recovery
 
Server side rendering review
Server side rendering reviewServer side rendering review
Server side rendering review
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
 
Training Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & RecoveryTraining Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & Recovery
 
Upgrading to MongoDB 4.0 from older versions
Upgrading to MongoDB 4.0 from older versionsUpgrading to MongoDB 4.0 from older versions
Upgrading to MongoDB 4.0 from older versions
 
Percona Live 2017 ­- Sharded cluster tutorial
Percona Live 2017 ­- Sharded cluster tutorialPercona Live 2017 ­- Sharded cluster tutorial
Percona Live 2017 ­- Sharded cluster tutorial
 
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
 
Sharding
ShardingSharding
Sharding
 
Back to Basics Webinar 3: Introduction to Replica Sets
Back to Basics Webinar 3: Introduction to Replica SetsBack to Basics Webinar 3: Introduction to Replica Sets
Back to Basics Webinar 3: Introduction to Replica Sets
 

Recently uploaded

Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxMasterG
 
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligenceRevolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligencePrecisely
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 

Recently uploaded (20)

Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligenceRevolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 

MongoDB Backup & Disaster Recovery

  • 1. MongDB Backup & Disaster Recover Elankumaran Srinivasan
  • 2. Why Backup & Disaster Recovery ? Application MongoDB Driver Company’s Data Centre 1. Possible network issue between the data center & other external cloud services. 2. Cloud cluster down or unreachable or terminated accidentally or data deleted accidentally Application MongoDB Driver Company’s Data Centre Disaster recovery strategy is essential to quickly get access to the minimum required data and keep the application depending on the critical data running with smallest down time.
  • 3. Key Measurement Parameters For DR 1. Minimum time required to spin up a new cluster with snapshot data. a) Account for snapshot data download/transfer time. b) Cluster setup, restore and configure time. 2. Time lag between live mirrored secondary cluster and the primary cluster. 3. Can the data be restored into clusters of any topology?
  • 4. Production Cluster On MongoDB Atlas • Sharded Cluster. • Two replica sets. • Each replica set has 3 nodes. One primary and two secondary. • 6 mongos running on the same hosts as 6 mongod. • Config servers running as a 3 node replica set. • Snapshots taken twice a day. • Automatic, periodic snapshots. Useful for point in time recovery. • Snapshots stored on Amazon S3. • All mongos are part of a load balancer. Applications connect to these mongos through load balancer.
  • 5. Production Cluster On MongoDB Atlas Shard#1 Shard#2 Instance Port mongod 27017 mongos 37017 Primary Secondary Secondary mongos mongos mongos Load Balancer For Mongos Nodes Application MongoDB Driver Mongocfg (Primary) Mongocfg (Sec) Mongocfg (Sec) Primary Secondary Secondary mongos mongos mongos
  • 6. Disaster Recovery (Different Approaches) Create new cluster in company’s data center & restore snapshot MongoDB Atlas MongoDB Atlas (Create a new cluster & restore snapshot) Spin up a new cluster on AWS and restore
  • 7. Data Restore Considerations Different Topology Mongo Cluster • Restore into a sharded cluster. • Restore into a stand alone node or a replica set. • Restore into a cluster with similar topology as Production. • Restore into a cluster with with a different topology.
  • 8. Restoring Snapshot to a new Cluster on MongoDB Atlas After selecting restore my snapshot, select the new cluster that you provisioned on MongoDB Atlas
  • 9. Downloading the Snapshot to restore into non-Atlas Environment
  • 10. Steps to restore a sharded cluster ( Same Topology) Restoring data into a new sharded cluster involves the following steps: 1. Setting up and restoring data into mongod sharded servers. 2. Setting up config servers as a replica set. 3. Setting up mongos (routers) and hooking them up to the config servers. 4. Adding sharded nodes(configured in step #1) via mongos
  • 11. Steps to restore a sharded cluster ( Same Topology) 1. a. Set up a new cluster with the same topology as Production. Don’t start any of the mongo services. 1. b. Restore the snapshot into one of the mongod nodes. Lets assume in a path /data/db 1. c. Start the mongod on the node while pointing to the restored data path. mongod --dbpath /data/db --replSet <replName> --shardsvr 1.d. Connect to mongo shell on the node and initiate a new replica set. mongo rs.initate() Example : mongod --dbpath /data/db --replSet rs0 --shardsvr
  • 12. Steps to restore a sharded cluster ( Same Topology) 1. e. While connected to the mongo shell , configure the replica set. rs.initiate( { _id : "rs1", members: [ { _id : 0, host : ”s1-mongo1:27017" } ] }) 1.g. Repeat steps 1.b through 1.f for replica set ”r1 ” and hosts s2-mongo1, s2-mongo2 and s2-mongo3 1. f. Add the other members of the replica set. rs.add(”s2-mongo1”) rs.add(”s3-mongo1”)
  • 13. Steps to restore a sharded cluster ( Same Topology) - Contd… 2.a. Setup the 3 config servers as replica set. Start mongod as config servers for each node. mongod --configsvr --replSet configReplSet mongo rs.initiate( { _id: "configReplSet", configsvr: true, members: [ { _id: 0, host: ”config01:27019" }, { _id: 1, host: ”config02:27019" }, { _id: 2, host: ”config03:27019" } ] } ) 2.b. Log into one of the config server to set up the replica set and add other members to the replicaset.
  • 14. Steps to restore a sharded cluster ( Same Topology) - Contd… 3.a. Setup 6 mongos by executing the following command on each of the mongos nodes. mongos --configdb configReplSet/config01:27019,config02:27019,config03:27019
  • 15. Steps to restore a sharded cluster ( Same Topology) - Contd… 4.a. Add shard#1 into the cluster. In order to do this, connect to one of the mongos shells and execute the following command. mongo mong01-router:27017/admin sh.addShard( "rs0/s1-mongo1:27017,s1-mongo2:27017,s1-mongo3:27017" ) 4.b. Add the nodes for shard#2 to the cluster. sh.addShard( "rs1/s2mongo1:27017,s2-mongo2:27017,s2-mongo3:27017" )
  • 16. Steps to restore to a single replica set. Restoring data into a single replica set. 1. Setting up and restoring data into mongod servers. Follow the same instructions as in Slide #10 and Slide #11 . 2. Non-Sharded cluster does not have mongos & mongod config servers.
  • 17. Live Mirrored Stand By Cluster Application MongoDB Driver Company’s Data Centre Mongo-mirror application Replicate into The Mongo connector utility can be used to migrate data from one cluster to another. This can be used to setup a live secondary stand by cluster. Reference : https://github.com/mongodb-labs/mongo-connector
  • 18. Setting Up Mongo Mirror Shard#2 Shard#2 Primary Secondary Secondary mongos mongos mongos Primary Secondary Secondary mongos mongos mongos Shard#1 Shard#2 Primary Secondary Secondary mongos mongos mongos Primary Secondary Secondary mongos mongos mongos Mongo connector Mongo connector