Detailed explanation of the installation process of Jenkins on CentOS 7

Detailed explanation of the installation process of Jenkins on CentOS 7

Install Jenkins via Yum

1. Installation

# yum source import wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
# Import key rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
# Install yum install -y jenkins

2. Open Ports

# The port can be modified in the /etc/sysconfig/jenkins file, the default is 8080
firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --reload

3. Configure Java path

# Modify the jenkins startup script vim /etc/init.d/jenkins

# Modify candidates to add java optional path: /usr/java/jdk1.8.0_181/bin/java
candidates="
/etc/alternatives/java
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/jre-1.8.0/bin/java
/usr/lib/jvm/java-1.7.0/bin/java
/usr/lib/jvm/jre-1.7.0/bin/java
/usr/bin/java
/usr/java/jdk1.8.0_181/bin/java
"

4. Start Jenkins and set it to start at boot

#Reload the service (due to the modification of the Jenkins startup script)
systemctl daemon-reload

#Start the Jenkins service systemctl start jenkins

#Set the Jenkins service to start at boot #Since Jenkins is not a native service, you need to use the chkconfig command instead of the systemctl command /sbin/chkconfig jenkins on

5. Jenkins Initialization

Use cat /var/lib/jenkins/secrets/initialAdminPassword to view the password, enter it on the Jenkins management page to unlock it, and then you can perform visual operations!

When you start Jenkins for the first time, you may see the page display "Please wait while Jenkins is getting ready to work ...". Edit the /var/lib/jenkins/hudson.model.UpdateCenter.xml file and change "https://updates.jenkins.io/update-center.json" to "http://mirror.xmission.com/jenkins/updates/update-center.json".

6. Others

6.1 Set Jenkins time zone to Beijing time

Open [System Management] -> [Script Command Line] and run the following command

System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'Asia/Shanghai')

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed steps to install Jenkins on centos 7 system
  • How to install Jenkins on CentOS
  • Setting up GitLab+Jenkins continuous integration environment under centos (installing Jenkins)
  • How to install Jenkins on CentOS 8
  • CentOS 7 installation of Jenkins detailed introduction
  • Complete steps to install Jenkins under CentOS

<<:  Detailed example of jQuery's chain programming style

>>:  Troubleshooting and solutions for MySQL auto-increment ID oversize problem

Recommend

MySQL string splitting operation (string interception containing separators)

String extraction without delimiters Question Req...

How to configure https for nginx in docker

Websites without https support will gradually be ...

Vue implements image drag and drop function

This article example shares the specific code of ...

Detailed explanation of the use of React list bar and shopping cart components

This article example shares the specific code of ...

Detailed Tutorial on Using xargs Command on Linux

Hello everyone, I am Liang Xu. When using Linux, ...

Solve the problem of docker's tls (ssl) certificate expiration

Problem phenomenon: [root@localhost ~]# docker im...

Detailed explanation of TS object spread operator and rest operator

Table of contents Overview Object rest attribute ...

MYSQL subquery and nested query optimization example analysis

Check the top 100 highest scores in game history ...

Implementation of fastdfs+nginx cluster construction

1. Introduction to fastdfs 1. What is fastdfs Fas...

JavaScript Sandbox Exploration

Table of contents 1. Scenario 2. Basic functions ...

MySQL helps you understand index pushdown in seconds

Table of contents 1. The principle of index push-...