下载jenkins.war
https://www.jenkins.io/zh/doc/pipeline/tour/getting-started/
https://www.jenkins.io/zh/download/
下载并运行 Jenkins
- 下载 Jenkins.
- 打开终端进入到下载目录.
- 运行命令 java -jar jenkins.war --httpPort=8080.
- 打开浏览器进入链接 http://localhost:8080.
- 按照说明完成安装.
linux中Jenkins启动/重启/停止命令
启动
https://www.jenkins.io/zh/download/
重启
service jenkins restart
停止
service jenkins stop
此外,还有直接使用url的方式,不过当然不包括启动(此时服务还未启动),只需要在访问jenkins服务器的网址url地址就可以了
此处假定 jenkins部署在本机,端口为 8080
浏览器进入Jenkins,登录
关闭Jenkins
重启Jenkies
重新加载配置信息
jenkins后台启动方案
nohup java -jar jenkins.war --httpPort=8090 &
Jenkins安装及卸载一夜幕一 2018-06-14 14:44:27 12898 收藏 6
分类专栏: 基础知识 文章标签: jenkins jenkins安装 jenkins卸载
版权
1、到Jenkins官网(https://jenkins.io/download/ )下载最新版本对应系统版本
2、上传rpm包,并安装: rpm -ivh jenkins-2.127-1.1.noarch.rpm
3、安装完成之后使用命令rpm -qc jenkins查看安装位置,如下:
[root@VM_147_103_ 3rd]# rpm -qc jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins
4、编辑配置文件vim /etc/sysconfig/jenkins修改端口(我自己的改成了30078)
## Type: integer(0:65535) ## Default: 8080 ## ServiceRestart: jenkins # # Port Jenkins is listening on. # Set to -1 to disable # JENKINS_PORT="30078"
5、启动命令为 service jenkins start
****如果启动报错,一般是java路径配置问题,修改如下:
vim /etc/init.d/jenkins
将:/usr/bin/java 改成自己的jdk路径
查询jdk路径:
[root@VM_147_103_ 3rd]# which java /data/3rd/jdk1.8.0_152/bin/java
6、卸载jenkins
service jenkins stop yum clean all yum -y remove jenkins
1、rpm卸载
rpm -e jenkins
2、检查是否卸载成功
rpm -ql jenkins
3、彻底删除残留文件:
find / -iname jenkins | xargs -n 1000 rm -rf
centeros 安装 Jenkins
官方地址:https://pkg.jenkins.io/redhat/
1.下载安装
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
yum install jenkins
vim /etc/sysconfig/jenkins
2.修改端口
Type: integer(0:65535) Default: 8080 ServiceRestart: jenkins Port Jenkins is listening on. Set to -1 to disable JENKINS_PORT="9080" Type: string Default: "" ServiceRestart: jenkins IP address Jenkins listens on for HTTP requests. Default is all interfaces (0.0.0.0).
3.设置jdk配置
candidates=" /etc/alternatives/java /usr/lib/jvm/java-1.8.0/bin/java /usr/lib/jvm/jre-1.8.0/bin/java /usr/lib/jvm/java-1.7.0/bin/java /usr/lib/jvm/jre-1.7.0/bin/java /usr/lib/jvm/java-11.0/bin/java /usr/lib/jvm/jre-11.0/bin/java /usr/lib/jvm/java-11-openjdk-amd64 /usr/bin/java #添加自己的jdk /opt/software/jdk1.8.0_151/bin/java
如有以下警告执行(systemctl daemon-reload)
Starting jenkins (via systemctl): Warning: jenkins.service changed on disk. Run 'systemctl daemon-
开启服务
systemctl start jenkins.service http//:127.0.0.1:9080