Comprehensive data protection for all workloads
Post Reply
vdgvince
Novice
Posts: 4
Liked: never
Joined: Jan 01, 2015 8:51 pm
Full Name: Vincent Vandegans
Location: Belgium
Contact:

Mongo backup

Post by vdgvince »

Hello,

I have veeam installed on a VMWare infrastructure.
On this infra, i have a couple of MongoDB VM running.

Veeam backups them easily... BUT... when i tried to recover them, mongo can't restart.
There are lock files from mongo (probably because our system was still writing to the DB at the moment of the backup).
These locks force mongo to do a repair, but the repair requires the double of extra disk space, and takes a while.

What is your suggestion to do a hot backup of mongoDB ?
Is it possible to execute a script on the linux machine before starting the backup, and the same when the backup is done?

thanks,
vincent
Gostev
Chief Product Officer
Posts: 31521
Liked: 6699 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Mongo backup

Post by Gostev »

vdgvince wrote:Is it possible to execute a script on the linux machine before starting the backup, and the same when the backup is done?
Sure, B&R v8 does provide this ability to you (and this feature was designed specifically to address scenarios where application-specific backup logic is required).
marcinbojko
Enthusiast
Posts: 40
Liked: 12 times
Joined: Mar 06, 2014 10:40 am
Full Name: Marcin Bojko
Location: Lublin/Poland
Contact:

Re: Mongo backup

Post by marcinbojko »

@vdgvince
We have successfuly implemented Veeam to do a MongoDB backup. MongoBS works fine with crash-consistent backups, so after restoring the only thing you will have to do is to delete lock files stored with (you were corrected) running MongoDB. After that MongoDB works fine ;)
vdgvince
Novice
Posts: 4
Liked: never
Joined: Jan 01, 2015 8:51 pm
Full Name: Vincent Vandegans
Location: Belgium
Contact:

Re: Mongo backup

Post by vdgvince »

thanks for letting me know.
during your backup with veeam, do you use scripts before/after the backup or is VEEAM 8 able to manage the write locks now?
dellock6
VeeaMVP
Posts: 6139
Liked: 1932 times
Joined: Jul 26, 2009 3:39 pm
Full Name: Luca Dell'Oca
Location: Varese, Italy
Contact:

Re: Mongo backup

Post by dellock6 » 1 person likes this post

Reading at Marcin answer about "crash consistency" seems he didn't used any script or quiescence, just the regular VM snapshot before backups.
Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software

@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
vdgvince
Novice
Posts: 4
Liked: never
Joined: Jan 01, 2015 8:51 pm
Full Name: Vincent Vandegans
Location: Belgium
Contact:

Re: Mongo backup

Post by vdgvince »

ok, thank you.
We just did the update of VEEAM 8 and VEEAM ONE yesterday.
marcinbojko
Enthusiast
Posts: 40
Liked: 12 times
Joined: Mar 06, 2014 10:40 am
Full Name: Marcin Bojko
Location: Lublin/Poland
Contact:

Re: Mongo backup

Post by marcinbojko »

Luca is right, we didn't use any script before and after. And so far, our developers tested restored databases - this trick with 'lock' is provided by them.
vdgvince
Novice
Posts: 4
Liked: never
Joined: Jan 01, 2015 8:51 pm
Full Name: Vincent Vandegans
Location: Belgium
Contact:

Re: Mongo backup

Post by vdgvince »

i have again issue with backuping mongo. Back in time, i forgot to ask you which version on mongo you are running on?

thanks
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Mongo backup

Post by tdewin » 2 people like this post

Seems that mongodb does support this kind of backup. You need to enable journaling:
http://docs.mongodb.org/manual/tutorial ... snapshots/
An lvm snapshot is nearly the same as a vm snapshot

It even says that you need to remove the locks
The restored snapshot will have a stale mongod.lock file. If you do not remove this file from the snapshot, and MongoDB may assume that the stale lock file indicates an unclean shutdown
You could also write a script that syncs the db so you don't get the lock files (apparently there is a method db.fsyncLock() db.fsyncUnlock()). However it seems that your pre script will have to execute both commands because they need to be handle by one session. I think we have somewhere a mysql webinar that has the same kind of logic where the prescript waits for the postscript to remove a self made lock file, and then executes the unlock
http://docs.mongodb.org/manual/referenc ... .fsyncLock

But by any means, I'm not a mongodb guy, I was just curious and took a look at the doc

Finally, you can also test your backups with Surebackup, to test if they are recoverable.
Yuya
Enthusiast
Posts: 81
Liked: 2 times
Joined: Jan 30, 2013 9:32 am
Contact:

[MERGED] MongoDB backup quiesce scripts

Post by Yuya »

We have MongoDB on our physical machine.
We want to backup this using Veeam Agent.
We think that a pre/post script is required to get the quiesce.

Could you please advice us?
If you have a sample script, we want it.

Thanks,
Yuya
wishr
Veteran
Posts: 3077
Liked: 453 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: MongoDB backup quiesce scripts

Post by wishr »

Hi Yuya,

I'm merging your topic with an existing thread. Please take a look.

Thanks
lokeshselvam
Novice
Posts: 5
Liked: never
Joined: Nov 20, 2021 12:02 pm
Contact:

[MERGED] Does Veeam Backup and replication supports backing up Mango db databases?

Post by lokeshselvam »

Hi all experts,

I am having a doubt regarding the Veeam supported DB applications

Does Veeam Backup and replication supports backing up mango DB databases.(The Mango DB database is a VM in ESXi).


And what are the supported database applications does Veeam support to take backup?


Thanks in advance.
Mildur
Product Manager
Posts: 8662
Liked: 2273 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Does Veeam Backup and replication supports backing up Mango db databases?

Post by Mildur »

Hi Lokesh

There are two possibilities to backup applications with Veeam. VM Backup Jobs and Agent Backup Jobs.

Supported Applications by VM Backup Jobs
AD
Exchange
Sharepoint
SQL Server
Oracle on Windows
Oracle on Linux
Supported Applications by Veeam Agent for Windows Backup Jobs
AD
Exchange
Sharepoint
SQL Server
Oracle
Supported Applications by Veeam Agent for Linux Backup Jobs
Oracle
MySQL
PostgreSQL

When you are talking about Mango DB, would that be a MongoDB? Veeam doesn't have a MongoDB integration.
What you can do, is to leverage prefreeze scripts to bring your database in a consistent state before the backup of the machine is starting. For example, you can stop the database service, or export a dump from the database to a local disk, which veeam then can backup for you.

Topic about MongoDB Backup
Product Management Analyst @ Veeam Software
HannesK
Product Manager
Posts: 14314
Liked: 2888 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: Mongo backup

Post by HannesK » 1 person likes this post

Hello,
I assume MongoDB was meant and merged it to the existing Mongo DB thread :-)

Best regards,
Hannes
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 71 guests