简体   繁体   English

从Artifactory远程存储库下载大型工件

[英]Downloading Large Artifacts from Artifactory Remote Repository

I have the following problem: I'm trying to create a local cache for a maven repository that is hosted at a different site inside the same company. 我有以下问题:我试图为托管在同一公司内其他站点上的Maven存储库创建本地缓存。 So I set up Artifactory OSS, created a couple remote repositories pointing at the off-site server and, generally speaking, everything works as expected, except for a couple of dependecies that are unusually large. 因此,我建立了Artifactory OSS,创建了两个指向异地服务器的远程存储库,并且一般而言,除了一些异常大的依赖之外,其他所有工作都按预期进行。 Mind you they are not jars with a couple megabytes of compiled codes, but zip archives filled with image data. 请注意,它们不是带有数兆字节已编译代码的jar,而是装满图像数据的zip存档。 The largest one is 8gb on its own. 最大的一个是8gb。

My gradle build fails every time, because my local Artifactory replies that the artifact does exist, tries to download it, and then causes a WebSocketTimeout. 我的gradle构建每次都失败,因为我的本地Artifactory答复该工件确实存在,尝试下载它,然后导致WebSocketTimeout。 This does not happen, when I access the off-site server directly. 当我直接访问异地服务器时,不会发生这种情况。 When I uncheck "store locally" it works fine too, but that is the exact opposite of what I'm trying to achieve. 当我取消选中“本地存储”时,它也可以正常工作,但这与我要实现的目标完全相反。

Any ideas? 有任何想法吗?

There are several timeouts that can be at play here. 这里可能有几个超时时间。 When you ask Artifactory to download and cache something for you, it will: 当您要求Artifactory为您下载并缓存某些内容时,它将:

  1. Fully download the file 完全下载文件
  2. Once complete, it will stream the file to you 完成后,它将把文件流式传输给您

This means that for larger files, Artifactory will take a while before sending anything back to the client. 这意味着对于较大的文件,Artifactory将需要一段时间才能将任何内容发送回客户端。 This can be a problem if the client (or something in between, like a reverse proxy) has a small timeout. 如果客户端(或介于两者之间的内容,例如反向代理)的超时时间较小,则可能会出现问题。 There is also a socket timeout setting on Artifactory itself. Artifactory本身也有一个套接字超时设置。

If the file appears in Artifactory at some point after the download has failed, the timeout issue is likely in the reverse proxy or the client itself and you should try increasing them. 如果文件在下载失败后的某个时间出现在Artifactory中,则反向代理或客户端本身可能存在超时问题,您应该尝试增加它们。 If the file never makes it to Artifactory, you should go to the remote repository settings (UI -> Admin -> Repositories -> Remote -> [repo name] -> Advanced) and increase the Socket Timeout (MS) to be double or triple the current value, just enough to get the largest file but not too large as it may cause too many connections to a bad server to build up. 如果该文件从未发送到Artifactory,则应转到远程存储库设置(UI->管理员->存储库->远程-> [repo名称]->高级),然后将套接字超时(MS)增加为两倍或将当前值增加三倍,刚好足以获取最大的文件,但又不能太大,因为它可能导致与坏服务器的连接过多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM