Logwriter here! How are you?
Here we go to Part 3 of MongoDB Deployment Tips on NetApp AFF Systems. At this part I’m going to show you how to restore your entire mongoDB replica set using NetApp Snap Creator Framework.
It’s a beautiful summer day, you’re at your desk playing with MongoDB Compass querying your database when all of sudden your connection to the database hangs and you’re trying to understand what is happening.
Your entire ReplicaSet is gone… and your manager is probably going like this:
Luckily your database is running on a NetApp AFF System and it takes a snapshot each 15 min with a retention policy of 48 snapshots, which gives you 12 hours of snapshots to look back in the past if you need it. Of course I just put some numbers here, because the number of snapshots available to restore will completely depend on your RPO needs. In this example, your RPO would be 15 min.
After take a deep breath and ask your manager to calm down, you log in to your Snap Creator Framework and starts a restore operation following steps 1 through 3 as indicated by Figure 1.
After you click on “Restore” you will see a screen asking you 5 questions. All questions are listed on Figure 2. Basically, Snap Creator wants to know what volumes do you want to restore, which kind of restore you want to execute and which snapshot you want to use for restore.
Restore type, can be “Volume Restore” where all volume’s content will be reverted to the state as it was when the snapshot was taken. Or it can be “Single File Restore” where you can choose which files/LUNs you want get reverted to the state as it was when the snapshot was taken.
I’m going with “Volume Restore” because my entire ReplicaSet is gone, so I want to revert all my servers to the same point in time.
Then you click “next” and you will see a summary screen as shown by Figure 3.
After click “Finish” I have only volume mdb_ntap1_01 as part of the restore job. Snap Creator will ask you if you want to add more volumes to this restore job as shown by Figure 4.
Clicking “Yes” and add all volumes that are part of your mongoDB replicaset. In my case here, I have volumes from mdb_ntap1_01 through mdb_ntap1_08, plus the arbiter’s volume mdb_ntap1_arbiter. After you’ve added all your volumes, click “no” and Snap Creator will show you a list of volumes that will be restored by this restore job as shown by Figure 5.
Then you click “Ok” and after a few seconds your entire ReplicaSet is restored.
You are ready to rescan your LUNs if you will be using the same set of servers to bring your ReplicaSet up or if they were blown up like the gif in the beginning of this post, you can map your LUNs to another set of servers and then bring your Replica Set up and running.
I would like to highlight that the restore process took 25 seconds as you can see at Figure 7 and 8.
Figure 9 shows the database size.
So, my ReplicaSet is composed of 1 primary, 1 secondary and 1 arbiter. It means that if my database size is 1TB, the total data restored by Snap Creator was 2TB at 25 seconds. Pretty fast, BOOYAH!!
Please let me know if you have any questions and see you next post.
Thanks for reading it.