2017-03-01 141 views
0

下運行的是,我的設置:在服務器上運行詹金斯從連接到主詹金斯被後面的Apache

  1. 詹金斯主,並讓說,它的域名是jenkins.master.host,即直接訪問Jenkins主機的URL將是http://jenkins.master.host:8080

  2. Apache HTTPD運行在不同的服務器上,可以說它的域名是jenkins.master.proxy。 HTTPD配置爲偵聽端口80並代理jenkins主機,即通過apache訪問Jenkins主機,使用URL http://jenkins.master.proxy

  3. 在 「管理詹金斯」 - > 「配置系統」,詹金斯URL被配置爲apache httpd的URL,即http://jenkins.master.proxy

  4. 在 「管理詹金斯」 - > 「配置全球安全」,從站配置爲在固定的TCP端口9020上運行。

  5. 在「管理Jenkins」 - >「管理節點」下,我創建了一個名爲「TestSlave」的新節點。

  6. 下載JNLP啓動機後,連接到主小從代理窗口仍然停留在「連接到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正在配置如下:

<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 master或Apache HTTPD中才能連接到slave?小詹金斯奴隸代理窗口仍然卡在「連接到jenkins.master.proxy:9020(重試:11)」。也許我需要在apache HTTPD中添加另一個VirtualHost來偵聽端口9020?我試圖做到這一點,但沒有成功。

想法將不勝感激。

非常感謝

回答