1.安装javajdk,默认centos6.9只能下载到java8,安装成功后Jenkins会有一堆插件用不了,使用这里手动安装java17,在官网找对应安装包
https://www.oracle.com/java/technologies/downloads/#java17
这里下载了jdk-17_linux-x64_bin.rpm格式
rpm -ivh 文件名
java -version 查看下版本,有输出就安装成功了
设置JAVA_HOME:为了方便使用Java 17,您可以设置JAVA_HOME环境变量。编辑/etc/profile
文件,并在文件末尾添加以下行:
export JAVA_HOME=/usr/java/jdk-17
export PATH=$JAVA_HOME/bin:$PATH
保存文件并退出。然后运行以下命令以使更改生效:
source /etc/profile
至此java环境安装成功
安装Jenkins
2. 添加Jenkins仓库的GPG密钥:
```
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
```
3. 添加Jenkins仓库到yum源列表:
```
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
```
4. 导入Jenkins仓库的GPG密钥:
```
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
```
6. 安装Jenkins:
```
sudo yum install jenkins
注意这里默认会装上最新的,根据你本地的环境可能会下不了,我安装的时候就报错了
Resolving Dependencies --> Running transaction check ---> Package jenkins.noarch 0:2.426.1-1.1 will be installed --> Processing Dependency: systemd for package: jenkins-2.426.1-1.1.noarch --> Processing Dependency: systemd for package: jenkins-2.426.1-1.1.noarch --> Finished Dependency Resolution Error: Package: jenkins-2.426.1-1.1.noarch (jenkins) Requires: systemd You could try using --skip-broken to work around the problem ** Found 40 pre-existing rpmdb problem(s), 'yum check' output follows: mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_gcov.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_gprof.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_io.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_misc.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_process.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_cases.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_gcov.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_gprof.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_im.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_io.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_match.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_misc.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_process.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_report.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_stress.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_timer.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_unique.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(mtr_io.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(mtr_misc.pl) mysql1-5.6.39-1.x86_64 has missing requires of perl(mtr_process.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_gcov.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_gprof.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_io.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_misc.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::mtr_process.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_cases.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_gcov.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_gprof.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_im.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_io.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_match.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_misc.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_process.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_report.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_stress.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_timer.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(lib::v1/mtr_unique.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(mtr_io.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(mtr_misc.pl) mysql2-5.6.39-1.x86_64 has missing requires of perl(mtr_process.pl)说是我的mysql环境有问题,搞来搞去没成功
解决方法:到Jenkins仓库官网看下https://pkg.jenkins.io/redhat-stable/ 有什么版本可以用
sudo yum install jenkins-2.361.1
指定这个版本我就安装成功了
```
7. 启动Jenkins服务:
```
sudo service jenkins start
```
8. 配置Jenkins服务开机自启动:
```
sudo chkconfig jenkins on
```
9. 打开防火墙端口,允许Jenkins流量通过:
```
sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
sudo firewall-cmd --reload
```
10. 完成安装后,通过以下URL访问Jenkins Web界面:
```
http://your_server_ip:8080
```
11. 在首次访问时,您将需要提供Jenkins管理员密码。您可以通过以下命令找到该密码:
```
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
```
复制密码并粘贴到Jenkins Web界面中进行验证。
标签:39,64,missing,mtr,perl,centos6.9,Jenkins,安装,pl From: https://www.cnblogs.com/Cxiangyang/p/17984782