添加yum repos,然后安装
新邱网站制作公司哪家好,找创新互联!从网页设计、网站建设、微信开发、APP开发、成都响应式网站建设等网站项目制作,到程序开发,运营维护。创新互联于2013年开始到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联。
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/RedHat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
sudo yum install java
sudo service jenkins start/stop/restart
sudo chkconfig jenkins on
/etc/init.d/jenkins
jenkins
, 如果你修改了user,则要修修改所属者:/var/log/jenkins
,/var/lib/jenkins
,/var/cache/jenkins
/var/log/jenkins/jenkins.log
/etc/sysconfig/jenkins
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
firewall-cmd --list-all
Jenkins不支持在centos的默认的jdk上工作。如果如下所示,则需要remove:
java -version
java version "1.5.0"
gij (GNU libgcj) version 4.4.6 20110731 (Red Hat 4.4.6-3)
为了正确使用Jenkins:
yum remove java
然后可以安装openjdk
yum install java-1.7.0-openjdk
正确如下:
java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (rhel-2.5.5.1.el6_6-x86_64 u79-b14)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
修改/etc/sysconfig/jenkins
:
JENKINS_PORT="8080"
直接启动:
sudo service jenkins start
但是发现启动失败,于是需要配置java位置:
vi /etc/init.d/jenkins
在启动加入本机的java:
[root@iZ94xvn71eeZ ~]# vim /etc/init.d/jenkins
# Set up environment accordingly to the configuration settings
[ -n "$JENKINS_HOME" ] || { echo "JENKINS_HOME not configured in $JENKINS_CONFIG";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
[ -d "$JENKINS_HOME" ] || { echo "JENKINS_HOME directory does not exist: $JENKINS_HOME";
if [ "$1" = "stop" ]; then exit 0;
else exit 1; fi; }
# Search usable Java as /usr/bin/java might not point to minimal version required by Jenkins.
# see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html
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/bin/java /usr/java/jdk1.7.0_80/bin/java "
上述最后一行是我添加的。
重启,可以正常运行了。
浏览器输入ip和端口访问,第一个页面是正在启动,启动结束后会让输入一串密码,然后进入插件安装界面,选择默认,这时候会报错:
An error occurred during installation: Forbidden
解决办法:
I "fixed it" by restarting Jenkins http://localhost:8080/restart。即重启就可以继续了。
分享题目:在CentOS7上安装Jenkins
文章地址:http://www.gawzjz.com/qtweb/news11/169461.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联