Jenkins离线安装
一、JDK
1、下载JDK
Linux环境的JDK安装包官网下载地址:
链接: https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
没有用户的就注册一个。
2、安装JDK
2.1 先检查当前环境有没有安装JDK,如果没有我们再安装
检查命令:java -version
2.2 在/usr/lib/下创建java文件夹,上传JDK
mkdir -p /usr/lib/java
2.3 安装jdk
cd /usr/lib/java
rpm -ih jdk-8u281-linux-x64.rpm
执行:java -version
查看是否配置成功
二、MAVEN
1、下载maven
建议逐层访问
链接: http://mirrors.hust.edu.cn/.
2、安装maven
mkdir -p /opt/src
cd /opt/src
执行:
tar -zxvf /opt/src/apache-maven-3.6.3-bin.tar.gz -C /opt/
cd /opt
mkdir /opt/maven
mv apache-maven-3.6.3/* /opt/maven/
rm -rf apache-maven-3.6.3
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_281-amd64
export MAVEN_HOME=/opt/maven
export PATH=$PATH:$JAVA_HOME/BIN:${MAVEN_HOME}/bin
source /etc/profile
mvn -v
三、安装git
四、docker
1、下载docker
链接: https://download.docker.com/linux/static/stable/x86_64/docker-20.10.0.tgz .
2、Docker安装
将安装包拷贝至/opt/src
cd /opt/src
tar zxvf docker-20.10.0.tgz -C /opt
cd /opt
cp docker/* /usr/bin/
vi /etc/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl start docker
systemctl enable docker.service
验证:
docker info
五、Jenkins
1、下载
https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat/
2、安装
将安装包拷贝至/opt/src
rpm -ih jenkins-2.287-1.1.noarch.rpm
配置 jenkis的端口
vi /etc/sysconfig/jenkins
JENKINS_PORT="8080" #此端口不冲突可以不修改
JENKINS_USER="root" # jenkins 用户权限不够
systemctl start jenkins
systemctl enable jenkins
systemctl stop firewalld
systemctl stop firewalldsudo systemctl disable firewalld.service
访问Jenkins主页:192.168.43.61:8080
至此即可,不要进去!