You are on page 1of 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 root@172.31.93.132
- 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 root@172.xxx.xx.xx
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