centos离线安装jenkins

centos离线安装jenkins

1、安装java环境,这里我们选择openjdk,当然也可以是JDK
[root@localhost repo]# yum install -y java
2、下载jenkins的yum源的配置文件jenkins.repo
[root@localhost repo]# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
3、修改配置文件jenkins.repo
[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=0
enabled=1
4、下载jenkins到本地
[root@localhost repo]# yum  install --downloadonly --downloaddir=/opt/repo jenkins   

5、将/opt/repo文件夹下所有文件上传至非互联网服务器,生成repo源,并创建jenkins.repo文件
[root@localhost repo]# yum install createrepo
[root@localhost repo]# createrepo .
[root@localhost repo]# vi /etc/yum.repos.d/jenkins.repo
[jenkins]
name=Jenkins
baseurl=file:///opt/repo
gpgcheck=0
enabled=1
6、安装jenkins
[root@localhost repo]# yum install -y jenkins
7、修改端口号并启动jenkins服务
[root@localhost repo]# vim /etc/sysconfig/jenkins
## Type: string
## Default:     "-Djava.awt.headless=true"
## ServiceRestart: jenkins
#
# Options to pass to java when running Jenkins.
#
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
## Type:        integer(0:65535)
## Default:     8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8081"                                             //更改端口至8081
## Type:        string
[root@localhost repo]# systemctl restart jenkins
[root@localhost repo]# systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
   Active: active (running) since 五 2021-01-29 01:29:25 EST; 16min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 74861 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/jenkins.service
           └─74902 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --we...

1月 29 01:29:23 localhost.localdomain systemd[1]: Starting LSB: Jenkins Automation Server...
1月 29 01:29:23 localhost.localdomain runuser[74866]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
1月 29 01:29:24 localhost.localdomain jenkins[74861]: Starting Jenkins [  OK  ]
1月 29 01:29:25 localhost.localdomain systemd[1]: Started LSB: Jenkins Automation Server.
[root@localhost repo]# netstat -nltp |grep 8081
tcp6       0      0 :::8081                 :::*                    LISTEN      74902/java 
8、查看页面、更改管理员密码

在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值