1.准备工作
1.1 安装java环境
参考:CenterOS7安装java环境 - jupiter's blog (inat.top)
1.2 安装git
如果你的系统没有自带git,那么也需要安装一个
yum install git
2.通过下载war包安装
2.1 war包下载
官网下载地址:https://www.jenkins.io/zh/download/
阿里云镜像站下载地址:https://mirrors.aliyun.com/jenkins/war/latest/
清华大学开源软件镜像站 (☆☆☆推荐):https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/latest/
wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/latest/jenkins.war
2.2 启动jenkins(报错)
java -jar jenkins.war
访问测试:http://192.168.124.18:8080/
- 报错:AWT is not properly configured on this server. Perhaps you need to run your container with "-Djava.awt.headless=true"? See also: https://www.jenkins.io/redirect/troubleshooting/java.awt.headless
- 错误原因,因为安装的是openjdk
2.3 错误修复
#CentOS 7
yum install fontconfig
java -jar jenkins.war
- 启动日志
2024-07-09 15:09:23.538+0000 [id=31] INFO jenkins.install.SetupWizard#init:
*************************************************************
*************************************************************
*************************************************************
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
9bd6e45ed26c47fd83903af49ef79997
This may also be found at: /root/.jenkins/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
等待初始化完成
输入启动日志中的密码即可顺利进入,选择安装默认插件
部署jenkins一直显示Please wait while Jenkins is getting ready to work …
vim ~/.jenkins/hudson.model.UpdateCenter.xml
将https://updates.jenkins.io/update-center.json更换为更改为https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
<?xml version='1.1' encoding='UTF-8'?> <sites> <site> <id>default</id> <url>https://updates.jenkins.io/update-center.json</url> </site> </sites>
评论 (0)