<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Jenkins - 在Rocky Linux系統下安裝Jenkins和配置Agent節點

      安裝Jenkins

      主節點下載和安裝Jenkins LTS版本

      本機信息

      [root@localhost ~]# cat /etc/system-release
      Rocky Linux release 9.4 (Blue Onyx)
      [root@localhost ~]# 
      [root@localhost ~]# uname -a
      Linux localhost.localdomain 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 28 17:34:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
      [root@localhost ~]# 
      

      官方安裝文檔
      https://www.jenkins.io/doc/book/installing/linux/#red-hat-centos

      下載和安裝Jenkins LTS版本

      wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
      rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
      yum upgrade
      yum install fontconfig java-17-openjdk -y
      yum install jenkins
      systemctl daemon-reload
      

      確認版本

      [root@localhost ~]# java -version
      openjdk version "17.0.12" 2024-07-16 LTS
      OpenJDK Runtime Environment (Red_Hat-17.0.12.0.7-1) (build 17.0.12+7-LTS)
      OpenJDK 64-Bit Server VM (Red_Hat-17.0.12.0.7-1) (build 17.0.12+7-LTS, mixed mode, sharing)
      [root@localhost ~]# 
      [root@localhost jenkins]# java -jar /usr/share/java/jenkins.war --version
      2.462.1
      [root@localhost jenkins]#
      

      一些網絡配置

      關閉防火墻

       systemctl stop firewalld
       systemctl disable firewalld
      

      關閉SELINUX

      [root@localhost ~]# sestatus
      SELinux status:                 enabled
      SELinuxfs mount:                /sys/fs/selinux
      SELinux root directory:         /etc/selinux
      Loaded policy name:             targeted
      Current mode:                   enforcing
      Mode from config file:          enforcing
      Policy MLS status:              enabled
      Policy deny_unknown status:     allowed
      Memory protection checking:     actual (secure)
      Max kernel policy version:      33
      [root@localhost ~]# 
      [root@localhost ~]# vim /etc/sysconfig/selinux
      [root@localhost ~]# cat /etc/sysconfig/selinux |grep "SELINUX=" |grep -v "#"
      SELINUX=disabled
      [root@localhost ~]# 
      [root@localhost ~]# reboot
      [root@localhost ~]# 
      [root@localhost ~]# sestatus
      SELinux status:                 disabled
      [root@localhost ~]# 
      

      啟動和初始化Jenkins

      啟動Jenkins

      [root@localhost ~]# systemctl enable jenkins
      Created symlink /etc/systemd/system/multi-user.target.wants/jenkins.service → /usr/lib/systemd/system/jenkins.service.
      [root@localhost ~]# systemctl start jenkins
      [root@localhost ~]# systemctl status jenkins
      ● jenkins.service - Jenkins Continuous Integration Server
           Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; preset: disabled)
           Active: active (running) since Mon 2024-09-02 10:36:06 CST; 8s ago
         Main PID: 42838 (java)
            Tasks: 51 (limit: 48820)
           Memory: 551.8M
              CPU: 28.391s
           CGroup: /system.slice/jenkins.service
                   └─42838 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080
      
      Sep 02 10:35:56 localhost.localdomain jenkins[42838]: 502ee818dd62450f9f0a4156a90f5e95
      Sep 02 10:35:56 localhost.localdomain jenkins[42838]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
      Sep 02 10:35:56 localhost.localdomain jenkins[42838]: *************************************************************
      Sep 02 10:35:56 localhost.localdomain jenkins[42838]: *************************************************************
      Sep 02 10:35:56 localhost.localdomain jenkins[42838]: *************************************************************
      Sep 02 10:36:06 localhost.localdomain jenkins[42838]: 2024-09-02 02:36:06.367+0000 [id=34]        INFO        jenkins.InitReactorRunner$1#on>
      Sep 02 10:36:06 localhost.localdomain jenkins[42838]: 2024-09-02 02:36:06.388+0000 [id=24]        INFO        hudson.lifecycle.Lifecycle#onR>
      Sep 02 10:36:06 localhost.localdomain systemd[1]: Started Jenkins Continuous Integration Server.
      Sep 02 10:36:07 localhost.localdomain jenkins[42838]: 2024-09-02 02:36:07.459+0000 [id=49]        INFO        h.m.DownloadService$Downloadab>
      Sep 02 10:36:07 localhost.localdomain jenkins[42838]: 2024-09-02 02:36:07.460+0000 [id=49]        INFO        hudson.util.Retrier#start: Per>
      [root@localhost ~]# 
      

      初始配置Jenkins

      1. 瀏覽器訪問頁面 http://192.168.16.200:8080/
      2. 根據提示查看初始登錄密碼:cat /var/lib/jenkins/secrets/initialAdminPassword
      3. 配置插件:默認不選,需要時再安裝
      4. 創建第一個管理員用戶
      5. 完成初始化

      安裝和配置Jenkins Agent節點

      在主節點配置Node

      登錄Jenkins頁面:
      Dashboard --》Manage Jenkins --》Nodes --》New node --》輸入名稱,并選擇類型 Permanent Agent --》依次進行選項配置

      • Name: JenkinsAgent-Build01
      • Description: Build agent node - 01
      • Number of executors: 5
      • Remote root directory: /opt/JenkinsAgent
      • Labels: build maven linux
      • Usage: Only build jobs with label expressions matching this node
      • Launch method: Launch agent by connecting it to the controller
      • Availability: Keep this agent online as much as possible
      • Node Properties: null

      主節點開啟TCP端口
      Dashboard --> Manage Jenkins --> Security --> Agents --> TCP port for inbound agents --> 選擇 Fixed --> 添加端口 12345

      主節點執行器數量修改
      Dashboard --》Nodes --》Built-In Node --》Configure --》 Number of executors,修改為0
      Note:主節點一般不執行流水線任務

      在Node主機上配置Agent節點

      在主節點上可以查看到需要在Node主機執行的命令
      Dashboard --》Manage Jenkins --》Nodes --》JenkinsAgent-Build01

      # Run from agent command line: (Unix) 
      mkdir /opt/JenkinsAgent
      cd /opt
      curl -sO http://192.168.16.200:8080/jnlpJars/agent.jar
      java -jar /opt/agent.jar -url http://192.168.16.200:8080/ -secret 4e1e31e059bbb8248e90e07acace1d084b04756a62c253c1a0680c0b3513b75a -name "JenkinsAgent-Build01" -workDir "/opt/JenkinsAgent"
      

      Note:每次主節點重啟后,對應的-secret的值都會發生變化

      關閉防火墻

      systemctl stop firewalld
      systemctl disable firewalld
      

      關閉SELINUX

      [root@localhost ~]# vim /etc/sysconfig/selinux
      [root@localhost ~]# cat /etc/sysconfig/selinux |grep "SELINUX=" |grep -v "#"
      SELINUX=disabled
      [root@localhost ~]# reboot
      [root@localhost ~]# sestatus
      SELinux status:                 disabled
      [root@localhost ~]# 
      

      推薦以nohup方式啟動Jenkins Agent

      nohup java -jar /opt/agent.jar -url http://192.168.16.200:8080/ -secret 4e1e31e059bbb8248e90e07acace1d084b04756a62c253c1a0680c0b3513b75a -name "JenkinsAgent-Build01" -workDir "/opt/JenkinsAgent" &
      

      Agent啟動日志

      [root@localhost opt]# java -jar agent.jar -url http://192.168.16.200:8080/ -secret 4e1e31e059bbb8248e90e07acace1d084b04756a62c253c1a0680c0b3513b75a -name "JenkinsAgent-Build01" -workDir "/opt/JenkinsAgent"
      Sep 02, 2024 12:57:31 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
      INFO: Using /opt/JenkinsAgent/remoting as a remoting work directory
      Sep 02, 2024 12:57:31 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
      INFO: Both error and output logs will be printed to /opt/JenkinsAgent/remoting
      Sep 02, 2024 12:57:31 PM hudson.remoting.Launcher createEngine
      INFO: Setting up agent: JenkinsAgent-Build01
      Sep 02, 2024 12:57:31 PM hudson.remoting.Engine startEngine
      INFO: Using Remoting version: 3248.3250.v3277a_8e88c9b_
      Sep 02, 2024 12:57:31 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
      INFO: Using /opt/JenkinsAgent/remoting as a remoting work directory
      Sep 02, 2024 12:57:31 PM hudson.remoting.Launcher$CuiListener status
      INFO: Locating server among [http://192.168.16.200:8080/]
      Sep 02, 2024 12:57:32 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
      INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
      Sep 02, 2024 12:57:32 PM hudson.remoting.Launcher$CuiListener status
      INFO: Agent discovery successful
        Agent address: 192.168.16.200
        Agent port:    12345
        Identity:      b9:05:31:af:9d:c1:bd:81:f6:97:f1:76:4e:9d:60:5f
      Sep 02, 2024 12:57:32 PM hudson.remoting.Launcher$CuiListener status
      INFO: Handshaking
      Sep 02, 2024 12:57:32 PM hudson.remoting.Launcher$CuiListener status
      INFO: Connecting to 192.168.16.200:12345
      Sep 02, 2024 12:57:32 PM hudson.remoting.Launcher$CuiListener status
      INFO: Server reports protocol JNLP4-connect-proxy not supported, skipping
      Sep 02, 2024 12:57:32 PM hudson.remoting.Launcher$CuiListener status
      INFO: Trying protocol: JNLP4-connect
      Sep 02, 2024 12:57:34 PM org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader run
      INFO: Waiting for ProtocolStack to start.
      Sep 02, 2024 12:57:36 PM hudson.remoting.Launcher$CuiListener status
      INFO: Remote identity confirmed: b9:05:31:af:9d:c1:bd:81:f6:97:f1:76:4e:9d:60:5f
      Sep 02, 2024 12:57:36 PM hudson.remoting.Launcher$CuiListener status
      INFO: Connected
      

      確認狀態

      查看節點管理界面,現實狀態正常
      Dashboard --》Manage Jenkins --》Nodes


      錯誤排查

      問題現象:agent節點啟動報錯

      Sep 02, 2024 12:50:16 PM hudson.remoting.Launcher$CuiListener status
      INFO: Could not locate server among [http://192.168.16.200:8080/]; waiting 10 seconds before retry
      java.io.IOException: http://192.168.16.200:8080/tcpSlaveAgentListener/ is invalid: 404 Not Found
              at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:229)
              at hudson.remoting.Engine.innerRun(Engine.java:829)
              at hudson.remoting.Engine.run(Engine.java:574)
      

      需要在管理節點開啟TCP端口
      Dashboard --> Manage Jenkins --> Security --> Agents --> TCP port for inbound agents --> 選擇 Fixed --> 添加端口 12345
      正常情況下,瀏覽器頁面訪問 http://192.168.16.200:8080/tcpSlaveAgentListener/ 會顯示“Jenkins”結果


      posted @ 2024-09-02 22:40  Anliven  閱讀(417)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲一卡2卡3卡4卡精品| 国产精品乱码一区二区三| 办公室强奷漂亮少妇视频| 妓院一钑片免看黄大片| 丝袜美腿亚洲综合在线观看视频| 亚洲老熟女乱女一区二区| 4hu四虎永久在线观看| 一本色道久久东京热| 和艳妇在厨房好爽在线观看| 少妇熟女久久综合网色欲| 么公的好大好硬好深好爽视频| 午夜免费视频国产在线| 精品国产乱来一区二区三区| 午夜免费福利小电影| 欧美成人午夜在线观看视频| 18禁无遮挡啪啪无码网站| 亚洲精品理论电影在线观看| 99久久婷婷国产综合精品青草漫画| 高潮迭起av乳颜射后入| 大香伊蕉在人线国产最新2005| 克拉玛依市| 粉嫩av一区二区三区蜜臀| 亚洲一区二区三区啪啪| 玛纳斯县| 在线天堂最新版资源| 东北女人毛多水多牲交视频 | 精品久久人人妻人人做精品 | 亚洲精品国产一区二区三| 久久精品波多野结衣| 国产一区二区三区四区五区加勒比| 在线精品亚洲区一区二区| 中文字幕乱码中文乱码毛片 | 国产亚洲无线码一区二区| 欧美久久精品一级c片免费| 一区二区三区精品不卡| 国产乱码精品一区二区三| 国产国拍精品av在线观看| 久久国产成人午夜av影院| 中文字幕无线码中文字幕| 九九热精品在线观看| 亚洲悠悠色综合中文字幕|