Protecting MongoDB with HPE Recovery Manager Central

Protecting MongoDB with HPE Recovery Manager Central


Hi and welcome to this video on
how you can protect your MongoDB database instances using HPE’s
Recovery Manager Central. RMC’s snapshot based data protection provides
near instantaneous backups of data stored on HPE’s Primera, 3PAR and Nimble Storage systems,
and we’re gonna show you how you can apply this technology to protecting your
MongoDB environment. The solution for using RMC to protect
MongoDB instances involves creating scripts that make use of the MongoDB
API and command line, as well as the API from RMC to initiate snapshots of
the volumes presented from Primera, 3PAR, or Nimble arrays that house the MongoDB
data. So you can protect just the primary node data or all the volumes
on all the nodes of your ReplicaSet or Sharded cluster, however you want
to do it. You can create application consistent snapshots where the rights
are stopped just prior to taking the snaps, or crash-consistent where
the rights of left online. Just depends on your level of comfort. You
can recover the entire instance or individual collections using the snaps and MongoDB
tools, which we’ll show you how to do in a quick demo in just a minute. Using
RMC snaps also allows users to be able to integrate HPE StoreOnce backup
systems and Cloud Bank Storage to enable the 321 principle of data
protection, which requires three copies of the data on two different storage
technologies, with one copy off site. This principle ensures data recovery
even in the case of a complete site failure. And most importantly, these backups and
recoveries can be done very, very quickly so you can get back to business
as fast as possible. So, as promised, let’s show you a quick demo that shows
how all this might work. The configuration for this demo will
include several ProLiant servers hosting MongoDB and receiving
storage across a Fibre Channel SAN from a Nimble AF 1000 array. This solution
could also work with a nice cosy SAN as well. A Recovery Manager Central VM will be
deployed to manage the snapshot processes. As we discussed earlier,
this solution could also involve Sharded clusters, StoreOnce and/or
Cloud Bank Storage, but we’ll keep things simple for this exercise. So we are logged into the primary node
of our three node MongoDB replica set, and you see the list of databases that
we have here. We’re going to use the capitals database for this demo. Okay,
so in the capitals database, we have one collection and it is entitled
european. And in the european collection, we have these three
documents, as you see here. So what we’re gonna do is we’re gonna
accidentally delete this collection and then use the snapshots that we’ve
already created of this database using RMC to recover it. By issuing this command, we will
remove the collection and it’s gone. So now we’re gonna use RMC to recover it. All right, now we’re within the RMC GUI.
You can see here we have a mongodemoset volume set that houses is all three
of the volumes presented from our Nimble array to the members of the replica
set that hosts our MongoDB instance. We’ve taken a couple of snapshots
of that volume set and we’ve also created a clone of that volume set
from the most recent snapshot. How we did that was clicking on the clone
restore and selected the Virtual clone from an existing copy option.
What we’re gonna do with this clone is present it to a standalone MongoDB
instance that we’ve created just to recover this collection. When we
present that clone, we’ll then bring up MongoDB using the clone data, and then we can go in and issue
commands using MongoDB tools to extract the collection we need to
recover and then import it into the production database. To perform the recovery, we only really
need to mount the clone of the primary node from our MongoDB instance. But
if you take a look at the details on the clones, you’ll see down here that there’s
nothing that really tells you which clone volume belongs to which node.
So we’re gonna have to go into the Nimble GUI to figure this out. Now we’ve switched over to the
Nimble GUI, and we’re gonna have to take a look at those clones that we created to figure
out which one is actually from the primary node. Now I’m gonna cheat.
I know that this is actually the one, but just to show you how you can see
that, we go into the configuration section for this clone, we see the
parent volume is mongodemo1. So mongodemo1 is our primary node
for our instance. So this is the one that we need to present. So we have actually
already done this. We’ve presented this to our standalone MongoDB instance
that we’re going to use for recovery. So now, we will go over there and show you
what you need to do to get the data out. So, this is the process we’re going to do?
We’re gonna mount the clone onto the directory in the stand alone MongoDB instance
where MongoDB expects to find its data. Then we’re gonna bring up the database,
and then we’re gonna issue these commands. mongoexport will output that
collection that we need to recover to a JSON file. JSON is the format
that MongoDB expects to see our storage’s data in, and that’s what
it’s going to expect to see. mongoimport will be used to take that
JSON file, copy it over to the production node, and import it into
the proper database. Okay, now we’re over here on mongodemo4,
we’ve logged into it and we have mounted that clone into the
/var/lib/mongo directory where MongoDB expects to find its data.
We’ve started up the database, and then we’ve executed the mongoexport command
to output the collection to this JSON file. We have just run the mongoimport command
to copy this JSON file over to mongodemo1 and import it into the production
database, which we have just completed as you see right here. And now, if we
go over to the mongodemo 1 window, we see that we had removed it previously, and now we’ve run the command. The european collection is back and the
records are back within that collection. So we have successfully recovered an individual
collection out of a MongoDB database using snapshots created by RMC. For more information on the HPE storage
products included in this solution, please check the links shown here.
Thank you very much for watching.

Leave a Reply

Your email address will not be published. Required fields are marked *