Resolution
It depends on the way you installed CloudBees CI.
| The Jenkins System and Remoting Properties are added as Java Arguments. Both also apply to CloudBees CI. |
Testing the properties
IMPORTANT: This type of setting is not persistent; thus, the property default values will be reset after the next restart.
In the Script Console, depending on the property setting.
Most of the Jenkins properties are static, therefore you can update its value like in the following examples:
TcpSlaveAgentListener.CLI_HOST_NAME="<ci.example.com>" //OR com.cloudbees.hudson.plugins.folder.computed.FolderComputation.BACKUP_LOG_COUNT=10
There are some exceptions like the JENKINS-35484 which makes use of the Jenkins SystemProperties
Traditional Platform
Running CloudBees CI inside Jetty Winstone container
| For Jenkins®, see Overriding service configurations. |
This is the default way to run CloudBees CI if you installed it using packages provided by CloudBees.
To pass Java arguments to CloudBees CI, you need to change the CloudBees CI service configuration file. You might require elevated privileges to be able to modify this file.
For CloudBees CI on traditional platforms - operations center, you can find this file under:
-
/etc/sysconfig/cloudbees-core-oc: RPM based Linux distributions -
/etc/default/cloudbees-core-oc: DEB based Linux distributions -
C:\Program Files\CloudBeesCoreOC\jenkins.xml: default location for Windows
For CloudBees CI on traditional platforms - client controller, you can find this file under:
-
/etc/sysconfig/cloudbees-core-cm: RPM based Linux distributions -
/etc/default/cloudbees-core-cm: DEB based Linux distributions -
C:\Program Files\CloudBeesCoreCM\jenkins.xml: default location for Windows
RPM based Linux distributions
In your service configuration file, look for the argument JENKINS_JAVA_OPTIONS. It should look something like this:
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
Starting with version 2.303.2.3 or newer, you should use the following array-based syntax, for example to add -Xms and -Xmx arguments:
JENKINS_JAVA_OPTIONS=("-Djava.awt.headless=true")
JENKINS_JAVA_OPTIONS+=("-Xms2048m")
JENKINS_JAVA_OPTIONS+=("-Xmx2048m")
This array-based syntax is the recommended syntax as it is simpler to comment out individual arguments if required, and comparing differences with backups of the file are simpler.
If running a product version older than 2.303.2.3 use the previous syntax:
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Xms2048m -Xmx2048m"
Running CloudBees CI in Windows as a Service
- In your service configuration file (by default $JENKINS_HOME\jenkins.xml) add the arguments into the
<arguments>tag. It should look like this
<arguments>-Xmx2048m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
Running CloudBees CI inside Docker
The JAVA_OPTS should be passed to the container via --env JAVA_OPTS="..." like the following:
docker run --name cloudbees-controller -p 8080:8080 -p 50000:50000 --env "JAVA_OPTS=-Dhudson.footerURL=https://mycompany.com" cloudbees/cloudbees-core-cm
| With Docker, in terms of memory, other constraints apply. |