Ofer Velich
Ofer Velich

Reputation: 2099

Snapshot a mongodb instance with multiple EBS volumes

I have launched an mongodb instance from a preconfigured mongodb AWS marketplace AMI (MongoDB 2.6.4 4000 IOPS).

The AMI consist of three EBS volumes. 1. logs volume,

  1. data volume,

  2. and a journal volume

I wish to run snapshots in order to backup my database. From what i have read in docs:

Snapshotting with the journal is only possible if the journal resides on the same volume as the data files, so that one snapshot operation captures the journal state and data file state atomically.

I'm wondering, if i can run snapshots in the current AMI configuration, were the journal EBS volume is separated from the data volume

Thanks

Upvotes: 0

Views: 525

Answers (1)

Dheeraj Kumar Aggarwal
Dheeraj Kumar Aggarwal

Reputation: 642

Backing up if journal and dbpath are on separate EBS volumes

If your /journal directory is on a different EBS volume from your dbpath, the only way to get a consistent backup would be to use db.fsyncLock() to ensure there are no pending write operations. The fsyncLock() command has the side effect of blocking all writes to your database.

After db.fsyncLock() command, you have to take a snapshots of both journal and data volumes separately.

Upvotes: 2

Related Questions