Jenkins Master Slave Configuration

Jenkins Master Slave Configuration


In this article, we will learn what is Jenkins Master-Slave its architecture and finally how we can set it up.

But Before that, let's understand first,


What is Jenkins Master-Slave Setup?

To Manage distributed build Jenkins uses a Master-Slave Architecture. In this type of architecture, both master and slave communicate through TCP/IP Protocol.



The main Job of Jenkins Master is to schedule and dispatch build jobs for execution. Whereas Jenkins slave is typically a remote machine which takes order from Master and execute tests on different operating systems or instances.

Architecture of Jenkins-Master



To Setup Jenkins Master-Slave setup we need to follow steps:

1)      Login into Jenkins, Manage Jenkinsร Manage Nodes.

2)      Click on option New Node in the left menu option.

3)      Provide the name of the node and select the option as Permanent Agent.


4)      Provide the configuration for the node.

Name : Name that uniquely identifies an agent within this Jenkins installation.

Description : description for this agent.

# of executors: The maximum number of concurrent builds that Jenkins may perform on this node.



Remote Root Directory: An agent needs to have a directory dedicated to Jenkins. Specify the path to this directory on the agent. Here I have created one directory named as jenkins_slave in my c:

Labels: Labels (or tags) are used to group multiple agents into one logical group.

Usage: Controls how Jenkins schedules build on this node

Launch Method: Controls how Jenkins starts this agent.

Select the Launch method as Launch Agent Via Java web start.

Availability: Controls when Jenkins starts and stops this agent.




Please note in case you are not able to find the launch method as Launch Agent Via Java web start.

Follow these steps

Manage Jenkins-->Configure Global Security-->Select the Radio button as Random for TCP Port for JNLP Agents.



5)       Saving the changes below screen will appear.



6)    There are 2 options to make Jenkins Agent online. 

    A) Launch Agent from browser. 

    B) Run the Agent from the command line. In this blog, I will be using the second option.



      For using this option click on agent.jar and install it on some local path on your machine and then execute the command as shown in the screenshot/Jenkins UI.


                     7)      This will make your Jenkins Slave online.


             8) Now to execute your Jenkins job on this slave machine. Create New Jenkins job. Inside the General section, select Restrict where this project can be run and provide the expression of the Slave level that was given while configuring the nodes.





      9) Now if we execute this job, we can see that Job is running on the slave machine.





  


SHARE THIS

Author:

My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Latest
Next Post
May 20, 2020 at 10:32 PM

Hi Ankur
Do you have anyany generic function to save multiple screenshots in word file using java

Reply
avatar