zoukankan      html  css  js  c++  java
  • jenkins yum 安装

    jenkins yum 安装

    jenkins 用过yum的方式安装:服务的启动和关闭等管理会很方便,版本升级也会变的很容易。
    参考官方的说明:https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions

    • jenkins安装
    #将jenkins的稳定版加入到yum 库中
    sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
    sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
    #安装jenkins
    sudo yum install jenkins
    
    #jenkins 需要jdk1.8,如果低于1.8,启动jenkins会报错。
    #安装jdk1.8
    yum remove java
    rpm -ivh jdk-8u144-linux-x64.rpm
    
    • 启动或停止jenkins
    sudo service jenkins start/stop/restart
    sudo chkconfig jenkins on
    
    • 修改jenkins默认的端口和启动用户

    sudo vi /etc/sysconfig/jenkins

    ## Type:        string
    ## Default:     "jenkins"
    ## ServiceRestart: jenkins
    #
    # Unix user account that runs the Jenkins daemon
    # Be careful when you change this, as you need to update
    # permissions of $JENKINS_HOME and /var/log/jenkins.
    #
    JENKINS_USER="hadoop"
    
    
    ## Type:        integer(0:65535)
    ## Default:     8080
    ## ServiceRestart: jenkins
    #
    # Port Jenkins is listening on.
    # Set to -1 to disable
    #
    JENKINS_PORT="8099"
    
    
    • 修改jenkins默认的java的启动参数:
      sudo vi /etc/sysconfig/jenkins
    #支持设置邮件发送starttls和信任列表
    JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Dmail.smtp.starttls.enable=true -Dmail.smtp.auth=true -Dmail.smtp.ssl.trust=mail.service.mtime.com"
    
    • 如果修改默认启动用户,需要修改如下几个目录的权限
    sudo rm -rf  /var/cache/jenkins/*
    sudo rm -rf  /var/lib/jenkins/*
    
    sudo chown -R hadoop:hadoop /var/log/jenkins
    sudo chown -R hadoop:hadoop  /var/cache/jenkins/
    sudo chown -R hadoop:hadoop /var/lib/jenkins
    
    • 原有的jenkins配置拷贝到jenkins默认的目录下
      cp -R .jenkins/* /var/lib/jenkins/
    • 启动jenkins
    sudo service jenkins start
    sudo service jenkins status
    

    历史任务配置迁移后的异常:

    WARNING: Could not create Trilead support class. Using legacy Trilead features
    java.lang.ClassNotFoundException: hudson.plugins.sshslaves.verifiers.JenkinsTrilead9VersionSupport
            at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
            at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:450)
            at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)
            at hudson.plugins.sshslaves.verifiers.TrileadVersionSupportManager.createVersion9Instance(TrileadVersionSupportManager.java:51)
            at hudson.plugins.sshslaves.verifiers.TrileadVersionSupportManager.getTrileadSupport(TrileadVersionSupportManager.java:32)
            at hudson.plugins.sshslaves.verifiers.SshHostKeyVerificationStrategy.getPreferredKeyAlgorithms(SshHostKeyVerificationStrategy.java:68)
            at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:797)
            at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:793)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
    

    jenkin --> 系统配置 --> 节点管理:
    Host Key Verification Strategy 选择:non verifying verification Strategay.

    重启之后就没了。

  • 相关阅读:
    2 多线程的优点
    1 并发模型
    转:Webpack 指南(整理 草稿)
    深入理解JavaScript运行机制
    使用js-xlsx库,前端读取Excel报表文件
    深入理解定时器系列——被誉为神器的requestAnimationFrame
    前端资源大全汇总
    iPhone/iPad/Android UI尺寸规范 UI尺寸规范,UI图标尺寸,UI界面尺寸,iPhone6尺寸,iPhone6 Plus尺寸,安卓尺寸,iOS尺寸
    浅析渲染性能(转)
    Nodejs reactjs服务端渲染优化SEO
  • 原文地址:https://www.cnblogs.com/honeybee/p/7550773.html
Copyright © 2011-2022 走看看