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

Devops Notes

The document describes the steps taken to install Java, Maven, and Jenkins on a CentOS server. It involves downloading and extracting the software packages, configuring environment variables, and starting the Jenkins service. Key commands used include mv, tar, vi, source, yum, and systemctl.

Uploaded by

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

Devops Notes

The document describes the steps taken to install Java, Maven, and Jenkins on a CentOS server. It involves downloading and extracting the software packages, configuring environment variables, and starting the Jenkins service. Key commands used include mv, tar, vi, source, yum, and systemctl.

Uploaded by

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

In yesterday calss we have copied java file using winscp to /home/centos location

today we moved same file to /opt path using below command and extracted it using
tar command
mv jdk-8u171-linux-x64.tar.gz /opt
cd /opt
tar -xvf jdk-8u171-linux-x64.tar.gz
list them using command (ls)
cd jdk1.8.0_171

we need to set up environmental variables using below command


vi ~/.bashrc (to setup the environment variable in linux we are using ~/.bashrc
file)
add below two lines and save the vi editor using esc :wq!
export JAVA_HOME=/opt/jdk1.8.0_171
export PATH=$PATH:JAVA_HOME/bin

now run source command to restart the environment variables using below command
source ~/.bashrc (to restart the environment variable we are using this command)
check for java version using (java -version) to see wether java is installed or
not. If you are getting command not found then it means java is not installed in
the server
yum install java -y
check for java version and it should reflect now (java -version)

now we need to install maven


check for the version if it is installed using
mvn -version
if you are getting command not found need to follow same process for installing
maven
cd /home/centos
yum install wget -y( to install the java package)
wget http://www.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-
bin.tar.gz (to download the package from internet or web)
file(apache-maven-3.3.9-bin.tar.gz) will be downloaded under the path /home/centos
go to cd /usr/local and create a directory
mkdir apache-maven
cd apache-maven
now got to cd /home/centos and untar the file
tar -xzf apache-maven-3.3.9-bin.tar.gz

now copy the file from /home/centos/ to /usr/local/apache-maven


cp -r * /usr/local/apache-maven/
cd /usr/local/apache-maven/
need to set environment variables for maven using below commands
vi ~/.bashrc
add
export M2_HOME=/usr/local/apache-maven
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
and save the file

move the contents of apache 3.3.9 to apache-maven


run source ~/.bashrc to restart the environment variable
check for the version of maven
mvn -version

now we need to install epl following below steps


yum install epel-release -y
then
wget -O /etc/yum.repos.d/jenkins.repo
http://pkg.jenkins.io/redhat-stable/jenkins.repo

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

yum install jenkins -y

if we get any compatability error then we need to run below commands


rm -rf /etc/yum.repos.d/jenkins.repo
rm -fr /var/cache/yum/*
yum repolist
yum remove jenkins -y
yum install epel-release -y
wget -O /etc/yum.repos.d/jenkins.repo
http://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins-2.346.1
systemctl start jenkins
systemctl status jenkins

You might also like