MMS – Using MMS to Build
New Environments
MMS Technical Account Manager, MongoDB
Peter C. Gravelle
@mongodb
What you are going to get out of today’s
talk
A. What is MMS
A. Monitoring
B. Backup
B. What you can do with MMS Backup
A....
What is MMS?
MMS
MongoDB Management System
What can I do?
Two Deployment Models
Using MongoDB Servers: cloud version
Using my servers: on-premise
Monitoring
What does MMS Monitoring give
you?
• Server metrics
• Activity feed
• Alerts
• Hardware stats (optional)
• User management...
Server Metrics
Cluster View
Activity Feed
Alerts
Logs and Profile data
Hardware stats (CPU, disk)
DB Stats
User Management
MMS Monitoring Setup
Cloud Version
1. Go to http://mms.mongodb.com
2. Create an account
3. Install one agent in your datacenter
4. Add hosts fr...
Backups
MMS Backup
• Backup a replica set or sharded cluster
• Initial sync + incremental
• Generated snapshots every 6 hs
• Resto...
Picking a snapshot to restore
MMS Backup Setup
Cloud Version - Billing
• 12-months pre-paid:
• $50 / GB / year
• 6-hour interval snapshot stored for two days
• Weekly sn...
Cloud Version - Billing
• Pay as you go
• Oplog processing: $1 / GB / month
• Snapshot storage: $0.08 / GB / month
• Custo...
What kind of environments
can you create with MMS
Backup?
What kind of environments can you
create?
• Spin up a new secondary quicker at minimal
additional load
• Build a sandbox f...
Spin up a secondary quickly
Using Backup Snapshots to Spin Up
Secondaries
Spinning up secondaries can take a long time if the
data size is large.
You ...
Spinning up secondary overview
1. Prepare your new environment
2. Get your restore files
3. Extract the restores
4. Make i...
Preparing to spin up the secondary
Make sure you have room for your snapshot
More preparation
Ensure that you have enough oplog window to
prevent an initial sync. Remember you have to
download the sn...
Spinning up secondary overview
1. Prepare your new environment
2. Get your restore files
3. Extract the restores
4. Make i...
Start the download
Choose HTTPS or SCP
Spinning up secondary overview
1. Prepare your new environment
2. Get your restore files
3. Extract the restores
4. Make i...
Extract Image and Start mongod
tar –xvf backup-restore-file-name.tar.gz
mv backup-restore-file-name data
mongod --port POR...
Spinning up secondary overview
1. Prepare your new environment
2. Get your restore files
3. Extract the restores
4. Make i...
Seed the standalone as a secondary
Run seedSecondary.sh with its appropriate options to
create the oplog collection with t...
Start up the secondary with the seeded
oplog
mongod --port=PORT --dbpath=data --logpath=data/mongodb.log --
replSet=REPLIC...
Connect the new secondary
On the primary, connect a mongo shell and run:
rs.add(“NEWSECONDARY:PORT”)
Where NEWSECONDARY is...
Lets build a sandbox!
Analytics, am I right?!
The analytics people can be a bane to ops. Why?
• They want to do big queries
• They want to do sl...
Developers, Developers,
Developers!
They also want to disrupt your nicely running system
• Try new schemas
• Change applic...
So build them a sandbox!
They can have their own (non-customer-impacting)
DB off of your most recent snapshot.
• Keeps the...
How to build a sandbox
1. Get your restore files
2. Extract them
3. Set up sharding
Get your Restore files
The same rules apply:
• Make sure you have the space
• Choose push or pull (SCP/HTTPS)
• Pick the s...
How to build a sandbox
1. Get your restore files
2. Extract them
3. Set up sharding
Extract your snapshot
tar –xvf backup-restore-file-name.tar.gz
mv backup-restore-file-name data
mongod --port PORT --dbpat...
How to build a sandbox
1. Get your restore files
2. Extract them
3. Set up sharding
Sharding Step 1
Bring up the config server
tar –xvf backup-restore-file-name.tar.gz
mv backup-restore-file-name data
mongo...
Sharding step 2
Update the shard metadata: Remember, you have a
new environment here, new hosts & ports!
mongo --port=CONF...
What you got out of today’s talk
A. What is MMS
A. Monitoring
B. Backup
B. What you can do with MMS Backup
A. Spin up seco...
Thank You
MMS Technical Account Manager, MongoDB
Peter C. Gravelle
@mongodb
Upcoming SlideShare
Loading in …5
×

Using MMS to Build New Environments

6,201 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,201
On SlideShare
0
From Embeds
0
Number of Embeds
5,642
Actions
Shares
0
Downloads
17
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Using MMS to Build New Environments

  1. 1. MMS – Using MMS to Build New Environments MMS Technical Account Manager, MongoDB Peter C. Gravelle @mongodb
  2. 2. What you are going to get out of today’s talk A. What is MMS A. Monitoring B. Backup B. What you can do with MMS Backup A. Spin up secondaries with minimal impact on your primary B. Build a sandbox for development or analytics to play in
  3. 3. What is MMS?
  4. 4. MMS MongoDB Management System
  5. 5. What can I do?
  6. 6. Two Deployment Models Using MongoDB Servers: cloud version Using my servers: on-premise
  7. 7. Monitoring
  8. 8. What does MMS Monitoring give you? • Server metrics • Activity feed • Alerts • Hardware stats (optional) • User management • Logs and profiling data
  9. 9. Server Metrics
  10. 10. Cluster View
  11. 11. Activity Feed
  12. 12. Alerts
  13. 13. Logs and Profile data
  14. 14. Hardware stats (CPU, disk)
  15. 15. DB Stats
  16. 16. User Management
  17. 17. MMS Monitoring Setup
  18. 18. Cloud Version 1. Go to http://mms.mongodb.com 2. Create an account 3. Install one agent in your datacenter 4. Add hosts from the web interface 5. Enjoy!
  19. 19. Backups
  20. 20. MMS Backup • Backup a replica set or sharded cluster • Initial sync + incremental • Generated snapshots every 6 hs • Restore via HTTPS or SCP • Restore replica sets to point-in-time (last 24hs) • Restore sharded clusters to any 15 minute (last 24hs)
  21. 21. Picking a snapshot to restore
  22. 22. MMS Backup Setup
  23. 23. Cloud Version - Billing • 12-months pre-paid: • $50 / GB / year • 6-hour interval snapshot stored for two days • Weekly snapshots stored for 1 month • Monthly snapshots stored for 1 year • Payment method: invoiced
  24. 24. Cloud Version - Billing • Pay as you go • Oplog processing: $1 / GB / month • Snapshot storage: $0.08 / GB / month • Customer defines snapshot frequency and retention policy • Payment method: online
  25. 25. What kind of environments can you create with MMS Backup?
  26. 26. What kind of environments can you create? • Spin up a new secondary quicker at minimal additional load • Build a sandbox for analytics or developers
  27. 27. Spin up a secondary quickly
  28. 28. Using Backup Snapshots to Spin Up Secondaries Spinning up secondaries can take a long time if the data size is large. You can make your own data file snapshots by taking down a secondary and copying it off. But why? MMS Backup has your data files already!
  29. 29. Spinning up secondary overview 1. Prepare your new environment 2. Get your restore files 3. Extract the restores 4. Make it a secondary
  30. 30. Preparing to spin up the secondary Make sure you have room for your snapshot
  31. 31. More preparation Ensure that you have enough oplog window to prevent an initial sync. Remember you have to download the snapshot and startup a mongod process.
  32. 32. Spinning up secondary overview 1. Prepare your new environment 2. Get your restore files 3. Extract the restores 4. Make it a secondary
  33. 33. Start the download Choose HTTPS or SCP
  34. 34. Spinning up secondary overview 1. Prepare your new environment 2. Get your restore files 3. Extract the restores 4. Make it a secondary
  35. 35. Extract Image and Start mongod tar –xvf backup-restore-file-name.tar.gz mv backup-restore-file-name data mongod --port PORT --dbpath data --logpath=data/monogdb.log This brings up your data in a standalone.
  36. 36. Spinning up secondary overview 1. Prepare your new environment 2. Get your restore files 3. Extract the restores 4. Make it a secondary
  37. 37. Seed the standalone as a secondary Run seedSecondary.sh with its appropriate options to create the oplog collection with the correct timestamp. Shut down the mongod process when this is complete
  38. 38. Start up the secondary with the seeded oplog mongod --port=PORT --dbpath=data --logpath=data/mongodb.log -- replSet=REPLICASETNAME This PORT can be different than the other mongod process you started. The REPLICASETNAME should be the same as the name of the replica set that you will be connecting it back to.
  39. 39. Connect the new secondary On the primary, connect a mongo shell and run: rs.add(“NEWSECONDARY:PORT”) Where NEWSECONDARY is the hostname of the secondary you just spun up, and PORT is the port defined in the previous examples. Now, just wait for rs.status() for the NEWSECONDARY to report that it’s in status SECONDARY. (Or check MMS!)
  40. 40. Lets build a sandbox!
  41. 41. Analytics, am I right?! The analytics people can be a bane to ops. Why? • They want to do big queries • They want to do slow queries • Their queries are just infrequent enough to not justify building indexes for them • Never mind the performance penalty for each index
  42. 42. Developers, Developers, Developers! They also want to disrupt your nicely running system • Try new schemas • Change application server behavior • Stress test things
  43. 43. So build them a sandbox! They can have their own (non-customer-impacting) DB off of your most recent snapshot. • Keeps them off the production servers • Lets them process the data as they wish • New collections with generated data • Lets them try new methods and applications
  44. 44. How to build a sandbox 1. Get your restore files 2. Extract them 3. Set up sharding
  45. 45. Get your Restore files The same rules apply: • Make sure you have the space • Choose push or pull (SCP/HTTPS) • Pick the snapshot you want • Wait for the download to complete
  46. 46. How to build a sandbox 1. Get your restore files 2. Extract them 3. Set up sharding
  47. 47. Extract your snapshot tar –xvf backup-restore-file-name.tar.gz mv backup-restore-file-name data mongod --port PORT --dbpath data --logpath=data/monogdb.log This brings up your data in a standalone. You can stop here (unless you’re sharding).
  48. 48. How to build a sandbox 1. Get your restore files 2. Extract them 3. Set up sharding
  49. 49. Sharding Step 1 Bring up the config server tar –xvf backup-restore-file-name.tar.gz mv backup-restore-file-name data mongod --port=CONFIGSRVRPORT --dbpath=data --logpath=data/mongodb.log -- configsvr=true
  50. 50. Sharding step 2 Update the shard metadata: Remember, you have a new environment here, new hosts & ports! mongo --port=CONFIGSRVRPORT use config db.shards.find().pretty() Repeat if you’re setting up multiple config servers, but this is not necessary for this non-production environment. Remember, this only tells you what you need to update!
  51. 51. What you got out of today’s talk A. What is MMS A. Monitoring B. Backup B. What you can do with MMS Backup A. Spin up secondaries with minimal impact on your primary B. Build a sandbox for development or analytics to play in
  52. 52. Thank You MMS Technical Account Manager, MongoDB Peter C. Gravelle @mongodb

×