Skip to content

Jenkins Master-Slave cluster for Linux Operating System on the the top of AWS Cloud.

Notifications You must be signed in to change notification settings

Pratikshinde55/Jenkins-Master-Slave_linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 

Repository files navigation

Jenkins Master Slave Architecture SetUP:

Jenkins Master-Slave cluster for Linux OS on the top of AWS Cloud

I use AWS EC2 instances for this architecture :

  • "The slave type is permanent Slave and Operating System is Linux".
  • Distributed Scheduling cluster

Overview of Steup :

  1. I use aws Cloud EC2 (AMI-amazon linux2) for -> Master node on which i Install jenkins.
  2. For Slave i also same EC2 instance and connection by SSH .
  3. I use jenkins by webUI using public IP of instance and jenkins port no:8080.

image

Note:

For Adding Slave Node to jenkins follwing things need to do:

  • java must installed on that Slave because jenkins made from java.
  • SSH should be enable in that Slave.
  • Jenkins Agent installed on that Slave.
  • Jenkins Slave node store data by default on slave so we need to create Directory on Slave node for data store.

On Slave Node EC2 terminal (For Linux OS):

Install java on Slave:

  sudo yum install java-17-amazon-corretto-devel

Now create Directory for workspace:

   mkdir PSworkspace

image

On Jenkins webUI :

Step-1: [Click manage Jenkins and then Node option on jenkins webUI]

image

image

Step-2: [Create New Node, Create Node named as 'psSlaveNode']

image

Step-3: [Now Fill information about slave]

Label : It helps to execute job on which slave Node by Label name of Slave.

Remote root directory : This Slave Location we created for store data of job on slave.

Number of executors: Jenkins job execute with help of Build Executors, It menas If Build Executor is 3 then 3 Job run at a time or concurrent on that SlaveNode.

image

Step-4:

Select "Launch method" is -->> "Launch agent by via SSH" ( Thsi is because we use linux os system and jenkins required agent download by SSH and Connect Master by SSH to SlaveNode.)

In "Host" -->> Fill public Ip of Slave Node

And select "Credentials" -->> ADD

image

Step-5: (In Credentials)

In "Kind" -->> "SSH username and private key"

  • Note:

The private key which is used during launch Slave Node that key download on Local machine open that key by Double tap and copy that key and paste in "private Key" option

image

image

  • Host verification means When we connect any system by SSH 1st time they ask Yes or No so we select Non-verification strategy.

image

Now Slave is Connected to master :

image

Create Small job which is run on Slave for testing:

Create "New item" and select Freestyle job.

In general there is option for select this job on which Slave execute and add here label which given to slave.

image

In "Build" in Execute shell (Because linux os have Shell) and add any command .

Note:

The command should be use sudo for admin power and intractive command give arguments otherwise job fails.

image

Build job :

we see details on console output of that job

image

We can also check on EC2 terminal of slave Node:

  • before:

image

  • After job execute git installed:

image

About

Jenkins Master-Slave cluster for Linux Operating System on the the top of AWS Cloud.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published