In this article, we will learn what is Jenkins Master-Slave its architecture and finally how we can set it up.
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.
9) Now if we execute this job, we can see that Job is running on the slave machine.
Hi Ankur
ReplyDo you have anyany generic function to save multiple screenshots in word file using java
So far out of all the blogs,I personally feel this blog is just awesome.There are soo many information provided here in this blog. Therefore It is totally amazing...
ReplySoftware Testing Services
Software Testing Company
Functional Testing Services
QA Automation Testing Services
eCommerce Testing Services
Performance Testing Services
Security Testing Services
API Testing Services
Regression Testing Services
Compatibility Testing Services
Mobile App Testing Services