在AWS RDS实例之间移动数据 [英] Move data between AWS RDS instances

查看:196
本文介绍了在AWS RDS实例之间移动数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在两个不同的rds实例上的相同mysql数据库之间移动数百万行.我想到的方法是这样的:

I need to move millions of rows between identical mysql db's on two different rds instances. The approach I thought about is this:

- use data-pipeline to export data from the first instance to amazon-s3
- use data-pipeline to import data from amazon-s3 to the second instance

我的问题是,我需要在最后删除第一个实例上的数据.由于我们正在谈论大量数据,因此我考虑过创建一个存储过程来批量删除行.有没有办法在AWS中实现这一目标?还是有其他解决方案?

My problem is that I need to delete the data on the first instance at the end. Since we're talking about huge amounts of data I thought about creating a stored procedure to delete the rows in batches. Is there a way to achieve that in aws? Or are there any other solutions?

另一件事是,我只需要移动特定表中的某些行,而不是整个表或整个数据库.

One other thing is that i need only to move some rows from a specific table, not the whole table or the whole database.

推荐答案

您可以使用 AWS DMS服务,这是移动大量数据的最简单方法.请按照以下步骤操作.

You can use AWS DMS service which is the easiest method to move the huge amount of data. Please follow the below steps.

首先,您需要在两个RDS实例的 参数组 中更改某些设置.

First, you need to change some settings in Parameter group on both RDS instances.

'log_bin' = 'ON'

'binlog_format' = 'ROW'

'binlog_checksum' = 'NONE'

'log_bin_use_v1_row_events' = 'ON'

  1. 从第一个RDS实例中提取数据库模式.

  1. Take a dump of the database's schema from the first RDS instance.

将其恢复到第二个RDS.

Restore it on the second RDS.

现在开始配置DMS.

首先设置端点.

然后创建一个任务,以将数据从Source(第一个RDS)导入到 目的地(第二个RDS).

Then create a task to import data from Source(first RDS) to Destination(second RDS).

在迁移类型中,如果要加载现有数据,请选择 迁移现有数据,或者如果您尝试同步实时数据,则 选择正在进行的更改.

In the migration type, if you want to load existing data choose to Migrate existing data or if you trying to sync real time data then select ongoing changes.

在任务设置下,选择T arget表准备模式= Do 没什么.

Under task setting, select Target table preparation mode = Do nothing.

选中启用日志记录复选框,它将在任何情况下帮助调试 错误.

Check Enable logging check box it'll help to debug in case of any errors.

启动任务后,您可以在 仪表板.

Once the task is started you can able to see the process in the dashboard.

这篇关于在AWS RDS实例之间移动数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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