Azure 中国存储 - AZCopy 上传失败

Azure China Storage - AZCopy upload fail

我正在尝试使用我在美国的机器上的 AZCopy 将 2.6 GB 的 iso 上传到 Azure 中国存储。我与中国的一位同事共享了该文件,他们没有遇到任何问题。这是似乎工作了大约 30 分钟然后失败的命令。我知道有一个 "Great Firewall of China" 但我不确定如何解决这个问题。

C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy> .\AzCopy.exe
    /Source:C:\DevTrees\MyProject\Layout-Copy\Binaries\Iso\Full 
    /Dest:https://xdiso.blob.core.chinacloudapi.cn/iso 
    /DestKey:<my-key-here>

由于您遇到超时,您可以像这样在可重新启动模式下尝试使用 AZCopy:

C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy> .\AzCopy.exe
    /Source:<path-to-my-source-data>
    /Dest:<path-to-my-storage>
    /DestKey:<my-key-here>
    /Z:<path-to-my-journal-file>

您的日志文件的路径是任意的。例如,如果您愿意,可以将它定位到 C:\temp\azcopy.log

假设在复制文件时发生中断,并且文件的 90% 已经传输到 Azure。然后在重新启动时,我们将只传输文件剩余的 10%。

有关详细信息,请键入 .\AzCopy.exe /?:Z 以查找以下信息:

Specifies a journal file folder for resuming an operation. AzCopy always supports resuming if an operation has been interrupted.

If this option is not specified, or it is specified without a folder path, then AzCopy will create the journal file in the default location, which is %LocalAppData%\Microsoft\Azure\AzCopy.

Each time you issue a command to AzCopy, it checks whether a journal file exists in the default folder, or whether it exists in a folder that you specified via this option. If the journal file does not exist in either place, AzCopy treats the operation as new and generates a new journal file.

If the journal file does exist, AzCopy will check whether the command line that you input matches the command line in the journal file.

If the two command lines match, AzCopy resumes the incomplete operation. If they do not match, you will be prompted to either overwrite the journal file to start a new operation, or to cancel the current operation.

The journal file is deleted upon successful completion of the operation.

Note that resuming an operation from a journal file created by a previous version of AzCopy is not supported.

您还可以在这里找到更多信息:http://blogs.msdn.com/b/windowsazurestorage/archive/2013/09/07/azcopy-transfer-data-with-re-startable-mode-and-sas-token.aspx

Azure 服务器和您的本地计算机之间的网络应该非常慢,AzCopy 使用默认的 8* 核心线程进行数据传输,这对于慢速网络来说可能过于激进。

我建议你通过设置参数"/NC:"来减少线程数,你可以设置一个较小的数字如"/NC:2"或"/NC:5",看看是否可以调用会更稳定。

顺便说一句,当超时问题再次出现时,请使用相同的 AzCopy 命令行恢复,这样您就可以随时通过恢复取得进展,而不是从头开始。