重启 jenkins的命令: systemctl start jenkins
如果没有vim 命令
可以使用 yum install vim 安装 vim

git 下载包地址
https://www.kernel.org/pub/software/scm/git/git-2.28.0.tar.gz
1.安装依赖环境:
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
回下载很多文件,等会吧


2.删除yum方式安装的git: 第一步 添加依赖时自动yum安装了git1.8版本。需要先移除git1.8版本
安装目录:/usr/local/git2.28
yum -y remove git

cd /usr/local/git2.28
tar -zxvf git-2.28.0.tar.gz
解压完成

注意 注意 注意 安装目录不要和解压包目录是同一个,我这里安装目录不对,忘了修改了,把解压目录和安装目录弄成同一个了,都没法区分哪些是安装文件,哪些是解压文件
编译
make configure

执行上面的编译命令可能会报错,然后再执行下面的命令
sudo yum install autoconf


再次执行: make configure

执行,注意后面的路径,要是git的目录 /usr/local/git2.28
./configure --prefix=/usr/local/git2.28

开始 安装 注意目录,这一步时间有点长
make profix=/usr/local/git2.28 install

安装完成

将 git 加入环境变量中,修改 /etc/profile 文件。
vi /etc/profile
在 profile 文件末尾追加配置内容
export GIT_HOME=/usr/local/git2.28
export PATH=GIT_HOME/bin:PATH

刷新 profile 配置文件 使其生效
source /etc/profile

查看是否配置成功
[root@xxx git-2.30.2]# git --version
git version 2.28.0
配置成功!

安装完成后 解压目录文件就没用了,可以删除,我这里安装和解压是同一个目录,所有不能删除
rm -rf /usr/local/git2.28
安装maven
进入maven目录

进入 apache-maven-3.6.3 创建目录仓库目录 repMaven

编辑配置文件 settings.xml,
添加仓库目录 和 阿里云的镜像

阿里云镜像
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/\</url>
<mirrorOf>central</mirrorOf>
</mirror>

编辑配置文件
vi /etc/profile
到文件最后添加
export MAVEN_HOME=/usr/local/maven/apache-maven-3.6.3
export PATH=PATH:MAVEN_HOME/bin


执行 source /etc/profile 使配置生效
source /etc/profile

安装完成,测试是否成功:mvn -v
mvn -v

安装 jenkins
下载地址:https://sg.mirror.servanamanaged.com/jenkins/redhat/jenkins-2.350-1.1.noarch.rpm

点击父级目录

点击redhat

找对应的版本

由于官网下载比较慢,提百度云下载地址:
链接:https://pan.baidu.com/s/1jFjyaYGEEnHKxKXqZ2g6Lg
提取码:1234
开始安装Jenkins
安装目录

安装命令:
rpm -ivh jenkins-2.350-1.1.noarch.rpm

查看Jenkins服务配置文件
systemctl status jenkins
/usr/lib/systemd/system/jenkins.service

修改Jenkins服务配置文件。
修改用户和组为root;指定jdk目录;修改启动端口号
vim /usr/lib/systemd/system/jenkins.service

jdk 目录 Environment="JAVA_HOME=/usr/java/jdk1.8.0_162"

重新加载系统配置
systemctl daemon-reload

启动jenkins
启动
systemctl start jenkins
停止
systemctl stop jenkins

开放Jenkins访问端口。(端口与配置文件中一致)
firewall-cmd --zone=public --add-port=9999/tcp --permanent
firewall-cmd --reload
通过命令查询密码 : c4ea572c59df4ba99d9275c7046be2f0
cat /var/lib/jenkins/secrets/initialAdminPassword

开始访问
http://192.168.43.202:9999/login?from=%2F

选择插件安装





下拉最底部

修改镜像源为清华源
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

重启jenkins
http://192.168.43.202:9999/restart

点击Manage Jenkins --》Manage Plugins ,点击 Available ,搜索 "Chinese"。

如果下载失败,可以多重试几次,最下面的选中 重启

变成中文了

卸载Jenkins
依次执行命令。
1、rpm卸载
rpm -e jenkins
2、检查是否卸载成功
rpm -ql jenkins
3、彻底删除残留文件:
find / -iname jenkins | xargs -n 1000 rm -rf
停止 jenkins
systemctl stop jenkins