首页 > 系统相关 >CentOS 7.9 安装 Jenkins 2.361.2

CentOS 7.9 安装 Jenkins 2.361.2

时间:2022-10-07 19:24:36浏览次数:89  
标签:8080 CentOS -- systemctl jenkins Jenkins 7.9 rpm

一、CentOS 7.9 安装 Jenkins 2.361.2


1 下载地址:https://www.jenkins.io/download

2 简介

Jenkins是一个Java开发的开源持续集成工具,广泛用于项目开发,具有自动化构建、测试和部署等功能,它的运行需要Java环境。

 

二、Jenkins Redhat Packages


To use this repository, run the following command:

 
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

If you've previously imported the key from Jenkins, the rpm --import will fail because you already have a key. Please ignore that and move on.

 
yum install fontconfig java-11-openjdk
yum install jenkins

The rpm packages were signed using this key:

 
pub   rsa4096 2020-03-30 [SC] [expires: 2023-03-30]
      62A9756BFD780C377CF24BA8FCEF32E745F2C3D5
uid                      Jenkins Project <[email protected]>
sub   rsa4096 2020-03-30 [E] [expires: 2023-03-30]</[email protected]>

You will need to explicitly install a supported Java runtime environment (JRE), either from your distribution (as described above) or another Java vendor (e.g., Adoptium).

 

三、启动


 
# 启动Jenkins
systemctl start jenkins
# 设置开机启动
systemctl enable jenkins
# 查看Jenkins状态
systemctl status jenkins
# 关闭Jenkins
systemctl stop jenkins

在浏览器打开Jenkins控制面板  http://IP:8080/

如果一直浏览器一直是这个界面,就需要修改一下Jenkins的配置文件,然后重启Jenkins,然后等待浏览器出现输入密码的界面表示Jenkins启动成功

 
vim /var/lib/jenkins/hudson.model.UpdateCenter.xml
systemctl restart jenkins
# https://updates.jenkins.io/update-center.json
# https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

 

如果不记得密码,可以通过以下命令找回

 
cat /var/lib/jenkins/secrets/initialAdminPassword

 

四、配置Jenkins


进入jenkins配置文件

 
vim /etc/sysconfig/jenkins
JENKINS_HOME="/var/lib/jenkins"    # jenkins的工作路径
JENKINS_JAVA_CMD=""
JENKINS_USER="jenkins"     # 默认的jenkins用户是jenkins
JENKINS_PORT="8080"        # 修改jenkins的默认端口

查看系统8080端口是否被占用

 
netstat -nlt |grep 8080

 

五、防火墙开启8080端口


 
# 关闭防火墙
systemctl stop firewalld

# 开放3306端口命令
firewall-cmd --zone=public --add-port=8080/tcp --permanent
# 配置立即生效
firewall-cmd --reload

 

云主机需配置安全组

在入方向规则,允许8080放行

 

 

六、服务卸载

 
# 卸载jenkins服务
rpm -e jenkins
# 检查是否卸载成功
rpm -ql jenkins
# 彻底删除残留文件
find / -name jenkins | xargs rm -rf

 

 

标签:8080,CentOS,--,systemctl,jenkins,Jenkins,7.9,rpm
From: https://www.cnblogs.com/lihaijia/p/16760457.html

相关文章

  • CentOS 7.9 安装 nginx-1.22.0
    一、CentOS7.9安装nginx-1.22.0下载地址:http://nginx.org/en/download.html2 安装前的准备 #操作系统内核版本uname-a#操作系统发行版本cat/etc/redhat......
  • CentOS 7.9 安装 node-v14.16.0
    下载地址:https://nodejs.org/dist/v14.16.0/node-v14.16.0-linux-x64.tar.gz 解压压缩包 tarzxvf/opt/software/node-v14.16.0-linux-x64.tar.gz-C/opt/ 添......
  • CentOS 7.9 安装 git-2.21.0
    地址:https://git-scm.com/https://github.com/git/githttps://mirrors.edge.kernel.org/pub/software/scm/git/安装依赖包 yuminstall-ycurl-dev......
  • CentOS 7.9 安装 mysql-5.7.35
    一、CentOS7.9安装mysql-5.7.351 下载地址:https://downloads.mysql.com/archives/community/ 2 mysql-5.7.35安装包上传到linux服务器使用Xftp或者 wget ......
  • 如何在 CentOS 及其衍生版上安装 ONLYOFFICE 文档 v7.2
     使用社区版,您可以在本地服务器上安装 ONLYOFFICE文档,并将在线编辑器与 ​​ONLYOFFICE协作平台​​或​​其他热门系统​​集成在一起。ONLYOFFICE文档是什么ONLYOFFI......
  • CentOS 7.9 安装 git-2.21.0
    地址:https://git-scm.com/https://github.com/git/githttps://mirrors.edge.kernel.org/pub/software/scm/git/安装依赖包yuminstall-ycurl-develexpat-......
  • CentOS 7.9 安装 Jenkins 2.361.2
    一、CentOS7.9安装Jenkins2.361.21下载地址:https://www.jenkins.io/download2简介Jenkins是一个Java开发的开源持续集成工具,广泛用于项目开发,具有自动化构建、......
  • CentOS 7.9 安装 node-v14.16.0
    下载地址:https://nodejs.org/dist/v14.16.0/node-v14.16.0-linux-x64.tar.gz 解压压缩包tarzxvf/opt/software/node-v14.16.0-linux-x64.tar.gz-C/opt/ 添加至......
  • centos 如何搭建docker?
    官方指导文档https://docs.docker.com/engine/install/centos/ 1.卸载旧的(首次安装可以跳过这步)sudoyumremovedocker\docker-client\......
  • CentOS 7.9 安装 nginx-1.22.0
    一、CentOS7.9安装nginx-1.22.0下载地址:http://nginx.org/en/download.html2安装前的准备#操作系统内核版本uname-a#操作系统发行版本cat/etc/redhat-rel......