Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Master Slave Jenkins

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 4

This can create various build sections that supports all the environments that you need to run

build/test within

The master will continue to perform basic operations and serve the user interface, while the
slaves do the heavy lifting.

In environments where a master/slave scheme applies, having a load balancer is what we


want to enable proper and predictable resource usage along with good performance.

In distributed environment, we need different machines for different


purposes. For example, we may need machine1(Ubuntu) to run some
process and machine2(CentOS) to run some other process. For such
distribution, Jenkins Master Slave configuration comes to the rescue.

Jenkins Slave :
A slave is a Java executable that runs on a remote virtual machine. It has following
points.
 It check requests from the Jenkins master instance.
 Slaves can run on a different type of operating systems like linuxs and windows.

The benefits of this setup seem to be:


 Scalability - I can easily add a 4th or 5th project and maintain the same number of slaves
 Requires setup of only 1 master and 3 slaves, which is probably easier to setup than 3
separate masters.

Jenkins supports the master-slave architecture, i.e. many slaves work for a master. It is also
known as Jenkins Distributed Builds. It also allows you to run jobs on different environments like
Linux, Windows, MacOS, etc. We can also run the same test case on different environments in
parallel using Jenkins Distributed Builds, which in turn helps you to achieve the desired results
quickly using this distributed approach. All of the job results are collected and combined on the
master node for monitoring.

When you are working on a number of projects which get built on a regular basis or want to run
multiple jobs or might need several different environments to test your builds, then a single
Jenkins server cannot simply handle the entire load.

Jenkins Master

Your main Jenkins server is the master machine. The tasks performed by the master are
:

 Scheduling build jobs.


 Dispatching builds to the slaves for the execution.
 Monitor the slaves.
 Recording and presenting the build results.
 Can also execute build jobs directly.

Jenkins Slave

A slave is a Java executable that runs on a remote machine. The characteristics of the
slave are :

 It hears requests from the Jenkins Master instance.


 Slaves can run on a variety of operating systems.
 The job of a Slave is to do as they are told to, which involves executing build jobs
dispatched by the Master.
 We can configure a project to always run on a particular Slave machine or a
particular type of Slave machine, or simply let Jenkins pick the next available
Slave.

Distributed Builds
One of the best features of Jenkins is distributed builds. It basically allocates the different
jobs to various machines. This helps in distributing the load as well as run the build on
different environments

It works in a distributed architecture, by using the client-server or master-slave architecture.


The below figure shows a high-level architecture of Jenkins :

Before proceeding towards the description of components, let’s understand first that why
distributed architecture is required:
 Suppose we are working on larger and heavier projects that get built regularly,
so its not a good idea to put a complete load on the central Jenkins Server as
it would not be efficient. So, here we need to configure different Jenkins
machines as slave machines capable of taking the load from the master
Jenkins server.
 Sometimes, we need to build or test the builds on different
environments/operating systems, so in this case, the assignment of each
Jenkins slave machine for each environment is the best idea to distribute the
load as well as to get results soon.
I hope the above points justify the need for a distribut
What is Jenkins Master ?
Jenkins Master is the central component of Jenkins’s distributed system, and majorly
performs the following tasks:
 Schedule and execute the builds, either on the master itself or on the slaves.
 Distributing and dispatching the builds to slaves.
 Gathering and displaying the results gathered from slaves.
 Monitor slaves, including switching on/off slaves on need basis.
 Monitor and pull codes from repositories. 
 
 

What is Jenkins Slave?


Jenkins Slave is the slave machine/node where the actual builds run. Jenkins
Master assigns jobs to Jenkins Slave that it runs and provides reports back to
the Jenkins Master. The below points gives a basic gist of what all activities a Jenkins
Slave can perform:
 Jenkins Slave is also called a Node or a slave agent.
 Jenkins Slave is a java executable that runs on a remote machine. All these
nodes configure in any server like Windows, Mac OS, Linux, so it is clear that it
is Platform independent.
 Jenkins Slaves keep an eye on Jenkins master for instructions regarding the
build execution. As soon as Jenkins Master assigns some build to Jenkins
slave, it immediately executes that build and gives results.
 If we configure any projects specifically on a particular Slave, then only that
project will run on that specific slave; otherwise, Jenkins master will see the
next available build automatically for execution.

You might also like