A Jenkins ace accompanies the essential establishment of Jenkins, and in this arrangement, the expert handles every one of the errands for your fabricate framework.
In case you are chipping away at various tasks, you might run different positions on each venture. A few undertakings need to run on certain hubs, and in this interaction, we need to arrange slaves. Jenkins slaves interface with the Jenkins ace utilizing the Java Network Launch Protocol.
We believe, You have already up and running Jenkins installed, If not so then go through given url in order to install fresh jenkins server on ubuntu linux.
In this post, We will configure Jenkins master slave configuration on ubuntu 20.04 LTS
Step 1: Generate SSH Key in Jenkins Master Node
You need to take login as Jenkins user on your machine and after that you need to generate the ssh key by following the given command.
su - jenkins
Step 2: Configure Credentials on Jenkins Master Nodes
You need to go your Jenkins dashboard and click on the Credentials button and click on global domain link and after that you will get the Add Credentials, Now you can add the ssh details.
Step 3: Configure Slave Nodes
Java is required to configure Jenkins slave node, We need to install the Java on slave machine by using the given command.
1st we need to add the dependices on the ubuntu machine, Execute the given command for the same.
sudo apt install software-properties-common apt-transport-https -y
2nd we need to add the repository by follwing the command.
sudo add-apt-repository ppa:openjdk-r/ppa -y
3rd Install the Java Package
sudo apt-get install openjdk-8-jdk -y
4th Verify the Java version
5th Add the new user named Jenkins
Execute the given command for the same.
useradd -m -s /bin/bash jenkins
Step 4: Copy SSH key to Slave Node
Then, we need to copy the key ‘id_rsa.pub‘ from the expert to slave worker hubs.
Type the Jenkins client secret.
The ssh key ‘id_rsa.pub‘ has been transferred to all specialist hubs.
Step 5: Add New Slave Nodes
You need to go to the Jenkins dashboard and click on Manage Jenkins, and then click on Manage Nodes.
and Click on New node
Type the node name ‘Jenkins-slave01‘, choose the ‘permanent agent‘, and click ‘OK‘.