Jenkins Master Slave on AWS linux

First create two ec2

In master Add the Jenkins repo using the following command:

Import a key file from Jenkins-CI to enable installation from the package:

Upgrade

install java

install jenkins

enable jenkins

start jenkins

status of jenkins

see jenkins page

In slave install java same version of master

login Master machine; Manage jenkins --> Nodes-->

New node-->

Node name java-node; create

name java-node; no of executor 2; remote root directory /opt/build;

follow this settings

save

run this cmd

Connected

Agent connected

Now go to create a simple Jenkins job

demo-job; freestyle project; ok

configuration

project can be run

Build steps

Save

job has been created

build now

console output

How to write 1st Jenkins pipeline

build steps

job created

build now

console output

now convert to declarative pipeline

now install pipeline plugins

create job

in configuration