centos离线安装jenkins
 
1、安装java环境,这里我们选择openjdk,当然也可以是JDK
 
[root@localhost repo]
 
2、下载jenkins的yum源的配置文件jenkins.repo
 
[root@localhost repo]
 
3、修改配置文件jenkins.repo
 
[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=0
enabled=1
 
4、下载jenkins到本地
 
[root@localhost repo]
 
5、将/opt/repo文件夹下所有文件上传至非互联网服务器,生成repo源,并创建jenkins.repo文件
 
[root@localhost repo]
[root@localhost repo]
[root@localhost repo]
[jenkins]
name=Jenkins
baseurl=file:///opt/repo
gpgcheck=0
enabled=1
 
6、安装jenkins
 
[root@localhost repo]
 
7、修改端口号并启动jenkins服务
 
[root@localhost repo]
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
JENKINS_PORT="8081"                                             //更改端口至8081
[root@localhost repo]
[root@localhost repo]
● jenkins.service - LSB: Jenkins Automation ServerLoaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)Active: active (running) since 五 2021-01-29 01:29:25 EST; 16min agoDocs: man:systemd-sysv-generator(8)Process: 74861 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)CGroup: /system.slice/jenkins.service└─74902 /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 --we...1月 29 01:29:23 localhost.localdomain systemd[1]: Starting LSB: Jenkins Automation Server...
1月 29 01:29:23 localhost.localdomain runuser[74866]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
1月 29 01:29:24 localhost.localdomain jenkins[74861]: Starting Jenkins [  OK  ]
1月 29 01:29:25 localhost.localdomain systemd[1]: Started LSB: Jenkins Automation Server.
[root@localhost repo]
tcp6       0      0 :::8081                 :::*                    LISTEN      74902/java 
 
8、查看页面、更改管理员密码
 
