0% found this document useful (0 votes)
30 views

Jenkins Automation Distribution Setup

The document describes how to set up a Jenkins distributed build environment across multiple AWS EC2 instances. It provides steps to configure a master and worker node, install Java and Jenkins, configure SSH access without passwords, and add the worker node to Jenkins for distributed builds.

Uploaded by

Suraj JP
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Jenkins Automation Distribution Setup

The document describes how to set up a Jenkins distributed build environment across multiple AWS EC2 instances. It provides steps to configure a master and worker node, install Java and Jenkins, configure SSH access without passwords, and add the worker node to Jenkins for distributed builds.

Uploaded by

Suraj JP
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Jenkins Distributed Build

Create couple of AWS Ubuntu 18.04 instances


Name as
- Master
- Node1
Go to Master Node User Data section
Apply below
#!/bin/bash
sudo su
apt-get update
apt install software-properties-common apt-transport-https -y
add-apt-repository ppa:openjdk-r/ppa -y
apt install openjdk-8-jdk -y
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add
-
echo 'deb https://pkg.jenkins.io/debian-stable binary/' | tee -a
/etc/apt/sources.list
apt-get update
apt install jenkins -y
systemctl start jenkins
***********************************************************************************
***************************************
Worker Node User Data section
#!/bin/bash
sudo su
apt-get update
apt install software-properties-common apt-transport-https -y
add-apt-repository ppa:openjdk-r/ppa -y
apt install openjdk-8-jdk -y

***********************************************************************************
***************************************
Go Master Node and worker node
Ensure Java installed or not
java -version
***********************************************************************************
***************************************
Ensure Jenkins
Go to AWS EC2 Console and select master node public DNS value or Public Ip and go
to any browser apply below
DNS value with :8080 (Jenkins Default port number)
Example : http://ec2-54-173-81-29.compute-1.amazonaws.com:8080
Install Jenkins Plugin
Add Jenkins login and Password
***********************************************************************************
***************************************
Obtain Root Password
Go to Mater and Node1
- Provide root user password, by applying below
- passwd root
- Give password to root and remember it
___________________________________________________________________________________
____
Go to Masterhttp://18.207.225.29:8080/

- Apply SSH
- ssh-keygen (Don't feed any data and keep on enter button)
___________________________________________________________________________________
________________________________
Below Process for ensure that Master can connect worker node without password
Go to Master and Node1 sshd_config file and do the below changes
Path is : vi /etc/ssh/sshd_config
Go to PermitRootLogin
Replace prohibit passward with yes and remove #
PermitRootLogin yes
Go to PasswordAuthentication
Replace no with yes for PasswordAuthentication
PasswordAuthentication yes
Restart the configure file
service sshd restart
___________________________________________________________________________________
___________________________
Go to Master
This is for addding SSH Key
- a) By apply below commands
- b) ssh-copy-id root@<<private ip address of worker node>>
- c) Eg: ssh-copy-id [email protected]
- d) root is a user name of Node1
- e) Private ip address : provide Node1 private ip address
- f) When you applying first time, system prompt to ask password
- g) You need to provide, Node1 root user password
***********************************************************************************
***************************************
Ensure that, from Master node you can get into worker node without asking password
- Apply below
ssh root@<Node1 Private ip address>
Ex: ssh [email protected]
System is redirecting to Node1 w/o asking password
By applying below commends exit You can exit from Node1 to Master
/usr/share/java/jenkins.war

You might also like