automate mongodb with mongodb management service

27
MongoDB Management Service Engineering Team, MongoDB Cailin Nelson, Cadran Cowansage, Louisa Berger, Bard Bloom, Tim Olsen #MongoDBWorld Automate MongoDB with MMS

Upload: mongodb

Post on 08-Sep-2014

488 views

Category:

Technology


2 download

DESCRIPTION

MongoDB Management Service makes operations effortless, reducing complicated tasks to a single click. You can now provision machines, configure replica sets and sharded clusters, and upgrade your MongoDB deployment all through the MMS interface. This session will introduce you to the engineering team at MongoDB building the automation functionality in MMS. We'll walk through demos of all the new MMS features, including provisioning, expanding and contracting a cluster, resizing the oplog, and managing users.

TRANSCRIPT

Page 1: Automate MongoDB with MongoDB Management Service

MongoDB Management Service Engineering Team, MongoDB

Cailin Nelson, Cadran Cowansage, Louisa Berger, Bard Bloom, Tim Olsen

#MongoDBWorld

Automate MongoDB with MMS

Page 2: Automate MongoDB with MongoDB Management Service

MMS: MongoDB Management Service

Page 3: Automate MongoDB with MongoDB Management Service

MMS Automation: What Does It Do?

● Create MongoDB systems of any size, and any configuration

● Manage MongoDB systems, such as adding capacity or resizing the oplog, with no application downtime

● Upgrade a deployment, with no application downtime

… all from the comfort of your web browser.

Page 4: Automate MongoDB with MongoDB Management Service

MMS Automation…. And MMS Provisioning Too

For extra fun, we’ve also added an Amazon AWS

integration which allows you to provision the servers

on which your MongoDB processes will run, directly

from MMS.

● Optional component - you can provision your base servers any way you

like, doing it via MMS Provisioning is just one way

● Future plans to integrate OpenStack, VMWare, etc.

Page 5: Automate MongoDB with MongoDB Management Service

MMS Automation: Why?

● Ease of operation● Expect the unexpected

Page 6: Automate MongoDB with MongoDB Management Service

About This Talk...

● Series of demos● Questions at the end

Page 7: Automate MongoDB with MongoDB Management Service

MMS Provisioning on AWS… from 0 to Sharded Cluster in 8 minutes or less

Page 8: Automate MongoDB with MongoDB Management Service

Raising Your Cluster Right… MongoDB management the easy way

Page 9: Automate MongoDB with MongoDB Management Service

Upgrading a Cluster Manually 1. Run db.upgradeCheckAllDBs() to check data set for compatibility2. Resolve any incompatibilites in your deployment3. Upgrade authentication model 4. Download mongoDB binaries for 2.65. Disable the balancer6. Upgrade the cluster’s meta data7. Wait for each mongos to exit on completion8. Upgrade each mongos process, one at a time9. Upgrade each config server, one at a time, with the first one upgraded last.10. Upgrade each shard, one at a time :

a. Upgrade secondaries, one at a time:i. Shut down the mongodii. Replace the 2.4 binary with the 2.6 binaryiii. Restart mongodiv. Wait for member to recover to SECONDARY state

b. Step down the primary c. Wait for another member to be elected to PRIMARYd. Upgrade previous primary

11. turn back on the balancer

Page 10: Automate MongoDB with MongoDB Management Service

Now, using Automation

Page 11: Automate MongoDB with MongoDB Management Service

How does it work?

Page 12: Automate MongoDB with MongoDB Management Service

Automation ≈ Self-Driving Car

● Tell it where you want to go.o It goes there

● If you steer manually?o It reroutes and goes toward your destination

● Bridge out?o It reroutes and goes toward your destination

● Want to go somewhere else?o It reroutes and goes toward your new destination

Page 13: Automate MongoDB with MongoDB Management Service

Architecture Introduction

● One agent per

machine● Agent talks to:

o MMS instructions

o Mongo sense control

● No agent-agent● Single executable

MMS

MongoD

MongoS

Config Server

Auto. Agent

MongoD

MongoS

Config Server

Auto. Agent

Page 14: Automate MongoDB with MongoDB Management Service

Automation Cycle

Get Instructions

Inspect Cluster

Adjust Cluster

Sleep 30 sec

Page 15: Automate MongoDB with MongoDB Management Service

Desired State?

You tell Automation what you want.Automation makes that happen.

Desired State ≈ Self-driving car’s destination.

Page 16: Automate MongoDB with MongoDB Management Service

What Automation Knows

1.What you want a. from MMS

2.What’s actually on the clustera. from inspecting the cluster

3.How to do various thingsa. Like “start Mongod” or “init replica set”b. from MongoDB documentationc. preconditions: what has to be true before.d. postconditions: what should be true after.

Page 17: Automate MongoDB with MongoDB Management Service

Planning

● Look at what you want vs. what you have● If they’re the same, yay!

o Check again in 30 seconds● Else, make a plan to fix what you have

o Basic robotics-style planning problemo precondition/postcondition make this work.

Page 18: Automate MongoDB with MongoDB Management Service

Executing Plans

● Follow the plan, one move at a time.● Each move has a bunch of actions● Check expected vs. reality for each action

o Check preconditions before doing an actiono Check postconditions afterwardso If they’re different, go make a new plan!

● How could they be different?o machine crasho killing/modifying a mongo instance by hand

Page 19: Automate MongoDB with MongoDB Management Service

Automation

● Instructions from you● Information from your cluster● Expertise about how to run Mongo● Patience to get all the details right

Page 20: Automate MongoDB with MongoDB Management Service

Advanced OperationsOplog Resizing

Page 21: Automate MongoDB with MongoDB Management Service

What is an oplog?

● A capped collection that stores an ordered history of logical writes to a MongoDB database

● Enables replication

Page 22: Automate MongoDB with MongoDB Management Service

Why resize the oplog?

1.You may want to increase its size to accommodate a high write rate and/or high replication lags to secondaries.

2.You may want to decrease its size to save on disk space.

Page 23: Automate MongoDB with MongoDB Management Service

Resizing the Oplog with Automation

Page 24: Automate MongoDB with MongoDB Management Service

How to resize an oplog

1. Shutdown a replica set member2. Start the member in standalone mode, listening on a different

port than it usually does3. Back up the last oplog entry4. Drop the oplog5. Recreate the oplog with its new size6. Insert the saved oplog entry7. Stop the member8. Start the member with normal options9. Repeat Steps 1 - 8 for each of the remaining replica set members

Page 25: Automate MongoDB with MongoDB Management Service

Or just have Automation do it

Page 26: Automate MongoDB with MongoDB Management Service

Automating MMS

Page 27: Automate MongoDB with MongoDB Management Service

MongoDB Management Service Engineering Team, MongoDB

Cailin Nelson, Cadran Cowansage, Louisa Berger, Bard Bloom, Tim Olsen

#MongoDBWorld

Questions