centeros 安装 Jenkins
官方地址:https://pkg.jenkins.io/redhat/
1.下载安装
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
yum install jenkins
vim /etc/sysconfig/jenkins
2.修改端口
## Type: integer(0:65535)
## Default: 8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="9080"
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for HTTP requests.
# Default is all interfaces (0.0.0.0).
3.设置jdk配置
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/lib/jvm/java-11.0/bin/java
/usr/lib/jvm/jre-11.0/bin/java
/usr/lib/jvm/java-11-openjdk-amd64
/usr/bin/java
#添加自己的jdk
/opt/software/jdk1.8.0_151/bin/java
- 如有以下警告执行(systemctl daemon-reload)
Starting jenkins (via systemctl): Warning: jenkins.service changed on disk. Run 'systemctl daemon-
- 开启服务
systemctl start jenkins.service
service jenkins start
- 访问地址
http//:127.0.0.1:9080