SlideShare a Scribd company logo
#MongoDBDays




Backup, Restore, and
Disaster Recovery
Craig Wilson
Software Engineer, 10gen
You Gotta Back It Up
To Get It Back
Leo Laporte
Even More Important
Restoring It
Slightly Less, But Still Very
Important
Practice
Backups with MongoDB
• Not difficult
   – Multiple options
   – Choose the one that fits your needs

• Can be automated
• Practice
Choices
Choices
• Selectivity
• Live/Offline
• Efficiency
• Backup Size
• Environment Constraints
mongodump
• Dumps collections to *.bson files
   – Use bsondump to view these files

• Mirrors your structure
• Can be run in live or offline mode
• --dbpath for direct file access
• --oplog to dump oplog last PIT
• --query/filter selective dump
mongorestore
• Selected dbs, collections
• --oplogReplay
File System - fsync +lock
• No more writes
• Copy the data files
• Remember to unlock
File System - Snapshot
• Snapshot
  – Journaling needs to be on
  – Journal needs to be on the same volume
File System
• Entire database
• Backup files will be large
• Fastest way to create a backup
• Fastest way to restore a backup
Disaster Recovery
Replica Sets
Disaster Avoidance
Disaster Avoidance
• Redundancy
• Multiple Datacenters
• Multiple Regions
Disaster Avoidance
 > rs.conf()
{
   "_id" : "replSetName",
   "version" : 3,
   "members" : [
   {
      "_id" : 0,
      "host" : "myhost1.dnsname.com:27017“,
      “tags” : { “dc” : “east” }
  },
  {
      "_id" : 1,
      "host" : "myhost2.dnsname.com:27017“,
      “tags” : { “dc” : “east” }
  },
  {
      "_id" : 2,
      "host" : "myhost3.dnsname.com:27017“,
      “tags” : { “dc” : “west” }
  }
]}
Disaster Recovery Logistics
• Recovery (restore) time
• Replacement
   – Machine
   – Component (disk, memory, etc)
   – Cluster

• Configuration (reconfiguration)
Sharded Systems
Sharded Systems
• No true point in time
1. Stop balancing – sh.stopBalancer()
2. Stop one config server (data R/O)
3. Backup Data (shards, config)
4. Restart config server
5. Resume Balancer
What have we discussed?
What have we discussed?
• You have Options
• It’s not difficult
• Practice!
#MongoDBDays




Thank You
Craig Wilson
Software Engineer, 10gen

More Related Content

PPTX
Mongodb backup
PPTX
This is redis - feature and usecase
PPTX
Backup, Restore, and Disaster Recovery
PDF
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
PDF
Containers > VMs
PDF
Nodejs - A-quick-tour-v3
KEY
Redis overview for Software Architecture Forum
PPT
Node.js
Mongodb backup
This is redis - feature and usecase
Backup, Restore, and Disaster Recovery
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
Containers > VMs
Nodejs - A-quick-tour-v3
Redis overview for Software Architecture Forum
Node.js

What's hot (20)

PPTX
A simple introduction to redis
PPTX
MongoDB Memory Management Demystified
PPTX
Shell Tips & Tricks
PDF
REDIS intro and how to use redis
PPTX
PDF
Caching. api. http 1.1
KEY
CHI - YAPC NA 2012
PDF
Background Tasks in Node - Evan Tahler, TaskRabbit
ZIP
CHI-YAPC-2009
ODP
Introduction to Mesos
PDF
Advanced Administration, Monitoring and Backup
PDF
[2019] 200만 동접 게임을 위한 MySQL 샤딩
PPT
Introduction to redis
PDF
Mastering the MongoDB Shell
PDF
MongoDB memory management demystified
ODP
An Introduction to REDIS NoSQL database
PDF
Setting up mongo replica set
PDF
Nodejs - A quick tour (v5)
PPTX
Mastering the MongoDB Javascript Shell
PPTX
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
A simple introduction to redis
MongoDB Memory Management Demystified
Shell Tips & Tricks
REDIS intro and how to use redis
Caching. api. http 1.1
CHI - YAPC NA 2012
Background Tasks in Node - Evan Tahler, TaskRabbit
CHI-YAPC-2009
Introduction to Mesos
Advanced Administration, Monitoring and Backup
[2019] 200만 동접 게임을 위한 MySQL 샤딩
Introduction to redis
Mastering the MongoDB Shell
MongoDB memory management demystified
An Introduction to REDIS NoSQL database
Setting up mongo replica set
Nodejs - A quick tour (v5)
Mastering the MongoDB Javascript Shell
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Ad

Viewers also liked (7)

PDF
Ops Jumpstart: MongoDB Administration 101
PPTX
Webinar: How Financial Firms Create a Single Customer View with MongoDB
PPTX
Leveraging MongoDB as a Data Store for Security Data
PPTX
Mongo db london
PPTX
MongoDB IoT City Tour LONDON: Hadoop and the future of data management. By, M...
PPTX
MongoDB IoT City Tour LONDON: Managing the Database Complexity, by Arthur Vie...
PPTX
Securing Your Deployment with MongoDB and Red Hat's Identity Management in Re...
Ops Jumpstart: MongoDB Administration 101
Webinar: How Financial Firms Create a Single Customer View with MongoDB
Leveraging MongoDB as a Data Store for Security Data
Mongo db london
MongoDB IoT City Tour LONDON: Hadoop and the future of data management. By, M...
MongoDB IoT City Tour LONDON: Managing the Database Complexity, by Arthur Vie...
Securing Your Deployment with MongoDB and Red Hat's Identity Management in Re...
Ad

Similar to Backup, Restore, and Disaster Recovery (20)

PPTX
Backup, Restore, and Disaster Recovery
PPTX
MongoDB Backup & Disaster Recovery
PPTX
Webinar: Backups and Disaster Recovery
PPTX
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
PPT
On MongoDB backup
PPTX
Strategies For Backing Up Mongo Db 10.2012 Copy
PPTX
Strategies for Backing Up MongoDB
PPTX
MongoDB London 2013: Basic Replication in MongoDB presented by Marc Schwering...
PPTX
Walking the Walk: Developing the MongoDB Backup Service with MongoDB
PPTX
Webinar: Keeping Your MongoDB Data Safe
PPTX
Run MongoDB with Confidence: Backing up and Monitoring with MMS
PPTX
Basic Replication in MongoDB
PPTX
Replication and replica sets
PPTX
Webinar: Replication and Replica Sets
PPTX
Webinar: Backups + Disaster Recovery
PPTX
Run MongoDB with Confidence Using MongoDB Management Service (MMS)
PDF
MongoDB: Advantages of an Open Source NoSQL Database
PPTX
Advanced Replication
PPTX
2014 05-07-fr - add dev series - session 6 - deploying your application-2
PPTX
MongoDB Management Service: Getting Started with MMS
Backup, Restore, and Disaster Recovery
MongoDB Backup & Disaster Recovery
Webinar: Backups and Disaster Recovery
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
On MongoDB backup
Strategies For Backing Up Mongo Db 10.2012 Copy
Strategies for Backing Up MongoDB
MongoDB London 2013: Basic Replication in MongoDB presented by Marc Schwering...
Walking the Walk: Developing the MongoDB Backup Service with MongoDB
Webinar: Keeping Your MongoDB Data Safe
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Basic Replication in MongoDB
Replication and replica sets
Webinar: Replication and Replica Sets
Webinar: Backups + Disaster Recovery
Run MongoDB with Confidence Using MongoDB Management Service (MMS)
MongoDB: Advantages of an Open Source NoSQL Database
Advanced Replication
2014 05-07-fr - add dev series - session 6 - deploying your application-2
MongoDB Management Service: Getting Started with MMS

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...

Backup, Restore, and Disaster Recovery

Editor's Notes

  • #2: Needs more content?
  • #5: One of the Best Examples of this is Netflix and their Chaos Monkey.