Amazon RDS replica

自作多情 提交于 2019-12-25 06:59:39

问题


I'm currently migrating my servers on Amazon EC2 and RDS and I can't find out how to create a replica of my production DB instance to a development DB instance.

Basically what I would like to do is have a replication occurring everyday or week to be able to work on almost actual data on my development environment.

Of course the multi-AZ option wouldn't work in this context since this is not for fail-over and the replication should only go in one direction (prod -> dev) to prevent any insertion of test data or any loss on the production server.


回答1:


If your database is rather small, you can run the following command from a cron job:

mysqldump --host=<RDS endpoint> --user=<username> --password=<password> mydatabase > | mysql --host=<dev server or dev RDS instance> --user=<username> --password=<password> mydatabase

This will dump the "mydatabase" DB from RDS and pipe it into a "mydatabase" DB on another host. You can't run cron jobs on RDS, so this will have to run on a stand-alone server or EC2 instance.




回答2:


I would check out http://www.skeddly.com/

I know it can do automated RDS snapshots, perhaps you can set up a custom action type to load the snapshots on your Dev RDS instance somehow.



来源:https://stackoverflow.com/questions/11587199/amazon-rds-replica

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!