IO /debian-stab…

Jenkins. IO /zh/doc/book…

First, install Jenkins under Linux

A, install,

1, Download Jenkins dependence

If not root, add sudo

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

2. Import the key

rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.keyCopy the code


yum install jenkins Install the latest version by default, and wait a long time for installation, about 25minCopy the code



4. Check whether JDK is installed before startup

java   Display Java parameters to prove that JDK has been installedCopy the code

5. Find the Jenkins installation path

rpm -ql jenkinsCopy the code

Jenkins Installation path

/usr/lib/jenkins: the Jenkins installation directory, where the Jenkins war package will be stored. (2) /etc/sysconfig/Jenkins: Jenkins configuration file, “port”, “JENKINS_HOME”, etc can be configured here. (3) /var/lib/jenkins/ : default JENKINS_HOME. (4) the/var/log/Jenkins Jenkins. Log: Jenkins log file.

6. Configure Jenkins (1) Find Jenkins port

Vim/etc/sysconfig/Jenkins:setIgnorecase/jenkins_port enterCopy the code

Jenkins port 8080

(2) Check the usage of other ports

netstat -ntlpCopy the code

The occupied port is displayed

If the occupied port does not conflict with Jenkins port 8080, you can start Jenkins in the next step

(3) Start Jenkins

java -jar /usr/lib/jenkins/jenkins.war --httpPort=8080Copy the code

(4) Modify Jenkins port If port 8080 is not occupied by default, no modification is required. If port 8080 is occupied, modify the port to another port and open the corresponding port

Port 8899

java -jar /usr/lib/jenkins/jenkins.war --ajp13Port=-1 --httpPort=8899Copy the code
# start

java -jar /usr/lib/jenkins/jenkins.war --httpPort=8899Copy the code

Start to finish

(5) verify Jenkins will open In hosting the browser type http://IP:Port I enter here: http://192.168.114.128:8080 (input after the modification of port: http://192.168.114.128:8899)

Enter the Jenkins decryption screen

cat /var/lib/jenkins/secrets/initialAdminPasswordCopy the code

To get the password

=> Obtain the password => Enter the password => Continue => Install the plug-in => Retry Several times. => Register the account (record the account password) => Start using Jenkins

getting started

ERROR: Linux / Centos:

Job for jenkins.service failed because the control process exited with error code. See “systemctl status jenkins.service” and “journalctl -xe” for details

Solution :

sudo vi /etc/init.d/jenkins

Add your own java path:

/ opt/oracle/product/Java/jdk1.8.0 _45 / bin/Java

sudo service jenkins start

sudo service jenkins status

sudo service jenkins stop

Method 2:

Lead in

wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repoCopy the code
rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.keyCopy the code

The installation

yum install jenkinsCopy the code

Start the

D/Jenkins: /etc/rc.d/init.d/ Jenkins: /etc/rc.d/init.d/ Jenkins: /etc/rc.d/init.d/ Jenkins: /etc/rc.d

# Search usable Java. We do this because various reports indicated

# that /usr/bin/java may not always point to Java >= 1.6

# see www.nabble.com/guinea-pigs…

candidates=”

/etc/alternatives/java

The/usr/lib/JVM/Java 1.6.0 / bin/Java

The/usr/lib/JVM/jre – 1.6.0 / bin/Java

The/usr/lib/JVM/Java – 1.7.0 / bin/Java

The/usr/lib/JVM/jre – 1.7.0 / bin/Java

The/usr/lib/JVM/Java – 1.8.0 comes with/bin/Java

The/usr/lib/JVM/jre – 1.8.0 comes with/bin/Java

/usr/bin/java

/ data/Java/jdk1.8.0 _101 / bin/Java

Start command:

systemctl daemon-reload

systemctl enable jenkins

systemctl start jenkins

// Another website

Blog.csdn.net/qq_34599132…