OC-CM connectivity Best Practices

Most of the connectivity problems between OC and the CMs 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 CMs the OC hostname under Manage Jenkins -> Manage plugins [Advanced tab] in the No Proxy Host section. If the URL to access OC is http://cjoc.jenkins.example.com, then it is expected to have just cjoc.jenkins.example.com in the No Proxy Host section.

Infrastructure

Bypass the intermediate elements in the OC-CM 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 OC -Dhudson.TcpSlaveAgentListener.hostName=<OC_MACHINE_HOSTNAME>. If you don’t want to perform a restart, after adding the Java Argument you can execute TcpSlaveAgentListener.CLI_HOST_NAME="CJOC_HOSTNAME" in Manage Jenkins -> Scrip Console in the Operations Center 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://cje-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: cje-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 CM

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

Suffering connectivity issues?

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

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.