使用 AzCopy 将大文件分发到 N 个 VM
Distributing a large file to N VMs with AzCopy
上下文
我的目标是用新数据库刷新 20 个开发环境,并尽可能快速可靠地完成。我们生成一个 BAK,将其放入文件存储中,然后在我远程触发所有盒子上的卸载旧/安装新之前尝试(很糟糕)将其放入所有盒子。
尝试
现在我的 Powershell 工作流程如下:
Write-Output "Beginning workflow."
foreach -parallel ($dir in $destinations)
{
$targetFile = "$dir$sourcePattern"
Write-Output "Checking: $targetFile"
InlineScript{
$fileExists = Test-Path $Using:targetFile
if ($fileExists -eq $false){
Write-Output "Copying to: $using:targetFile"
&"$Using:AzCopyPath" /Source:"$Using:sourceDirectory" /Dest:$Using:dir /SourceKey:$Using:sourceKey /Pattern:"$Using:sourcePattern" /Z:$journalPath
Write-Output "Copied to: " $Using:targetFile
} else{
Write-Output "Already copied: " $Using:targetFile
}
这对于小文本文件来说效果很好,但是对于大约 400GB 的数据库备份,它就不能很好地工作了,因为主机完全不堪重负。
使用 AZCopy 以自动化和并行方式将大文件复制到约 20 台机器的最明智方法是什么?
请详细说明"the host machine gets totally overwhelmed."。您可能会遇到 Azure 文件共享的规模限制或存储帐户的其他限制。单个文件共享的目标吞吐量最高为 60 MB/sec,因此请确保您没有超过该限制。如果达到该限制,您可能需要考虑将内容放入多个文件共享中。请参阅以下 MSDN 文章中的文件和存储帐户的性能规模限制:https://azure.microsoft.com/en-us/documentation/articles/storage-scalability-targets/。另请检查以确保您的存储帐户和 Azure VM 位于同一区域以减少网络延迟。
谢谢,
昂
上下文
我的目标是用新数据库刷新 20 个开发环境,并尽可能快速可靠地完成。我们生成一个 BAK,将其放入文件存储中,然后在我远程触发所有盒子上的卸载旧/安装新之前尝试(很糟糕)将其放入所有盒子。
尝试
现在我的 Powershell 工作流程如下:
Write-Output "Beginning workflow."
foreach -parallel ($dir in $destinations)
{
$targetFile = "$dir$sourcePattern"
Write-Output "Checking: $targetFile"
InlineScript{
$fileExists = Test-Path $Using:targetFile
if ($fileExists -eq $false){
Write-Output "Copying to: $using:targetFile"
&"$Using:AzCopyPath" /Source:"$Using:sourceDirectory" /Dest:$Using:dir /SourceKey:$Using:sourceKey /Pattern:"$Using:sourcePattern" /Z:$journalPath
Write-Output "Copied to: " $Using:targetFile
} else{
Write-Output "Already copied: " $Using:targetFile
}
这对于小文本文件来说效果很好,但是对于大约 400GB 的数据库备份,它就不能很好地工作了,因为主机完全不堪重负。
使用 AZCopy 以自动化和并行方式将大文件复制到约 20 台机器的最明智方法是什么?
请详细说明"the host machine gets totally overwhelmed."。您可能会遇到 Azure 文件共享的规模限制或存储帐户的其他限制。单个文件共享的目标吞吐量最高为 60 MB/sec,因此请确保您没有超过该限制。如果达到该限制,您可能需要考虑将内容放入多个文件共享中。请参阅以下 MSDN 文章中的文件和存储帐户的性能规模限制:https://azure.microsoft.com/en-us/documentation/articles/storage-scalability-targets/。另请检查以确保您的存储帐户和 Azure VM 位于同一区域以减少网络延迟。
谢谢, 昂