CloudBees Jenkins platform (CJP) JNLP connectivity Best Practices

Most of the connectivity problems between CloudBees Jenkins platform Operations Center (CJPOC), the Jenkins platform Client Masters (CJPCM), and JNLP Agents usually come from the same causes:

  • The JNLP communication is going through intermediate routing elements like HAProxy…/ELB. The main problem on this case, is that usually the configuration is done as if the protocol was HTTP. However, JNLP is a TCP protocol which requires to set-up a timeout of 15 minutes in order to avoid disconnections produced by these intermediate elements. The best approach is explained on this article, which is to bypass this elements.
  • Add in all the CJPCMs the CJPOC hostname under Manage Jenkins -> Manage plugins [Advanced tab] in the No Proxy Host section. If the URL to access CJPOC is http://cjpoc.jenkins.example.com, then it is expected to have just cjpoc.jenkins.example.com in the No Proxy Host section.

Infrastructure

Bypass the intermediate elements in the CloudBees Jenkins platform (CJPOC-CJPCM) communication

The ELB/…/HAProxy is usually not correctly configured for the JNLP port. The recommendation is NOT to use the ELB/…/HAProxy, but instead bypass this intermediate element by adding this Java Argument in CJPOC and CJPCM -Dhudson.TcpSlaveAgentListener.hostName=<CJP_MACHINE_HOSTNAME>. If you don’t want to perform a restart, after adding the Java Argument you can execute TcpSlaveAgentListener.CLI_HOST_NAME="CJP_HOSTNAME" in Manage Jenkins -> Scrip Console in the CloudBees Jenkins Platform machine.

To check if the set-up was correctly performed you can run the command below and check that the header X-Jenkins-CLI-Host is present with the value we added.

$curl -I http://cjpcm-1.jenkins.example.com:8080/
HTTP/1.1 200 OK
Date: Thu, 13 Jul 2017 11:49:29 GMT
X-Content-Type-Options: nosniff
Set-Cookie: JSESSIONID.7b40bd3d=hbc0fd3lhh0w1bg9cusqtea8r;Path=/;HttpOnly
Expires: 0
Cache-Control: no-cache,no-store,must-revalidate
X-Hudson-Theme: default
Content-Type: text/html;charset=UTF-8
X-Hudson: 1.395
X-Jenkins: 2.60.1.1
X-Jenkins-Session: 1af0d556
X-Hudson-CLI-Port: 54789
X-Jenkins-CLI-Port: 54789
X-Jenkins-CLI2-Port: 54789
X-Jenkins-CLI-Host: cjpcm-1.jenkins.example.com
X-Frame-Options: sameorigin
X-Instance-Identity: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlx9/b60USmo2Eexm8TBtkcG881tkAP77iBbct0gDlSLaDdhbP7thD86Mu3WQVxmq23Rzqd/WR2VpN+JaQCQYttQ/KdxqnkTPZFO4vYy7n9E0pWgw8VKVZ9WEPfwfDEf4tHm/NmT4i43YrG4oeJvrVrGpwDp7vBviZNzQqOlcxLsr6njOX3+aZMYGkSdkduKgtKB5tV5qJSQxNFw/3I9HuxSZlaWMyni9NhAs1jGJ7EaxKT3Jtix56EY+vIRY43YhLU6YvnU/O6R2H9KdmxyFjthr1H3x8Wjfo1qYqePIL73bjA5guRyZZirbKL+1ep9LjTqJZYpH3EUjGoiBtYeyiwIDAQAB
Content-Length: 17904
Server: Jetty(9.2.z-SNAPSHOT)

Application

Only in case a Proxy is configured in the CloudBees Jenkins platform Client Masters (CJPCM)

In case there is proxy set-up in the CJPCM under Manage Jenkins -> Manage plugins [Advanced tab] you must add the CJPOC hostname into the No Proxy Host section at CJPCM level. i.e If the URL to access CJPOC is http://cjpoc.jenkins.example.com, then it is expected to have just cjpoc.jenkins.example.com in the No Proxy Host section at CJPCM level.

Suffering connectivity issues?

Please, file a support ticket on the CloudBees support platform attaching proactively the information requested in Required Data CJPOC-CJPCM communication issues

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.