如何将文件从一个EBS复制到另一个EBS [英] How to Copy files from one EBS to Another EBS

查看:92
本文介绍了如何将文件从一个EBS复制到另一个EBS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题很简单.

我需要将文件从一个EBS复制到另一个,而不将文件通过本地计算机.这可能吗?如果可以,怎么办?

I need to copy the files from one EBS to Another without passing the files through my local machine. Is this possible? If so how?

推荐答案

为了将文件从一个EBS卷复制到另一个EBS卷,(不一定)两个卷都需要(在某个时候)附加到实例上,尽管不一定同一实例.如果您允许多个实例和/或将文件临时存储在第三个存储选项上,但是没有任何限制,并且假设卷当前未附加到实例,则有很多方法可以执行此操作,一个简单的解决方案是:/p>

In order to copy files from one EBS volume to another EBS volume, both volumes will (at some point) need to be attached to an instance, though not necessarily the same instance. There are a lot of ways to do this if you allow for multiple instances and/or temporarily storing the files on a third storage option, but without constraints, and assuming the volumes are not currently attached to instances, a simple solution would be:

  1. 启动一个临时实例.使用更大的尺寸以获得更高的IO带宽.

  1. Start a temporary instance. Use a larger size for higher IO bandwidth.

将两个EBS卷都附加到实例上,并将其挂载为/vol1和/vol2

Attach both EBS volumes to the instance and mount them as, say, /vol1 and /vol2

将文件从/vol1复制到/vol2(可能使用类似rsync -aSHAX/vol1//vol2/的方式)

Copy the files from /vol1 to /vol2 (perhaps using something like: rsync -aSHAX /vol1/ /vol2/ )

卸载卷,分离EBS卷,终止临时实例.

Unmount the volumes, detach the EBS volumes, terminate the temporary instance.

如果您还有其他限制,则应更新您的问题,以确切说明您的环境以及您要做什么.

If you have additional constraints, you should update your question to specify exactly what your environment is and what you're trying to do.

[根据您看到的错误进行跟踪]

[Followup based on the error you are seeing]

EC2实例和EBS卷必须存在于同一EC2区域和可用区中,该卷才能附加到该实例.如果不是,那么您可能想在EBS卷的可用区中创建一个临时实例,并使用rsync之类的东西在两个实例之间复制文件.

The EC2 instance and EBS volume must exist in the same EC2 region and availability zone for the volume to be attached to the instance. If they are not, then you may want to create a temporary instance in the EBS volume's availability zone and use something like rsync to copy files between two instances.

这篇关于如何将文件从一个EBS复制到另一个EBS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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