CentOS7下yum安装Jenkins

1.下载软件仓库

[root@centos software]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

2.导入秘钥

[root@centos software]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

3.安装jenkins

[root@centos software]# yum install jenkins -y

4.检查是否已安装JDK

[root@centos software]# java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

5.查找jenkins安装路径

jenkins安装路径

jenkins相关目录释义:
(1)/usr/lib/jenkins/:jenkins安装目录,war包会放在这里。
(2)/etc/sysconfig/jenkins:jenkins配置文件,“端口”,“JENKINS_HOME”等都可以在这里配置。
(3)/var/lib/jenkins/:默认的JENKINS_HOME。
(4)/var/log/jenkins/jenkins.log:jenkins日志文件。

6.配置jenkins
(1)查找jenkins端口

1.打开jenkins配置文件
[root@centos software]# vim /etc/sysconfig/jenkins
2.修改端口
JENKINS_PORT="8080"   # 修改端口为没有被占用端口
3.esc  :wq  保存退出

(2)启动Jenkins

[root@centos software]# systemctl  start jenkins

(3)查看进程/日志

[root@centos software]# ps aux | grep jenkins
root       7135  0.1 27.7 2378656 276832 ?      Ssl  Mar31   1:12 /usr/bin/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
root      10196  0.0  0.0 112708   980 pts/1    R+   08:09   0:00 grep --color=auto jenkins

#可以看到Jenkins已经启动

(4)访问jenkins入口  安装主机IP:port

查看主机IP

[root@centos software]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:2a:5d:a1 brd ff:ff:ff:ff:ff:ff
    inet 172.16.66.3/24 brd 172.16.66.255 scope global noprefixroute ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe2a:5da1/64 scope link 
       valid_lft forever preferred_lft forever


#可以看到ip地址为  172.16.66.3  访问jenkins   172.16.66.3:8080

到这里后,再往下操作可参考之前的windows安装jenkins

GitHub 加速计划 / li / linux-dash
6
1
下载
A beautiful web dashboard for Linux
最近提交(Master分支:3 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐