+ All Categories
Home > Technology > Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Date post: 12-May-2015
Category:
Upload: mongodb
View: 463 times
Download: 0 times
Share this document with a friend
Description:
In this session we will cover how MMS can be used to backup and restore your data from MongoDB. We will cover backing up both replica sets and sharded environments, and discuss how to do point-in-time restores and restoring from snapshots. Presented by, Sam Weaver: Sam Weaver is a Senior Solution Architect at MongoDB based in London. Prior to MongoDB, he worked at Red Hat doing technical pre-sales on the product portfolio including Linux, Virtualisation and Middleware. Originally from Cheltenham, England he received his Bachelors from Cardiff University and currently lives in Camberley, Surrey. Visit www.mongodb.com/presentations to view other presentations in this series and many other topics.
Popular Tags:
42
Senior Solution Architect, MongoDB Sam Weaver #MongoDBMangementService MongoDB Backup Overview
Transcript
Page 1: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Senior Solution Architect, MongoDB

Sam Weaver

#MongoDBMangementService

MongoDB Backup Overview

Page 2: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Agenda

• Recap the need for backup• Cover methods for backing up

MongoDB•Introduce MMS Backup•Walkthrough

Page 3: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Disasters do happen

Page 4: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

and sometimes they are our fault

Page 5: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

• Risks– Storage failure– Power outage– Programmer error– Hardware failure– Data centre failure– Cyber attack

• Storage level options

• MongoDB Backup Service

Availability and Durability

Page 6: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

• Relative to any particular risk– How much data can you afford to lose? (RPO)– How long can you afford to be offline? (RTO)– What price are you willing to pay to remove the

risk?

• Solutions– Replication– Application engineering?– Backup

Addressing Risks

Page 7: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Replication

• Built into MongoDB, only ops and infrastructure cost

• Very little to zero data loss in failure

• Down for a very short interval

• BUT… programmer errors will replicate almost instantly

Page 8: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Application Engineering

• Flexible

• Expensive, time and money

• Good use of engineer?

Page 9: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Backup

• Slower to restore

• Can suffer from being out of date

• Fairly cheap

• Isolated

• Covers most risks

Page 10: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

• Mongodump/mongorestore

• Storage level options

• MongoDB Backup Service

Backup Approaches

Page 11: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

• Can be run online or offline

• Oplog aware for point in time restores

• Filter in, filter out

• Considerations– Data size– Sharding

Mongodump/MongoRestore

Page 12: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

• Copy files in your data directory (e.g. /data/db)

• File system or block storage snapshots

• Fastest way to backup/restore

• Considerations– Journal– Consistency– Backup granularity (whole file system back

up?)– Ops expertise– Storage of snapshots or data file backups

Storage-level Backups

Page 13: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Using the MongoDB Management Service (MMS) for Backup

Page 14: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

How it Works

Page 15: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Overview

Page 16: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

• From the initial sync, we rebuild your data in our datacenters and take a snapshot

• We take snapshots every 6 hours

• Oplog is stored for 48 hours to enable 24 hour Point-in-time restores

Under the Hood

Page 17: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Once your agents are up...

Page 18: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Once your agents are up...

• Choose which replica sets to enable backup on

•Choose which collections/namespaces to include/exclude

• An initial sync is taken of your data

•Edit snapshot policy

Page 19: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

potential choices (select the snapshot you’d like to restore to)

Snapshot screens

Page 20: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Click the “restore this snapshot” , select the delivery method, and complete these fields

Notes: one time link means one time link and no it will never work again and no you cannot email it round and it will work for someone else etc

Page 21: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

confirm your 2FA

fun!

get your restore ID

Page 22: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

if you check the status on the job, there will now be a http link available.. This will download a tar.gz file to your computer.

Page 23: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

• Create a dbpath for the MongoDB data files

• Create a symbolic link pointing to the data files

or create the database path and migrate the

data files

ln -s <hash-snapshot-name> /data/db

• Start a mongod using your new data directory

as the dbpath

mongod --dbpath /location/of/data

Download the data files

Page 24: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Restoring Sharded Clusters

• Balancer paused every 6 hours

• A no-op token is inserted across all shards

and config servers

• Oplog applied to replica sets until point in

which token was inserted

• Provides a consistent state of database

across shards

Page 25: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Click your cluster (in blue font)

Page 26: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

You can select a snapshot to restore from OR you can take the way more fun route to restore from a checkpoint. Click “restore!”

Page 27: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

here is a list of all the restore

cluster checkpoints for your

sharded cluster. You can select

one of these points in time.

This is the slower option, since

MMS will then rebuild a snapshot

up until the time you’ve entered.

Depending on retention settings

the window of time available to

select from will be limited.

Page 28: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

• You will receive one data file to download

for each shard• And one for the config server(s)

•Same process as before for moving the

data files to the server

Restoring Sharded Clusters

Page 29: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
Page 30: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Mongodump File system MMS Backup

Initial complexity Medium High Low

Confidence in Backups Medium Medium High

Point in time recovery of replica set

Sort of ☺ No Yes

System Overhead High Can be low Low

Scalable No With work Yes

Consistent Snapshot of Sharded System

Difficult Difficult Yes

Recovery Approaches

Page 31: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Key Benefits

Page 32: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Point in Time

• Oplog stored for 48 hours

• Restore your replica set to any point-in-

time in the last 24 hours by creating a

custom snapshot

•Configurable!

Page 33: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Snapshot Policy

• Every 6 hours for 48 hours

• Every day for 1 week

• Every week for for a month

• Every month for a year

•Configurable!

Page 34: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Easy to Restore

• Pull from custom URL via HTTPS

– One time link that expires when used

• Push via SCP

– Just enter the hostname and auth

method (password or key file)

– The directory to push the data to

Page 35: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Unlimited Restores

• Confidence in your restore process

• Build development, QA, analytics

environments without impacting

production

Page 36: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Fully Managed

• Created by the engineers that build

MongoDB

• No need to write or maintain custom

backup scripts

Page 37: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Getting Started

Page 38: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Getting Started

1. Create an account at

mms.mongodb.com

2. Install MMS Monitoring on your

deployment

3. Register at mms.mongodb.com/backup

4. Install MMS Backup on your deployment

5. Start initial sync

6. Rest easy!

Page 39: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Restore from a point in time snapshot documentation

https://mms.mongodb.com/help/tutorial/restore-from-point-in-time-snapshot/Restore from a stored snapshot https://mms.mongodb.com/help/tutorial/restore-from-snapshot/

Configure your backup data delivery method https://mms.mongodb.com/help/tutorial/restore-select-delivery-format/

All documentation available:http://mms.mongodb.com/help/

Getting Started

Page 40: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

[email protected] for one

month free!

Page 41: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Questions?

Page 42: Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

Senior Solution Architect, MongoDB

Sam Weaver

#MongoDBMagementService

Thank You


Recommended