亚马逊RDS副本 [英] Amazon RDS replica

查看:237
本文介绍了亚马逊RDS副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在迁移我的服务器在Amazon EC2和RDS,我无法找出如何创建我的生产数据库实例的副本到开发数据库实例。

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.

当然多AZ方案不会在这方面的工作,因为这不是为故障转移和复制应该只在一个方向(刺 - >发展)到prevent测试数据的任何插入在生产服务器上或任何损失。

Off 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.

感谢您的帮助。

推荐答案

如果你的数据库是相当小的,你可以从cron作业中运行以下命令:

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

mysqldump的主机=< RDS端点> --user =<用户名> --password =<密码> MyDatabase的> | MySQL的主机=<开发服务器或开发RDS实例> --user =<用户名> --password =<密码> MyDatabase的

这将倾MyDatabase的DB从RDS和管道将它导入了MyDatabase的DB另一台主机上。你不能运行RDS cron作业,所以这将有一个独立的服务器或EC2实例上运行。

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.

这篇关于亚马逊RDS副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆