jenkins the definitive guide

(Jeff_L) #1

Figure 11.4. Taking a slave off-line when idle


The launch method is where you decide how Jenkins will start the node, as we mentioned earlier. For
the configuration we are discussing here, you would choose “Launch slave agents on Unix machines
via SSH”. The Advanced button lets you enter the additional details that Jenkins needs to connect to
the Unix slave machine: a host name, a login and password, and a port number. You can also provide a
path to the SSH private key file on the master machine (e.g., id_dsa or id_rsa) to use for “password-
less” Public/Private Key authentication.


You can also configure when Jenkins starts and stops the slave. By default, Jenkins will simply keep the
slave running and use it whenever required (the “Keep this slave on-line as much as possible” option).
If Jenkins notices that the slave has gone offline (for example due to a server reboot), it will attempt
to restart it if it can. Alternatively, Jenkins can be more conservative with your system resources, and
take the slave offline when it doesn’t need it. To do this, simply choose the “Take this slave on-line
when in demand and off-line when idle” option. This is useful if you have regular spikes and lulls of
build activity, as an unused slave can be taken offline to conserve system resources for other tasks, and
brought back online when required.


Jenkins also needs to know where it can find the build tools it needs for your build jobs on the slave
machines. This includes JDKs as well as build tools such as Maven, Ant, and Gradle. If you have
configured your build tools to be automatically installed, you will usually have no extra configuration to
do for your slave machines; Jenkins will download and install the tools as required. On the other hand,
if your build tools are installed locally on the slave machine, you will need to tell Jenkins where it can
find them. You do this by ticking the Tool Locations checkbox, and providing the local paths for each
of the tools you will need for your build jobs (see Figure 11.5, “Configuring tool locations”).

Free download pdf