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

Xftp download and installation tutorial (graphic tutorial)

If you want to transfer files between Windows and...

Use of Linux telnet command

1. Introduction The telnet command is used to log...

How to track users with JS

Table of contents 1. Synchronous AJAX 2. Asynchro...

A brief discussion on the three major issues of JS: asynchrony and single thread

Table of contents Single thread asynchronous Sing...

MySQL million-level data paging query optimization solution

When there are tens of thousands of records in th...

Example of how to install kong gateway in docker

1. Create a Docker network docker network create ...

JS deep and shallow copy details

Table of contents 1. What does shallow copy mean?...

Example of Form action and onSubmit

First: action is an attribute of form. HTML5 has d...

Two ways to use react in React html

Basic Use <!DOCTYPE html> <html lang=&qu...

Tips for creating two-dimensional arrays in JavaScript

Creation of a two-dimensional array in Js: First ...

Some points on using standard HTML codes in web page creation

<br />The most common mistake made by many w...

Example of creating table statements for user Scott in MySQL version of Oracle

Overview: Oracle scott user has four tables, whic...

IE8 compatibility notes I encountered

1. IE8's getElementById only supports id, not ...