https://github.com/pratikshinde55/jenkins-master-slave_linux
Jenkins Master-Slave cluster for Linux Operating System on the the top of AWS Cloud.
https://github.com/pratikshinde55/jenkins-master-slave_linux
aws-ec2 jenkins jenkins-master-slave
Last synced: 3 months ago
JSON representation
Jenkins Master-Slave cluster for Linux Operating System on the the top of AWS Cloud.
- Host: GitHub
- URL: https://github.com/pratikshinde55/jenkins-master-slave_linux
- Owner: Pratikshinde55
- Created: 2024-06-20T12:32:36.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-01-03T07:46:53.000Z (5 months ago)
- Last Synced: 2025-01-13T16:50:28.064Z (4 months ago)
- Topics: aws-ec2, jenkins, jenkins-master-slave
- Homepage:
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jenkins Master Slave Architecture SetUP:
Jenkins Master-Slave cluster for Linux OS on the top of AWS CloudI use AWS EC2 instances for this architecture :
- "The slave type is permanent Slave and Operating System is Linux".
- Distributed Scheduling clusterOverview 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**.
Note:
For Adding Slave Node to jenkins follwing things need to do:
- Java must be installed on that Slave because jenkins made from java.
- SSH should be enable on 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

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


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

### 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.
### 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
### 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

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

Now Slave is Connected to master :

### 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.

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.

Build job :
we see details on console output of that job

We can also check on EC2 terminal of slave Node:
- before:

- After job execute git installed:
