Distributed Builds in Jenkins

Veeksha A V
Sep 2, 2018 · 2 min read

Jenkins is a continuous integration server. A Jenkins server (master) is capable of building , hosting, deploying large number of projects by operating in “master/slave” mode.

Jenkins Master , Slaves Setup
  • Master can delegate the workload of building projects to “slave” nodes. The projects built in this manner is referred to as “Distributed Builds”.
  • Another reason to offload the building of projects to “slave” nodes is to meet the requirement of different build environment for different projects.

Below are the steps we can use to configure a slave node on the master node.

  1. Login in to the Jenkins UI.

2. Add a slave node ‘SlaveNode01’ — Go to Jenkins -> Manage Jenkins -> Manage Nodes -> New Node

3. Configure above created slave node as below.

  • One of the launch method of jenkins agent is via ‘running the command from master’. Launch Command specified is the ssh command to be run from master. The ssh command should include option “StrictHostKeyChecking=no” to connect to slave node successfully without any user intervention and run agent.jar
  • Labels are very powerful which is nothing but virtual group names. One can specify appropriate list of labels to which a slave node belongs so that while configuring jenkins job , one can restrict the job to be run on a slave node associated with specific label name. Ex: to restrict a job / project to be built on one of the Unix nodes only, we can associate Unix slave nodes with label ‘Unix’ during creation of such Unix slave nodes.
  • If the number of executors is 1, then at any point in time only one jenkins job can be run on this slave node. This indicates , number of parallel jobs to be run on slave node
  • Remote root directory is the base directory on the agent/slave node for the jenkins agent process, where all builds built on that slave node can be found along with other jenkins agent related configuration.
  • One can also configure any environment variables and tool locations for this slave node from the jenkins master UI to be used for all the jobs run on it.

Veeksha A V

Written by

A Software Engineer with a can do attitude, enjoy learning new things in life.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade