I'm running Mongodb on AWS EC2 instance. Data/log/and journal are stored in a separate volume, formatted as xfs. Currently we are stopping the mongodb instance to take a snapshot, but reading this: https://docs.mongodb.com/ecosystem/tutorial/backup-and-restore-mongodb-on-amazon-ec2/ apparently there is no need to stop the service during the snapshot since journal is enabled. Am I correct? Can I create consistent snapshot even if the service is running?
In general, do not trust any backup procedure until you have confirmed the integrity of a restore from long term media.
You already have the capability to take a storage system layer backup online. In this case, with EBS volumes or Linux LVM. The problem is getting the database in a consistent state.
An online backup is possible with or without journal. In either case, mongo's way to suspend database writes is fsync and lock, as described in that tutorial.
Without a journal, it is difficult to tell what data is durable on disk and what is buffered and not yet committed. fsync and lock establishes a point in time, and stops any more in progress writes until the backup is done.
The lock is also needed with multiple disks, where (on this storage system) the snapshots are not consistent with each other. Suspending writes for the duration of the backup means that disk
/dev/sdf will not be at a slightly different point of time compared to
Mongo claims that if you only have a single disk, and have a journal, you don't need to fsync and lock. Presumably, the EBS snapshot is a good enough crash-consistent point in time, and journal forward recovery can fix up any incomplete writes.