0% found this document useful (0 votes)
31 views5 pages

Day 22

Uploaded by

chaudheryaws
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views5 pages

Day 22

Uploaded by

chaudheryaws
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

SDLC : Soft development life cycle

Waterfall model

Agile methodology

DevOps - Linux , git , docker , k8s , ansible, teraform , jenkins (CI/


CD)

Jenkins: CI/CD --> opensource


its java + tomcat application server based open source software to provide CI
+ CD

CI: Cont. integration


CD: Cont. Delivery (Release for Test environment) / Cont.
Deployment (Build for prod)

Deployment --> Config / Installation

Attlacian: Confluence , Bamboo (Paid) , Jira, Bitbucket (git hub)

Travis CI

Circle CI
---------------------------

github / gitlab --> actions --> CI / CD

---------------------------

SonarQube: Continouse inspection of code quality and also we can integrate this
tool inside the jenkins pipeline.

----------------------------------------------------------------------
For jenkins we require java and tomcat server.
We must install headless kernel (Devel) of java because we are using CLI.

Step-0 create new machine with 4GB RAm and min 2 CPU ( t3.mdedium)

Step-1 yum update -y

Step-2

yum install java-17-amazon-corretto-headless -y

yum install java-17-amazon-corretto-devel -y

alternatives --config java

Step-3
java --version

Step-3.1
configure environemt variable in linux ( /root/.bash_profile )

find / -name java

vi /root/.bash_profile

export JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64

Save & exit

source /root/.bash_profile

echo $JAVA_HOME

Step-4 set hostname and date time

hostnamectl set-hostname jenkins.tg.com

timedatectl set-timezone 'Asia/Kolkata'

bash

Step-5 Cross check your security group for port 22 accessbiable for cluster
machine ( Master + wn1 + wn2 )

Also make sure port number 8080 is open for wolrd wide
Because jenkins uses apache tomcat app server and its port number 8080 / TCP

Step-6

Open official URL of jenkins now :


------------------------------------------------
https://www.jenkins.io/doc/book/installing/linux/

wget -O /etc/yum.repos.d/jenkins.repo
https://pkg.jenkins.io/redhat-stable/jenkins.repo

rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key

yum upgrade

# Add required dependencies for the jenkins package ( already installed)

yum install java-17-amazon-corretto-headless -y

yum install java-17-amazon-corretto-devel -y

alternatives --config java

yum install jenkins -y

systemctl daemon-reload

Step-6 Now start jenkins server and config its default user :
systemctl start jenkins && systemctl enable jenkins

netstat -plant

Step-6.1 Config jenkins server default user.

cat /etc/passwd | grep jenkins

su - jenkins

whoami

usermod -s /bin/bash jenkins

Step-7 Now create jenkin as sudo user ( Just like Super user root )

vi /etc/sudoers.d/jenkins

jenkins ALL=(ALL) NOPASSWD: ALL

Step-8 Install some require package on jenkins

yum install docker git -y

Step-9 Now Edit and add your hostname and cluster machine names in your
/etc/hosts

vi /etc/hosts

172.31.82.153 jenkins.tg.com
172.31.10.231 master.tg.com master
172.31.4.40 wn1.tg.com wn1
172.31.9.139 wn2.tg.com wn2

Step-10 create your ssh public key for JENKINS user and share with Master node
only.

su - jenkins

ssh-keygen -t rsa

pwd

/var/lib/jenkins

Now share this public key with Master node


cat /var/lib/jenkins/.ssh/id_rsa.pub

now share this above id_rsa.pub key with Master node root user

Login to master node

vi /root/.ssh/authorized_keys

Now paste jenkins user public key

Save and exit

and cross test from jenkins user

pwd

whoami

ssh [email protected]

Now logout

exit

Step-11 Now open jenkins server PUBLIC IP with port number 8080

http://18.234.207.242:8080/

Select default plungins

and proceed for next

Step-12

install java on Master node for communication between Jenkins server target server.

Jenkin server --> jenkins.tg.com

Target server --> master.tg.com

yum install java-17-amazon-corretto-headless -y

yum install java-17-amazon-corretto-devel -y

alternatives --config java

find / -name java

vi /root/.bash_profile

export JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64
source /root/.bash_profile

echo $JAVA_HOME

Step-12.1

For CI / CD pipeline we require git software jenkins as well master node (TARGET
node)

Go to master.tg.com

yum install git -y

Step-13 Sync Jenkins server with Master node

DIY

Step-14 Download and use following tomcat git location

[email protected]:cdtsbikaner/tomcat8.git

You might also like