Jenkins - Distributed Builds
If you have larger and heavier projects which get built on a regular basis and running all of these builds on a central machine may not be the best option. In such case, you can configure other Jenkins machines to be slave machines to take the load off the master Jenkins server.
Sometimes you might also need several different environments to test your builds, in this scenario using a slave to represent each of your required environments is good idea.
The master-slave architecture of Jenkins is used for distributed build environments, where the workload of building projects is distributed to multiple agent nodes or slaves. We can also different environments for each build.
Since each slave runs a separate program called a slave agent, there is no require to install the full Jenkins (package or compiled binaries) on a slave. There are a variety of ways to start slave agents, but at the end of the slave agent a Jenkins master needs to establish a bi-directional communication link (for example a TCP/IP socket) in order to operate.
To set up the slaves/nodes in Jenkins, use the following steps:
Step 1: Go to Manage Jenkins.
Step 2: Scroll down and select Manage Nodes.
Step 3: Click on New Node.
Step 4: Give a name for the new node, choose Permanent Agent option and then click OK.
Step 5: Enter the other details of the new node:
Here, I will use "Let Jenkins Control this Windows slave as a Windows service". When we select this option, you need to enter the following information:
Step 6: Once you entered the above information, the new node machine will initially be in an offline state, but will online if all the settings in the previous screen were entered correctly.