【发布时间】:2017-03-01 15:12:36
【问题描述】:
以下是我的设置:
Jenkins master 在服务器上运行,假设它的域名是 jenkins.master.host,即直接访问 Jenkins master 的 URL 是http://jenkins.master.host:8080
Apache HTTPD 在不同的服务器上运行,假设它的域名是 jenkins.master.proxy。 HTTPD 配置为监听 80 端口并代理到 jenkins master,即通过 apache 访问 Jenkins master,使用 URL http://jenkins.master.proxy。
在“管理 Jenkins”->“配置系统”下,Jenkins URL 被配置为 apache httpd URL,即http://jenkins.master.proxy
在“管理 Jenkins”->“配置全局安全”下,slave 配置为在固定的 TCP 端口 9020 上运行。
在“管理 Jenkins”->“管理节点”下,我创建了一个名为“TestSlave”的新节点。
下载JNLP启动slave后,连接master的小slave代理窗口一直卡在“Connecting to jenkins.master.proxy:9020”
JNLP 如下:
<jnlp codebase="http://jenkins.master.proxy/computer/TestSlave/" spec="1.0+">
<information>
<title>Agent for TestSlave</title>
<vendor>Jenkins project</vendor>
<homepage href="https://jenkins-ci.org/"/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.7+"/>
<jar href="http://jenkins.master.proxy/jnlpJars/remoting.jar"/>
<property name="hudson.showWindowsServiceInstallLink" value="true"/>
</resources>
<application-desc main-class="hudson.remoting.jnlp.Main">
<argument>*******************************************</argument>
<argument>TestSlave</argument>
<argument>-url</argument>
<argument>http://jenkins.master.proxy/</argument>
</application-desc>
</jnlp>
Apache HTTPD 配置如下:
<VirtualHost *:80>
ServerName jenkins.master.proxy
ProxyPass / http://jenkins.master.host:8080/ nocanon Keepalive=On
ProxyPassReverse / http://jenkins.master.host:8080/
AllowEncodedSlashes On
ErrorLog logs/jenkins/error.log
</VirtualHost>
我需要将一些配置放入 Jenkins 主服务器或 apache HTTPD 中以使从服务器连接吗?小詹金斯奴隶代理窗口仍然停留在“连接到 jenkins.master.proxy:9020 (retrying:11)”。也许我需要在 apache HTTPD 中添加另一个 VirtualHost 来监听端口 9020?我尝试过这样做,但没有成功。
我们将不胜感激。
非常感谢
【问题讨论】:
标签: apache jenkins jenkins-slave