Jenkins Master Slave Configuration | Jenkins distributed architecture

Published: 01 January 1970
on channel: Akash Kumar
7,281
120

Jenkins Master-Slave Configuration

Agenda:
Understanding Jenkins Master and Slave Architecture
Setting Up Jenkins Slaves using Master Private and Public ssh keys
Setting Up Jenkins Slaves Using Windows Java slave-agent.jnlp Service
Setting Up Jenkins Slaves using a simple machine login credentials method (Not-recommended)

Jenkins Master Responsibilities:
Scheduling build jobs.
Monitor the slaves (possibly taking them online and offline as required).
Recording and presenting the build results.

Jenkins Slave Responsibilities:
Slaves can run on a variety of operating systems.
The job of a Slave is to do as they are told to, which involves executing build jobs dispatched by the Master.

**************************************************************************
Steps to create Jenkins Linux Slaves:

Generate SSH Key in the Jenkins master server:

On the Jenkins master server, log in to the Jenkins user and generate the ssh key.

su jenkins
ssh-keygen

Setup Credentials on Jenkins
Open your Jenkins dashboard and click on the 'Credentials' menu on the left.
And click the 'global' domain link.

Now click 'Add Credentials'.

Now choose the authentication method.
Kind: SSH Username with private key
Scope: Global
Username: jenkins
Private key: Enter directly and paste the 'id_rsa' private key of Jenkins user from the master server.
Click 'OK'.

And the Jenkins credential with ssh auth key method have been created.


Set up Slave Nodes

Now we will setup the slave nodes server by installing java on those servers and create a new Jenkins user.

Now install java OpenJDK using apt command below.

sudo apt install openjdk-8-jdk -y

After the installation is complete, check the installed java version.

java -version

Add New Jenkins User

adduser jenkins

Now that we have added Jenkins user to the slave machine
we have to go back to the master machine and copy the public key.

Copy the SSH Key from Master to Slave
Next, we need to upload the key 'id_rsa.pub' from the master to the slave server nodes. We need to upload to each server nodes using 'ssh-copy-id' command as below.

ssh-copy-id jenkins@slave-IP

Type the Jenkins user password.

The ssh key 'id_rsa.pub' has been uploaded to all agent nodes.

TO verify just Type the Jenkins username and password in the slave machine.

The ssh key 'id_rsa.pub' has been uploaded to all agent nodes.

Add New Slave Nodes
On the Jenkins dashboard, click the 'Manage Jenkins' menu, and click 'Manage Nodes'.

Click the 'New Node'.

Type the node name 'slave01', choose the 'permanent agent', and click 'OK'.

Now type node information details.
Description: slave01 node agent server
Remote root directory: /home/jenkins
Labels: slave01
Launch method: Launch slave agent via SSH, type the host IP address '10.0.15.21', choose the authentication using 'Jenkins' credential.

Now click the 'Save' button and wait for the master server to connect to all agent nodes and launch the agent services.

**************************************************************************

Continuous Integration vs Continuous Delivery vs Continuous Deployment in an Easy Way
   • Continuous Integration vs Continuous ...  

My GitHub Project for Jenkins pipeline demo:
https://github.com/akashkrkashyap/mav...

Jenkins Installation Video:
   • What is Jenkins? | How to Run Jenkins...  

Docker Installation Video:
   • How to Install and Use Docker | Docke...  

**************************************************************************
"Shahed - Indian Fusion" is free to use anywhere as long as you credit Shahed.
Music promoted by BreakingCopyright:    • 🐯 Indian Music (No Copyright) "Indian...  
**************************************************************************


Watch video Jenkins Master Slave Configuration | Jenkins distributed architecture online without registration, duration hours minute second in high quality. This video was added by user Akash Kumar 01 January 1970, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,281 once and liked it 120 people.