Domanda

Ho due scopi per questo:

  1. Per avere una copia di backup fuori sede in caso di un ampio problema regione con Amazon Web Services.
  2. Per copiare i dati di produzione da un conto della produzione di fatturazione per un account beta di fatturazione.

Al momento non sembra che Amazon supporta uno di questi due casi d'uso fuori dalla scatola.

ho visto mysqldump e xtrabackup (vedi post ) menzionato.

Ho visto anche un processo più complicato (documentato qui )

  1. Un nuovo server RDS nel conto origine di fatturazione (prod) è filata al largo un backup recente.
  2. Una nuova istanza EC2 è filata up che ha accesso al server RDS nel passaggio 1.
  3. mysqldump è usato per fare un backup di questo database.
  4. Backup viene copiato in un sito remoto (S3?).
  5. In un account e / o regione separata, un server RDS fresca viene fatta girare in su.
  6. dump del database è importata.

Consigli e suggerimenti sono apprezzati.

È stato utile?

Soluzione

The recommended way to back up RDS is with automatic backups and DB snapshots. DB snapshots are basically the same as EBS snapshots, which are stored in S3 behind the scenes, but are only available within the same region.

If you need cross-region fault tolerance (good plan!), there is no way to restore your data in another region without doing it "the hard way" from a mysqldump. Your alternatives are to back up using mysqldump (slow and terrible for any reasonable sized dataset), or set up your own EC2-based slave in another region and back that up using any available method (xtrabackup, EBS snapshots, etc). However, then you are back to managing your own MySQL instances, so you might as well abandon RDS entirely.

For my money, RDS provides absolutely no benefits in really any way and a whole lot of disadvantages in performance, flexibility, and reliability. I would ask yourself what value RDS provides to you.

Altri suggerimenti

I had the same issue. My solution was to write a simple bash script. It is limited to a single region however.

Here's the script in question:

#!/bin/bash
NOWDATE=`date +%Y-%m-%d`
BACKUPNAME="$NOWDATE.sql.gz"

echo "Creating backup of database finances to $BACKUPNAME"
mysqldump –user=user –password=password database_name | gzip -9 > $BACKUPNAME

echo "Succesfully created database backup"

echo "Uploading backup to Amazon S3 bucket…"
s3cmd put $BACKUPNAME s3://path/to/file/$BACKUPNAME

echo "Successfully uploaded backup to S3"

echo "Deleting backup file…"
rm $BACKUPNAME

echo "Done"

AWS RDS now supports cross-region and cross-account copying of snapshots which will allow you to complete your goals simply using RDS.

You still have to use a dump script method to get backups to S3 at this point. The ability to use S3-IA or Glacier would be good in terms of cost savings as RDS backup costs are at S3 Standard or higher (vary by db).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a dba.stackexchange
scroll top