Amazon EC2 postgresql backups: snapshot of a data directory or pg_dump on an EBS that is decreasing sequentially?

I have a postgresql database on amazon EC2 and you need to determine the best way to back up this data. I am considering two options:

(1) Install the EBS volume in a directory, such as / pgsqldata, and use this directory as the postgresql data directory (on Amazon Linux, / var / lib / pgsql / data / is used by default). Then this volume will receive frequent snapshots.

or

(2) Store the postgresql data directory in it by default. Then use pg_dump to often delete backups to a place like / pgsqldumps, and this volume will get a snapshot after each pg_dump.

The third option is just a snapshot of the volume of the root device (I use an instance with EBS support), since in my case it is both a web server and a database. I like the idea of ​​having a dedicated volume for data backup.

Finally, if I take direct snapshots in the real postgresql data directory, do I need to worry about possible changes to the database during the snapshot process?

thank

+5
source share
1 answer

In any case, you should move the volume to your own EBS volume, this helps with the competition in writing to EBS volumes, as well as with other advantages. In addition, I have magazines recording their own volume and vice versa.

, . EBS . , dev ( PII ), , . 5 , S3 , , EBS, .

- script, , , .

+4

All Articles