复制存储数据从一个Azure的帐户到另一个 [英] Copying storage data from one Azure account to another

查看:159
本文介绍了复制存储数据从一个Azure的帐户到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从一个Azure存储帐户复制一个非常大的存储容器到另一个(这也恰好是在另一个订阅)。

I would like to copy a very large storage container from one Azure storage account into another (which also happens to be in another subscription).

我想就以下选项发表意见:

I would like an opinion on the following options:


  1. 写工具,将连接到两个存储帐户,并使用CloudBlob的DownloadToStream()和UploadFromStream()复制斑点一次一个。这似乎是最糟糕的选择,因为在数据传输时,它会产生费用,也相当缓慢的,因为数据将不得不回落到本机运行该工具,然后得到重新上传回Azure上。

  1. Write a tool that would connect to both storage accounts and copy blobs one at a time using CloudBlob's DownloadToStream() and UploadFromStream(). This seems to be the worst option because it will incur costs when transferring the data and also be quite slow because data will have to come down to the machine running the tool and then get re-uploaded back to Azure.

写工作者角色做同样的 - 这理论上应该速度更快,不会产生任何费用。然而,这是更多的工作。

Write a worker role to do the same - this should theoretically be faster and not incur any cost. However, this is more work.

上传工具的运行实例绕过工作者角色的部署和祈祷实例被回收/复位前的工具完成。

Upload the tool to a running instance bypassing the worker role deployment and pray the tool finishes before the instance gets recycled/reset.

使用现有的工具 - 有没有发​​现什么有趣的

Use an existing tool - have not found anything interesting.

上的做法有什么建议?

更新:我刚刚发现这个功能终于被推出了在2012年7月7日或以后创建的所有存储账户(REST API的只有现在):

Update: I just found out that this functionality has finally been introduced (REST APIs only for now) for all storage accounts created on July 7th, 2012 or later:

<一个href=\"http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx\">http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx

推荐答案

由于是从一个存储帐户迁移到另一个数据没有直接的方法,你需要做一些像你想什么。如果这是在同一数据中心内,方案2是最好的选择,并会以最快的速度(特别是如果你使用XL实例,给你更多的网络带宽)。

Since there's no direct way to migrate data from one storage account to another, you'd need to do something like what you were thinking. If this is within the same data center, option #2 is the best bet, and will be the fastest (especially if you use an XL instance, giving you more network bandwidth).

至于复杂性,这也更难以在辅助角色创建这个code比将它与本地应用程序。刚刚从你的工人角色的run()方法运行该code。

As far as complexity, it's no more difficult to create this code in a worker role than it would be with a local application. Just run this code from your worker role's Run() method.

为了让事情变得更健壮,你可以列出的斑点在你的容器中,然后将特定文件的移动请求消息到Azure的队列(以及通过把每封邮件的多个对象名称优化)。然后使用一个辅助角色线程从队列和处理的对象读取。即使你的角色被回收,在最坏的情况你会重新处理一个消息。对于业绩增长,然后你可以扩展到多个工作角色实例。一旦转让完成后,您只需推倒部署。

To make things more robust, you could list the blobs in your containers, then place specific file-move request messages into an Azure queue (and optimize by putting more than one object name per message). Then use a worker role thread to read from the queue and process objects. Even if your role is recycled, at worst you'd reprocess one message. For performance increase, you could then scale to multiple worker role instances. Once the transfer is complete, you simply tear down the deployment.

更新 - 2012年6月12日,在Windows Azure存储API进行了更新,现在允许跨账户BLOB副本。见<一href=\"http://blogs.msdn.com/b/windowsazurestorage/archive/2012/06/12/introducing-asynchronous-cross-account-copy-blob.aspx\">this博客文章的所有细节。

UPDATE - On June 12, 2012, the Windows Azure Storage API was updated, and now allows cross-account blob copy. See this blog post for all the details.

这篇关于复制存储数据从一个Azure的帐户到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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