Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Using MMS to Build New Environments

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

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!

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.
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.
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!)

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

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.
How to build a sandbox
1. Get your restore files
2. Extract them
3. Set up sharding

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.
How to build a sandbox
1. Get your restore files
2. Extract them
3. Set up sharding

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.
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