linux上war包方式安装Jenkins

时间:2022-05-04 09:11:41

我的安装环境:jdk1.8, linux系统为:

[root@ipha-dev71-1 nmon]# cat /etc/redhat-release  # Linux查看版本当前操作系统发行版信息
CentOS Linux release 7.4.1708 (Core)

1.下载jenkins

root用户登录xshell
[root@ipha-dev71-1 jenkins]# pwd
/home/jenkins # 进入到事先创建的jenkins目录
[root@ipha-dev71- jenkins]# wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war
---- ::-- http://mirrors.jenkins.io/war-stable/latest/jenkins.war
Resolving mirrors.jenkins.io (mirrors.jenkins.io)... 52.202.51.185
Connecting to mirrors.jenkins.io (mirrors.jenkins.io)|52.202.51.185|:... connected.
HTTP request sent, awaiting response... Found
Location: http://mirrors.tuna.tsinghua.edu.cn/jenkins/war-stable/2.176.2/jenkins.war [following]
---- ::-- http://mirrors.tuna.tsinghua.edu.cn/jenkins/war-stable/2.176.2/jenkins.war
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, :f000:::::
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:... connected.
HTTP request sent, awaiting response... OK
Length: (74M) [application/java-archive]
Saving to: ‘jenkins.war’ %[==============================================================================================================================>] ,, .2MB/s in .6s -- :: (28.2 MB/s) - ‘jenkins.war’ saved [/]
附:http://mirrors.jenkins.io/war-stable/latest/jenkins.war的获取方式
a.进入官网https://jenkins.io/download/
b.

linux上war包方式安装Jenkins

linux上war包方式安装Jenkins

鼠标放上右键-复制链接地址

linux上war包方式安装Jenkins

2.启动jenkins

[root@ipha-dev71-1 jenkins]# pwd
  /home/jenkins
  [root@ipha-dev71-1 jenkins]# ll
  total 75576
  -rw-r--r-- 1 root root 77379386 Jul 15 23:22 jenkins.war
  -rw------- 1 root root 4552 Aug 9 00:09 nohup.out

[root@ipha-dev71-1 chenjl]# nohup java -jar jenkins.war --httpPort=8080 &   # 后台启动命令,注意在jenkins目录下执行
[root@ipha-dev71-1 .jenkins]# pwd
/root/.jenkins      # jenkins安装后的默认路径
[root@ipha-dev71- chenjl]# cat /root/.jenkins/secrets/initialAdminPassword   # 查看密码,将密码赋值到jenkins页面

3.浏览器访问:http://10.1.1.71:8080/

自定义安装插件:插件安装过程中可能部分插件安装失败,重试一下可能就安装成功

4.设置管理员

5.配置jenkins url

linux上war包方式安装Jenkins