Linux安装jenkins(war包方式安装)

1.下载Jenkins
官方网站:https://www.jenkins.io/download/
直接下载war包
在这里插入图片描述2.安装java并配置jenkins启动目录

[root@nmhs-pp-mw049181 ~]# yum install java -y
[root@nmhs-pp-mw049181 ~]# java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode
[root@nmhs-pp-mw049181 ~]$ cat /etc/profile
#Jenkins
export JENKINS_HOME=/data/jenkins
[root@nmhs-pp-mw049181 ~]$ source /etc/profile

3.修改jenkins插件下载为国内源

[root@nmhs-pp-mw049181 ~]$ kill $(ps -ef | grep jenkins | grep -v grep | awk '{print $2}')
[root@nmhs-pp-mw049181 ~]$ sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
[root@nmhs-pp-mw049181 ~]$ sed -i 's/https:\/\/updates.jenkins.io\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json
#如果是内网环境只能做单项路由才能访问的话需要添加
https://www.baidu.com  #IP 110.242.68.66
https://mirrors.tuna.tsinghua.edu.cn   #IP 101.6.8.193
的出口ip路由
[root@nmhs-pp-mw049181 ~]$ route add -net 110.242.68.66 netmask 255.255.255.255 gw 182.42.24.65
[root@nmhs-pp-mw049181 ~]$ route add -net 101.6.8.193 netmask 255.255.255.255 gw 182.42.24.65
[root@nmhs-pp-mw049181 ~]$ cat /etc/hosts
#jenkins国内源插件
#jenkins国内源插件
110.242.68.66 www.baidu.com
101.6.8.193 mirrors.tuna.tsinghua.edu.cn

4.启动jenkins

[root@nmhs-pp-mw049181 ~]# nohup java -jar /data/jenkins/jenkins.war --ajp13Port=-1 --httpPort=8888 > /data/jenkins/jenkins.log &
#自定义端口为8888
--ajp13Port=-1 --httpPort=8888
[root@nmhs-pp-mw049181 ~]# ll /data/jenkins/
total 65860
drwxrwx---  3 yundiao yundiao     4096 Jan  3 16:50 caches
-rw-rw----  1 yundiao yundiao     1644 Jan  3 16:45 config.xml
-rw-rw----  1 yundiao yundiao      156 Jan  3 16:30 hudson.model.UpdateCenter.xml
-rw-rw----  1 yundiao yundiao     1243 Jan  3 16:45 hudson.plugins.emailext.ExtendedEmailPublisher.xml
-rw-rw----  1 yundiao yundiao      370 Jan  3 16:42 hudson.plugins.git.GitTool.xml
-rw-------  1 yundiao yundiao     1712 Dec 31 15:25 identity.key.enc
-rw-rw----  1 yundiao yundiao        7 Jan  3 16:45 jenkins.install.InstallUtil.lastExecVersion
-rw-rw----  1 yundiao yundiao        7 Jan  3 16:45 jenkins.install.UpgradeWizard.state
-rw-rw----  1 yundiao yundiao    49029 Jan  3 16:50 jenkins.log
-rw-rw----  1 yundiao yundiao      183 Jan  3 16:45 jenkins.model.JenkinsLocationConfiguration.xml
-rw-rw----  1 yundiao yundiao      171 Dec 31 15:25 jenkins.telemetry.Correlator.xml
-rw-r--r--  1 yundiao yundiao 67270143 Dec 30 15:33 jenkins.war
drwxrwx---  3 yundiao yundiao     4096 Jan  3 16:49 jobs
drwxrwx---  3 yundiao yundiao     4096 Dec 31 15:25 logs
-rw-rw----  1 yundiao yundiao      907 Jan  3 16:30 nodeMonitors.xml
drwxrwx---  2 yundiao yundiao     4096 Dec 31 15:25 nodes
-rw-rw----  1 yundiao yundiao       46 Jan  3 16:50 org.jenkinsci.plugins.workflow.flow.FlowExecutionList.xml
drwxrwx--- 80 yundiao yundiao    12288 Jan  3 16:48 plugins
-rw-rw----  1 yundiao yundiao      129 Jan  3 16:50 queue.xml
-rw-rw----  1 yundiao yundiao      129 Jan  3 16:29 queue.xml.bak
-rw-rw----  1 yundiao yundiao       64 Dec 31 15:25 secret.key
-rw-rw----  1 yundiao yundiao        0 Dec 31 15:25 secret.key.not-so-secret
drwx------  4 yundiao yundiao     4096 Jan  3 16:50 secrets
drwxrwx---  2 yundiao yundiao     4096 Jan  3 16:49 updates
drwxrwx---  2 yundiao yundiao     4096 Dec 31 15:25 userContent
drwxrwx---  3 yundiao yundiao     4096 Jan  3 16:44 users
drwxrwx--- 11 yundiao yundiao     4096 Dec 31 15:25 war
drwxrwx---  2 yundiao yundiao     4096 Jan  3 16:42 workflow-libs
drwxrwx---  4 yundiao yundiao     4096 Jan  3 16:50 workspace

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

运维那些事

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值