How to start, stop, restart, and reload the Jenkins server

Jenkins address:

http://localhost:8080/

overview

Using a common URL method, Jenins can be stopped, restarted and reloaded.

http://[jenkins-server-address][:port]/[command]
## 其中,command可以是
## exit    to shutdown jenkins 
## restart to restart jenkins 
## reload  to reload the configuration

start jenkins

## 启动jenkins服务器
java -jar jenkins.war

## 带更多参数启动jenkins服务器
/etc/alternatives/java
       -Dcom.sun.akuma.Daemon=daemonized
       -Djava.awt.headless=true 
       -DJENKINS_HOME=/var/lib/jenkins 
       -jar /usr/lib/jenkins/jenkins.war 
      --logfile=/var/log/jenkins/jenkins.log 
      --webroot=/var/cache/jenkins/war
      --daemon 
      --httpPort=8080 
      --debug=5 
      --handlerCountMax=100 
      --handlerCountMaxIdle=20

restart jenkins

Browser input:

http://localhost:8080/restart

Click 'Yes', as shown in the figure: 

 Overload the configuration information of the jenkins server

Browser input:

http://localhost:8080/reload

Click 'Try POSTing', as shown in the figure:

stop the jenkins server

Method 1. Terminal and Kill Process

$ ps -ef |grep jenkins.war
jenkins   24195      1  9 3\u670809 ?       7-02:37:20 /etc/alternatives/java -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
root     566967 564263  0 10:01 pts/14   00:00:00 grep --color=auto jenkins.war
$ kill -9 24195

Method 2. Via URL

Browser input:

http://localhost:8080/exit

 Click 'Try POSTing', as shown in the figure:

 

Guess you like

Origin blog.csdn.net/m0_46829545/article/details/130821516