Jenkins 基础3

2022-03-21 17:55:05 浏览数 (1)

启停

启动

代码语言:javascript复制
[root@h101 ~]# /etc/init.d/jenkins start 
Starting Jenkins                                           [  OK  ]
[root@h101 ~]# ps faux | grep jenkins
root      4064  0.0  0.0 103256   828 pts/0    S    20:32   0:00  |       _ grep jenkins
jenkins   3973 88.6 13.9 2206040 266288 ?      Ssl  20:32   0:17 /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 --ajp13Port=8009 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
[root@h101 ~]# netstat  -ant | grep 8080
tcp        0      0 :::8080                     :::*                        LISTEN      
tcp        0      0 ::ffff:192.168.100.101:8080 ::ffff:192.168.100.1:58628  TIME_WAIT   
[root@h101 ~]# 
  • Jenkins 会作为一个服务在系统后台运行
  • /etc/init.d/jenkins 会提供详细信息,包括实际运行了什么,配置文件的位置
  • 初始配置在 /etc/sysconfig/jenkins
  • 默认情况下Jenkins会监听在 8080 端口(可以使用/etc/sysconfig/jenkins修改),要打开防火墙 , 可以使用本地的浏览器进行访问
  • jenkins 用户会被创建,并且以它的身份运行服务

Note: If you change this to a different user via the config file, you must change the owner of /var/log/jenkins, /var/lib/jenkins, and /var/cache/jenkins

  • 日志会被记到 /var/log/jenkins/jenkins.log

配置

代码语言:javascript复制
[root@h101 ~]# grep -v "^#" /etc/sysconfig/jenkins  | grep -v "^$"
JENKINS_HOME="/var/lib/jenkins"
JENKINS_JAVA_CMD=""
JENKINS_USER="jenkins"
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
JENKINS_PORT="8080"
JENKINS_LISTEN_ADDRESS=""
JENKINS_HTTPS_PORT=""
JENKINS_HTTPS_KEYSTORE=""
JENKINS_HTTPS_KEYSTORE_PASSWORD=""
JENKINS_HTTPS_LISTEN_ADDRESS=""
JENKINS_AJP_PORT="8009"
JENKINS_AJP_LISTEN_ADDRESS=""
JENKINS_DEBUG_LEVEL="5"
JENKINS_ENABLE_ACCESS_LOG="no"
JENKINS_HANDLER_MAX="100"
JENKINS_HANDLER_IDLE="20"
JENKINS_ARGS=""
[root@h101 ~]# 

0 人点赞