Jenkins安裝

Jenkins安裝

官網教程:https://jenkins.io/zh/doc/book/installing/java

  • 系統環境:
    • CentOS7.6.1810 (Core) 
    • IP:192.168.137.111
    • 關閉selinux、firewalld
    • jenkins war包:下載地址
  • java環境:java version "1.8.0_202"
  • 安裝有兩種方式,war包和rpm包

1. war包安裝

下載war包:node

運行:linux

Running from: /tools/jenkins.war
webroot: $user.home/.jenkins
Aug 06, 2019 10:31:18 PM org.eclipse.jetty.util.log.Log initialized
INFO: Logging initialized @433ms to org.eclipse.jetty.util.log.JavaUtilLog
Aug 06, 2019 10:31:18 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Aug 06, 2019 10:31:18 PM org.eclipse.jetty.server.handler.ContextHandler setContextPath
WARNING: Empty contextPath
Aug 06, 2019 10:31:18 PM org.eclipse.jetty.server.Server doStart
INFO: jetty-9.4.z-SNAPSHOT; built: 2019-02-15T16:53:49.381Z; git: eb70b240169fcf1abbd86af36482d1c49826fa0b; jvm 1.8.0_202-b08
Aug 06, 2019 10:31:18 PM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServlet
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Aug 06, 2019 10:31:18 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: DefaultSessionIdManager workerName=node0
Aug 06, 2019 10:31:18 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: No SessionScavenger set, using defaults
Aug 06, 2019 10:31:18 PM org.eclipse.jetty.server.session.HouseKeeper startScavenging
INFO: node0 Scavenging every 660000ms
Jenkins home directory: /root/.jenkins found at: $user.home/.jenkins
Aug 06, 2019 10:31:19 PM org.eclipse.jetty.server.handler.ContextHandler doStart
INFO: Started w.@508dec2b{Jenkins v2.176.2,/,file:///root/.jenkins/war/,AVAILABLE}{/root/.jenkins/war}
Aug 06, 2019 10:31:19 PM org.eclipse.jetty.server.AbstractConnector doStart
INFO: Started ServerConnector@311bf055{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
Aug 06, 2019 10:31:19 PM org.eclipse.jetty.server.Server doStart
INFO: Started @1474ms
Aug 06, 2019 10:31:19 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v4.0 running: controlPort=disabled
Aug 06, 2019 10:31:20 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Aug 06, 2019 10:31:20 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Aug 06, 2019 10:31:23 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Aug 06, 2019 10:31:23 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Aug 06, 2019 10:31:23 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Aug 06, 2019 10:31:24 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Aug 06, 2019 10:31:24 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Aug 06, 2019 10:31:24 PM hudson.util.Retrier start
INFO: Attempt #1 to do the action check updates server
Aug 06, 2019 10:31:27 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@1e48cf8: display name [Root WebApplicationContext]; startup date [Tue Aug 06 22:31:27 CST 2019]; root of context hierarchy
Aug 06, 2019 10:31:27 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@1e48cf8]: org.springframework.beans.factory.support.DefaultListableBeanFactory@52b9cd49
Aug 06, 2019 10:31:27 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@52b9cd49: defining beans [authenticationManager]; root of factory hierarchy
Aug 06, 2019 10:31:28 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@dabec2a: display name [Root WebApplicationContext]; startup date [Tue Aug 06 22:31:28 CST 2019]; root of context hierarchy
Aug 06, 2019 10:31:28 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@dabec2a]: org.springframework.beans.factory.support.DefaultListableBeanFactory@383f7892
Aug 06, 2019 10:31:28 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@383f7892: defining beans [filter,legacy]; root of factory hierarchy
Aug 06, 2019 10:31:28 PM jenkins.install.SetupWizard init
INFO: 

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

efe3217c750442a8849e358b511d8e2f

This may also be found at: /root/.jenkins/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

Aug 06, 2019 10:32:14 PM org.kohsuke.stapler.LocaleDrivenResourceProvider getLocaleDrivenResourceProviders
INFO: Registered LocaleDrivenResourceProvider: jenkins.MetaLocaleDrivenResourceProvider@bb9fc7c
Aug 06, 2019 10:32:49 PM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default
Aug 06, 2019 10:32:50 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
# java -jar jenkins.war

默認端口是8080,指定端口用命令:git

java -jar jenkins.war --httpPort=9090

另外,還能夠Tomcat跑Jenkins,只須要將war包放到tomcat的根目錄(webapps)下,訪問便可。(參考博文:http://www.javashuo.com/article/p-tueyqiby-nm.htmlweb

2. rpm包安裝

 yum方式安裝,先配置repospring

# sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
 
# sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
 
# yum install jenkins –y

 

啓動:瀏覽器

# systemctl start Jenkins

 

3. Jenkins-web

瀏覽器訪問,Jenkins的默認端口8080,tomcat

http://192.168.137.111:8080session

按照界面中的提示,在指定位置獲取解鎖密碼(也是安裝後分配的admin密碼)app

選擇推薦安裝:

自動安裝過程

 

建立用戶,當讓也能夠點擊右下角admin登陸

保存並完成

開始使用

 

相關文章
相關標籤/搜索