Implementing Master/Slave architecture in Jenkins — Tutorial

Devansh Markan
Oct 16, 2020

Let’s begin —

In this step, we will configure the build to execute on the slave agent. Click on the ‘Manage Jenkins’ menu -> ‘Configure System’. Then Select Manage Nodes and Cloud.

Now, we will create a new Slave Node.

Give a name and description to the slave node.

Create a directory for the slave node and provide the location of the directory in the ”Custom WorkDir path”

Now, after clicking “Ok”, a new slave is created. But a major step is still pending. WHAT?

Open the folder created for the slave node “Slave 1”. In my system, it is “Jenkins_Slave1”

A new jar file “agent.jar” should be created

Copy the location of the directory where the agent.jar file is created

Now, we have to CONNECT the slave so that it will work the way we want. To do so, we have to enter the command -

java -jar <where agent.jar file is located>

The “Connected” word in the end shows that “Slave” is connected. Initially, the node “Slave 1” showed it was inactive. It was marked by the red cross accompanying it.

But now, that CROSS is gone. So, it shows that, it is active.

Now, that the slave is running properly, Click on the “Build Now” option for the project and Select the console output to see the build process.

So “BUILD SUCCESS” shows that the slave has executed properly.

If we check the dashboard, it will show Success there as well. See the below screenshot.

So, we have successfully implemented Master/Slave architecture in Jenkins.

Stay Tuned!

--

--

Devansh Markan

Tech-enthusiast and looking for learning new technologies and writing technical blogs here.