首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jenkins从服务器连接到运行在Apache后面的Jenkins Master

Jenkins从服务器连接到运行在Apache后面的Jenkins Master
EN

Stack Overflow用户
提问于 2017-03-01 15:12:36
回答 1查看 6.6K关注 0票数 1

下面是我的设置:

  1. 在服务器上运行的Jenkins主服务器,让我们说它的域名是jenkins.master.host,即直接访问Jenkins主服务器的URL将是http://jenkins.master.host:8080
  2. Apache运行在不同的服务器上,我们可以说它的域名是jenkins.master.proxy。HTTPD配置为在端口80上侦听并代理到jenkins主服务器,即通过apache访问Jenkins主服务器,使用的是http://jenkins.master.proxy URL。
  3. 在“管理詹金斯”->“配置系统”下,Jenkins被配置为apache,即http://jenkins.master.proxy
  4. 在"Manage“->”“下,从服务器配置为在固定的TCP端口9020上运行。
  5. 在“管理詹金斯”->“管理节点”下,我创建了一个名为"TestSlave“的新节点。
  6. 下载JNLP启动从服务器后,连接到主服务器的小从代理窗口仍然停留在“连接到jenkins.master.proxy:9020”上。

JNLP的情况如下:

代码语言:javascript
复制
<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配置如下:

代码语言:javascript
复制
<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以使从服务器进行连接?小型Jenkins从代理窗口仍然停留在“连接到jenkins.master.proxy:9020 (重试:11)”上。也许我需要在apache中添加另一个VirtualHost来监听端口9020?我试过这样做,但没有成功。

我们会非常感激你的想法。

非常感谢

EN

回答 1

Stack Overflow用户

发布于 2017-11-08 10:02:20

看一看这个帖子:Jenkins: How to configure Jenkins behind Nginx reverse proxy for JNLP slaves to connect

我通过在我的jetty配置中将系统属性hudson.TcpSlaveAgentListener.hostName设置为jenkins.master.host来解决这个问题。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42535359

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档