如何备份 Azure 表和 Blob [英] How Do I Backup Azure Tables and Blobs

查看:29
本文介绍了如何备份 Azure 表和 Blob的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将数据存储在 Azure 存储表和 Blob 存储中.我想自动备份我的数据,以防止用户或软件问题意外损坏数据.微软对此没有很好的解决方案,虽然有自动备份的付费解决方案,但似乎应该有一种直接的方法来备份和恢复这些数据.

I store data in Azure Storage tables and blob storage. I would like to automatically backup my data to protect against accidental data corruption by users or by a software issue. There isn't a good solution for this from Microsoft and, while there are paid solutions for automatic backups, it seems like there should be a straight-forward way to backup and restore this data.

推荐答案

在对自动备份数据的最佳方式做了大量研究后,我发现最简单的方式是在 Windows Task 中安排作业使用 AZCopy 的 Azure 虚拟机上的调度程序.AZCopy 负责将表数据移动到 VM,然后返回到 Azure 中的辅助 blob 存储以保存备份.批处理文件还会导致 AZCopy 将 blob 从源存储帐户直接复制到目标帐户中.

After doing a lot of research on the best way to automatically backup data, I found that the easiest way to do this is to schedule a job in the Windows Task Scheduler on an Azure virtual machine that uses AZCopy. AZCopy does the work of moving the table data to the VM and then back out to a secondary blob store in Azure to hold the backup. The batch file also causes AZCopy to copy the blobs from the source storage account into the target account directly.

您可以在此链接中查看有关我如何完成这项工作的详细说明,以及我用于自动备份的批处理文件的链接:http://www.eastfive.com/2016/03/01/automated-backup-of-azure-storage-tables-and-blobs/

You can see a detailed description of how I made this work complete with links to the batch files that I use to automate the backup at this link: http://www.eastfive.com/2016/03/01/automated-backup-of-azure-storage-tables-and-blobs/

02/08/2018 更新此答案:我于 2018 年 1 月 18 日向 Azure 支持提出了这个问题,假设他们现在肯定有办法通过 Azure 中的服务来做到这一点.不幸的是,情况并非如此,并且(根据 Microsoft 支持)没有比第一次提出这个问题时存在的更好的表备份方法了.这是来自 2018 年 1 月 24 日的支持人员的回答:

02/08/2018 update on this answer: I raised this question to Azure support on January 18, 2018, assuming that surely they had a way to do this now via a service in Azure. Unfortunately that is not the case and there is (according to Microsoft support) no better way to do table backups than those that existed when this question was first posed. This is the answer from support from 01/24/2018:

我已经审查了你的情况,不幸的是没有办法对整个帐户或容器进行快照,这是唯一的方法使用 Azure 存储做快照是通过 blob 迭代和应用快照然后将快照迁移到辅助节点帐户.或者您可以简单地将实际文件复制到另一个帐户但这会有更高的延迟并且存储成本更高容量,快照将占用更少且更快转移.
我们支持的传输方法是 AzCopy 和可用于进行自定义迁移的数据移动库Java 或 C# 中的解决方案.
如果您想自动化这些流程那么你可以通过 Powershell 和 Azure 自动化或使用Azure Functions,但可能需要对这些解决方案的帮助作为我的团队纯粹通过另一个支持请求提出支持 Azure 存储."

"I have reviewed over your case and unfortunately there is not a way to do a snapshot of an entire account or container and so the only way to do snapshots with Azure Storage is through blob iteration and applying snapshots then migrating the snaps over to a secondary account. Or you can simply copy the actual files to another account but this would have higher latency and be more costly on storage capacity, where snapshots would take up less and be quicker to transfer.
The methods we support for transfer are AzCopy and the Data Movement Library which can be used to make custom migration solutions in Java or C#.
If you wanted to automate these processes then you could do this via Powershell and Azure Automation or with Azure Functions but assistance with those solutions would likely need to be raised through another support request as my team purely supports Azure Storage."

因此,仍然没有自动方式来进行这些备份.我的团队正在开发一个用于备份的库.当我们完成后,我会在这里发回.

So, there still exists no automated way to do these backups. My team is working on a library to do backups. When we have that completed, I will post back here.

05/08/2018 更新此答案:如前所述,我的团队一直致力于开发一个自动备份的库.你可以在这里找到这个项目:https://github.com/eastfivellc/EastFive.Azure.Storage.Backup.请随时贡献.

05/08/2018 update on this answer: As mentioned, my team has been working on a library to automate backups. You can find the project here: https://github.com/eastfivellc/EastFive.Azure.Storage.Backup. Please feel free to contribute.

2018 年 10 月 18 日对此答案的更新:我能够使用他们的 Azure 数据工厂功能在 Azure 中复制数据.我使用数据工厂将数据从我的源传输到表和 blob 的目标存储.但是,数据移动成本过高(每个备份数百美元).因此,这不是备份的解决方案.正如我在上面的帖子(以及下面的回答)中提到的,Azure 数据移动库是这里的最佳解决方案.

10/18/2018 update on this answer: I was able to copy data in Azure using their Azure Data Factory functionality. I used Data Factory to pipe data from my source to target storage for both tables and blobs. However, the data movement costs are exorbitantly high (in the hundreds of dollars per backup). So, this is not a solution for backups. As mentioned in my post from above (and in an answer below), the Azure Data Movement Library is the best solution here.

这篇关于如何备份 Azure 表和 Blob的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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