In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces you about the installation of Jenkins in centos 7, and shares it for your reference and study. Without saying much, let's take a look at the detailed introduction:
Installation
Add yum repos, and then install
Sudo wget-O / etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.reposudo rpm-- import https://jenkins-ci.org/redhat/jenkins-ci.org.keysudo yum install jenkins
Install java if you don't have java
Sudo yum install java
Start and stop
Sudo service jenkins start/stop/restartsudo chkconfig jenkins on
Default settings for jenkins
Jenkins starts when the system starts. For more information, please see / etc/init.d/jenkins
Jenkins will create a user called jenkins. If you modify the user, you need to modify the owner: / var/log/jenkins, / var/lib/jenkins, / var/cache/jenkins
If you encounter a problem, check the log / var/log/jenkins/jenkins.log
Configuration file / etc/sysconfig/jenkins
8080 is enabled by default
Turn the firewall on and off
Firewall-cmd-zone=public-add-port=8080/tcp-permanentfirewall-cmd-zone=public-add-service=http-permanentfirewall-cmd-reloadfirewall-cmd-list-all
About java on centos
Jenkins does not support working on the default jdk of centos. Remove is required if the following is shown:
Java-versionjava version "1.5.0" gij (GNU libgcj) version 4.4.6 20110731 (Red Hat 4.4.6-3)
In order to use Jenkins correctly:
Yum remove java
Then you can install openjdk
Yum install java-1.7.0-openjdk
The correct information is as follows:
Java-versionjava 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)
Configure Port
Modify / etc/sysconfig/jenkins:
JENKINS_PORT= "8080"
Configure java path
Start directly:
Sudo service jenkins start
However, it is found that startup failed, so you need to configure the java location:
Vi / etc/init.d/jenkins
When you start the java that joins the machine:
[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.htmlcandidates="/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 "
The last line above is what I added.
Restart, you can run normally.
Start
When the browser enters ip and port access, the first page is being started. After startup, you will be asked to enter a series of passwords, then enter the plug-in installation interface and select default. At this time, an error will be reported:
An error occurred during installation: Forbidden
Solution:
I "fixed it" by restarting Jenkins http://localhost:8080/restart. That is, restart and you can continue.
Summary
The above is the whole content of this article, I hope that the content of this article can bring some help to your study or work, if you have any questions, you can leave a message and exchange, thank you for your support.
Referenc
Https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions
Http://www.cnblogs.com/tjpanda88/p/4306147.html
Http://stackoverflow.com/questions/37358775/jenkins-2-5-installation-error-an-error-occurred-during-installation-forbidden
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.