centos离线安装jenkins
生活随笔
收集整理的這篇文章主要介紹了
centos离线安装jenkins
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
centos離線安裝jenkins
1、安裝java環境,這里我們選擇openjdk,當然也可以是JDK
[root@localhost repo]# yum install -y java2、下載jenkins的yum源的配置文件jenkins.repo
[root@localhost repo]# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo3、修改配置文件jenkins.repo
[jenkins] name=Jenkins baseurl=http://pkg.jenkins.io/redhat gpgcheck=0 enabled=14、下載jenkins到本地
[root@localhost repo]# yum install --downloadonly --downloaddir=/opt/repo jenkins5、將/opt/repo文件夾下所有文件上傳至非互聯網服務器,生成repo源,并創建jenkins.repo文件
[root@localhost repo]# yum install createrepo [root@localhost repo]# createrepo . [root@localhost repo]# vi /etc/yum.repos.d/jenkins.repo [jenkins] name=Jenkins baseurl=file:///opt/repo gpgcheck=0 enabled=16、安裝jenkins
[root@localhost repo]# yum install -y jenkins7、修改端口號并啟動jenkins服務
[root@localhost repo]# vim /etc/sysconfig/jenkins ## Type: string ## Default: "-Djava.awt.headless=true" ## ServiceRestart: jenkins # # Options to pass to java when running Jenkins. # JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true" ## Type: integer(0:65535) ## Default: 8080 ## ServiceRestart: jenkins # # Port Jenkins is listening on. # Set to -1 to disable # JENKINS_PORT="8081" //更改端口至8081 ## Type: string [root@localhost repo]# systemctl restart jenkins [root@localhost repo]# systemctl status jenkins ● 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]# netstat -nltp |grep 8081 tcp6 0 0 :::8081 :::* LISTEN 74902/java8、查看頁面、更改管理員密碼
總結
以上是生活随笔為你收集整理的centos离线安装jenkins的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: texlive 2020下载与安装
- 下一篇: django开发环境搭建