How to configure Master and Slave on Jenkins

Jenkins installation see below link

https://sundarpalanivel.hashnode.dev/jenkins-installation-on-amazon-linux-2023

Create two instance one is master other one is slave

Login slave machine

Install same version of java master and slave

Jenkin machine jdk 11.0.21 version

Update and upgrade slave machine

Install java

Check java version

Now goto Jenkins page and

Go to manage engine

Go to Nodes

Add a new node

Node name java-node and type permanent Agent and create

Next page like this

Number of executors 2

Remote root directory /opt/build

Labels java-build-node

Usage use this node as much as possible and launch method launch agent by connecting it to the controller

Internal data directory remoting and use websocket

Availability keep this agent online as much as possible

Save

Java node created

Open java-node

Run this cmd in slave

curl -sO 13.127.151.176:8080/jnlpJars/agent.jar

java -jar agent.jar -jnlpUrl 13.127.151.176:8080/computer/java%2Dnode/je.. -secret 101d88ba9d3beed21f56ae4d888b643114203f306801f592582ac4e6075b1404 -workDir "/opt/build"

Connected

Java-node agent is connected

Go to dashboard and new item

Create a job

Item name demo-job and choose freestyle project

Ok

In General

Choose build environment

Build steps execute shell

Apply and save

Build now

Choose 12 Dec. 23 17:32

Next page

Console output

Now check slave machine in browser; it works