centos7 安裝jenkins
安裝JDK1.8 略
使用 yum 進行安裝jenkins
#安裝自動選擇最快源的外掛
[root@vrgv /]# yum install yum-fastestmirror -y
#安裝jenkins最新版本
[root@vrgv /]# sudo wget -O /etc/yum.repos.d/jenkins.repo http://jenkins-ci.org/redhat/jenkins.repo
--2020-12-01 14:39:02-- http://jenkins-ci.org/redhat/jenkins.repo
正在解析主機 jenkins-ci.org (jenkins-ci.org)... 52.167.253.43
正在連線 jenkins-ci.org (jenkins-ci.org)|52.167.253.43|:80... 已連線。
已發出 HTTP 請求,正在等待迴應... 301 Moved Permanently
位置:https://www.jenkins.io/redhat/jenkins.repo [跟隨至新的 URL]
--2020-12-01 14:39:02-- https://www.jenkins.io/redhat/jenkins.repo
正在解析主機 www.jenkins.io (www.jenkins.io)... 151.101.78.133, 2a04:4e42:12::645
正在連線 www.jenkins.io (www.jenkins.io)|151.101.78.133|:443... 已連線。
已發出 HTTP 請求,正在等待迴應... 301 Moved Permanently
位置:https://pkg.jenkins.io/redhat/jenkins.repo [跟隨至新的 URL]
--2020-12-01 14:39:49-- https://pkg.jenkins.io/redhat/jenkins.repo
正在解析主機 pkg.jenkins.io (pkg.jenkins.io)... 151.101.78.133, 2a04:4e42:12::645
正在連線 pkg.jenkins.io (pkg.jenkins.io)|151.101.78.133|:443... 已連線。
已發出 HTTP 請求,正在等待迴應... 200 OK
長度:71
正在儲存至: “/etc/yum.repos.d/jenkins.repo”
100%[================================================================================================================================================================================================>] 71 --.-K/s 用時 0s
2020-12-01 14:39:49 (1.63 MB/s) - 已儲存 “/etc/yum.repos.d/jenkins.repo” [71/71])
[root@vrgv /]# yum install jenkins
已載入外掛:fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: d2lzkl7pfhq30w.cloudfront.net
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解決依賴關係
--> 正在檢查事務
---> 軟體包 jenkins.noarch.0.2.268-1.1 將被 安裝
--> 解決依賴關係完成
依賴關係解決
==========================================================================================================================================================================================================================================
Package 架構 版本 源 大小
==========================================================================================================================================================================================================================================
正在安裝:
jenkins noarch 2.268-1.1 jenkins 67 M
事務概要
==========================================================================================================================================================================================================================================
安裝 1 軟體包
總計:67 M
安裝大小:68 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/jenkins/packages/jenkins-2.268-1.1.noarch.rpm: 頭V4 RSA/SHA512 Signature, 金鑰 ID 45f2c3d5: NOKEY
jenkins-2.268-1.1.noarch.rpm 的公鑰尚未安裝
[root@vrgv /]# yum install jenkins -y --nogpgcheck #由於公鑰安裝失敗,新增--nogpgcheck引數跳過驗證公鑰
已載入外掛:fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: d2lzkl7pfhq30w.cloudfront.net
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解決依賴關係
--> 正在檢查事務
---> 軟體包 jenkins.noarch.0.2.268-1.1 將被 安裝
--> 解決依賴關係完成
依賴關係解決
==========================================================================================================================================================================================================================================
Package 架構 版本 源 大小
==========================================================================================================================================================================================================================================
正在安裝:
jenkins noarch 2.268-1.1 jenkins 67 M
事務概要
==========================================================================================================================================================================================================================================
安裝 1 軟體包
總計:67 M
安裝大小:68 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安裝 : jenkins-2.268-1.1.noarch 1/1
驗證中 : jenkins-2.268-1.1.noarch 1/1
已安裝:
jenkins.noarch 0:2.268-1.1
完畢!
#啟動jenkins檢視啟動日誌
[root@vrgv /]# systemctl start jenkins [root@vrgv /]# systemctl status jenkins ● jenkins.service - LSB: Jenkins Automation Server Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled) Active: active (running) since 二 2020-12-01 14:42:41 CST; 4s ago Docs: man:systemd-sysv-generator(8) Process: 39515 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS) CGroup: /system.slice/jenkins.service └─39560 /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/jenk... 12月 01 14:42:38 vrgv systemd[1]: Starting LSB: Jenkins Automation Server... 12月 01 14:42:38 vrgv runuser[39520]: pam_unix(runuser:session): session opened for user jenkins by (uid=0) 12月 01 14:42:40 vrgv runuser[39520]: pam_unix(runuser:session): session closed for user jenkins 12月 01 14:42:41 vrgv jenkins[39515]: Starting Jenkins [ 確定 ] 12月 01 14:42:41 vrgv systemd[1]: Started LSB: Jenkins Automation Server. [root@vrgv /]# tail -f /var/log/jenkins/jenkins.log 2020-12-01 06:42:42.353+0000 [id=1] WARNING winstone.Logger#logInternal: Parameter handlerCountMaxIdle is now deprecated 2020-12-01 06:42:42.409+0000 [id=1] INFO org.eclipse.jetty.util.log.Log#initialized: Logging initialized @1519ms to org.eclipse.jetty.util.log.JavaUtilLog 2020-12-01 06:42:42.648+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extraction from war file 2020-12-01 06:42:48.995+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath 2020-12-01 06:42:49.268+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-9.4.33.v20201020; built: 2020-10-20T23:39:24.803Z; git: 1be68755656cef678b79a2ef1c2ebbca99e25420; jvm 1.8.0_262-b10 2020-12-01 06:42:52.262+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet 2020-12-01 06:42:52.781+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0 2020-12-01 06:42:52.782+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults 2020-12-01 06:42:52.785+0000 [id=1] INFO o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 660000ms 2020-12-01 06:42:56.816+0000 [id=1] INFO hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/lib/jenkins found at: SystemProperties.getProperty("JENKINS_HOME") 2020-12-01 06:42:59.333+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStart: Started w.@88d6f9b{Jenkins v2.268,/,file:///var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/war} 2020-12-01 06:42:59.541+0000 [id=1] INFO o.e.j.server.AbstractConnector#doStart: Started ServerConnector@4bff7da0{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} 2020-12-01 06:42:59.542+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: Started @18652ms 2020-12-01 06:42:59.544+0000 [id=23] INFO winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled 2020-12-01 06:43:03.395+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: Started initialization 2020-12-01 06:43:03.536+0000 [id=32] INFO jenkins.InitReactorRunner$1#onAttained: Listed all plugins 2020-12-01 06:43:10.651+0000 [id=31] INFO jenkins.InitReactorRunner$1#onAttained: Prepared all plugins 2020-12-01 06:43:10.667+0000 [id=31] INFO jenkins.InitReactorRunner$1#onAttained: Started all plugins 2020-12-01 06:43:10.704+0000 [id=31] INFO jenkins.InitReactorRunner$1#onAttained: Augmented all extensions 2020-12-01 06:43:13.807+0000 [id=34] INFO jenkins.InitReactorRunner$1#onAttained: System config loaded 2020-12-01 06:43:13.808+0000 [id=34] INFO jenkins.InitReactorRunner$1#onAttained: System config adapted 2020-12-01 06:43:13.809+0000 [id=34] INFO jenkins.InitReactorRunner$1#onAttained: Loaded all jobs 2020-12-01 06:43:13.813+0000 [id=34] INFO jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated 2020-12-01 06:43:13.962+0000 [id=48] INFO hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Download metadata 2020-12-01 06:43:13.998+0000 [id=48] INFO hudson.util.Retrier#start: Attempt #1 to do the action check updates server 2020-12-01 06:43:15.227+0000 [id=28] INFO jenkins.install.SetupWizard#init: ************************************************************* ************************************************************* ************************************************************* Jenkins initial setup is required. An admin user has been created and a password generated. Please use the following password to proceed to installation: 5455f8745e3e4d77913cb58365d37e5c ###第一次啟動需要驗證此密碼 This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
瀏覽器輸入http://ip:8080即可進入到jenkins介面