本文主要是介绍|NO.Z.00031|——————————|^^ 部署 ^^|——|CI/CD&Jenkins_pipeline部署.V05|----------------------------------,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
[CloudNative:CI/CD&Jenkins_pipeline部署.V05] [Applications.CloudNative][|jenkins安装|yum|Jenkins-UI.初始化配置|Jenkins插件离线安装解决方案|]
一、Jenkins安装概述
### --- Jenkins官网
~~~ 官网: [https://jenkins.io](https://jenkins.io/)
~~~ 插件:http://updates.jenkins-ci.org/download/plugins/ ### --- 部署规划
~~~ centos7.x server1 10.10.10.11 jenkins
~~~ centos7.x server2 10.10.10.12 tomcat
~~~ centos7.x server3 10.10.10.13 git/gitlab 二、部署Jenkins——yum
### --- 配置Jenkins.repo源
~~~ 导入jenkins源
[root@jenkins ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo ~~~ 导入jenkins官方证书
[root@jenkins ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key ### --- 安装Jenkins.yum
~~~ 安装Jenkins最新版本
~~~ 安装jenkins(安装的是最新的LTS版本)
[root@jenkins ~]# yum install -y jenkins
Installed:
jenkins.noarch 0:2.277.1-1.1 ### --- 查看Jenkins安装了那些组件
~~~ 查看Jenkins安装了那些组件
[root@jenkins ~]# rpm -ql jenkins
/etc/init.d/jenkins // 启动文件
/etc/logrotate.d/jenkins // 日志分割配置文件
/etc/sysconfig/jenkins // jenkins主配置文件
/usr/lib/jenkins // 存放war包目录
/usr/lib/jenkins/jenkins.war // war 包
/usr/sbin/rcjenkins // 命令
/var/cache/jenkins // war包解压目录 jenkins网页代码目录
/var/lib/jenkins // jenkins 工作目录
/var/log/jenkins // 日志 ### --- 修改Jenkins配置文件
~~~ 修改配置文件
[root@qfedu.com ~]# grep "^[a-Z]" /etc/sysconfig/jenkins
JENKINS_HOME="/var/lib/jenkins" // jenkins工作目录
JENKINS_JAVA_CMD=""
JENKINS_USER="jenkins" // jenkinx启动用户
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
JENKINS_PORT="8080" // 端口
JENKINS_LISTEN_ADDRESS=""
JENKINS_HTTPS_PORT=""
JENKINS_HTTPS_KEYSTORE=""
JENKINS_HTTPS_KEYSTORE_PASSWORD=""
JENKINS_HTTPS_LISTEN_ADDRESS=""
JENKINS_HTTP2_PORT=""
JENKINS_HTTP2_LISTEN_ADDRESS=""
JENKINS_DEBUG_LEVEL="5"
JENKINS_ENABLE_ACCESS_LOG="no"
JENKINS_HANDLER_MAX="100" // 最大连接
JENKINS_EXTRA_LIB_FOLDER=""
JENKINS_ARGS="" ### --- 启动Jenkins
~~~ 首先需要修改一下启动脚本,文件在/etc/init.d/jenkins
~~~ 因为jenkins的启动脚本默认java路径为:/usr/bin/java
~~~ 但是我们新安装的java路径并不是在这个,所以我们需要新添加路径。如图下所示:
~~~ 新路径地址为:/usr/local/jdk1.8/bin/java ~~~ 修改Jenkins配置参数
[root@jenkins ~]# vim /etc/init.d/jenkins
candidates="
/etc/alternatives/java
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/jre-1.8.0/bin/java
/usr/lib/jvm/java-11.0/bin/java
/usr/lib/jvm/jre-11.0/bin/java
/usr/lib/jvm/java-11-openjdk-amd64
/usr/bin/java // 默认路径
/usr/local/jdk1.8/bin/java // 新增路径 ~~~ 启动Jenkins
[root@jenkins ~]# systemctl start jenkins 三、验证Jenkins安装
### --- 查看Jenkins进程
[root@jenkins ~]# ps -ef |grep jenkins
jenkins 12378 1 53 18:56 ? 00:00:43 /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/jenkins/war --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
root 12488 10728 0 18:57 pts/2 00:00:00 grep --color=auto jenkins ### --- 查看Jenkins端口号
[root@jenkins ~]# netstat -lnutp|grep jenkins
[root@jenkins ~]# netstat -antp |grep 8080
tcp6 0 0 :::8080 :::* LISTEN 12378/java ===============================END=============================== Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart ——W.S.Landor
来自为知笔记(Wiz)
这篇关于|NO.Z.00031|——————————|^^ 部署 ^^|——|CI/CD&Jenkins_pipeline部署.V05|----------------------------------的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!