当我安装像“ git-plugin”这样的jenkins插件时,jenkins会将我的请求重定向到镜像ftp.halifax.rwth-aachen.de。但是我在公司代理后面工作,该公司代理禁止对包含单词“ ftp”的URL进行请求。

下载jenkins的插件时,是否可以选择或禁用镜像? Jenkins可以从不包含“ ftp”的站点安装插件没有问题。

这是jenkins日志视图中的错误:

Dez 22, 2016 3:46:54 PM INFORMATION hudson.model.UpdateCenter$DownloadJob run
Starting the installation of Git client plugin on behalf of admin-ci
Dez 22, 2016 3:46:54 PM SCHWERWIEGEND hudson.model.UpdateCenter$DownloadJob run
Failed to install Git client plugin
hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/plugins/git-client/2.1.0/git-client.hpi (redirected to: http://ftp.halifax.rwth-aachen.de/jenkins/plugins/git-client/2.1.0/git-client.hpi)
    at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1169)
    at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1666)
    at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1864)
    at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1640)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://ftp.halifax.rwth-aachen.de/jenkins/plugins/git-client/2.1.0/git-client.hpi
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1926)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1921)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1920)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1490)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
    at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1121)
    ... 7 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://ftp.halifax.rwth-aachen.de/jenkins/plugins/git-client/2.1.0/git-client.hpi
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2982)
    at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:629)
    at java.net.URLConnection.getContentLengthLong(URLConnection.java:501)
    at java.net.URLConnection.getContentLength(URLConnection.java:485)
    at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1120)
    ... 7 more

    enter code here

最佳答案

默认情况下,Jenkins使用http://updates.jenkins-ci.org/update-center.json作为“负载均衡器” URL,它将您转发到最近的地理镜像json(即对我来说是http://ftp-nyc.osuosl.org/pub/jenkins/updates/current/update-center.json)。您可以做的是为此目的使用自己的json文件,方法是在需要的任何位置(即内部)安装此插件并托管json文件:

https://wiki.jenkins.io/display/JENKINS/UpdateSites+Manager+plugin

url - 当代理禁止关键字ftp时如何更改Jenkins镜像-LMLPHP

关于url - 当代理禁止关键字ftp时如何更改Jenkins镜像,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41285882/

10-12 12:42
查看更多