Thursday, 20 February 2014

Jenkins On RedHat

Jenkins Prerequisites

httpd
subversion
java

Installation
Add the Jenkins repository to the yum repos, and install Jenkins from here.
Installation of a stable version
Installation of Java
Jenkins requires Java in order to run, yet certain Fedora-based distros don't include this by default. To install the Open Java Development Kit (OpenJDK) run the following:
sudo yum install java

Start/Stop
 
  • sudo service jenkins start/stop/restart
  • sudo chkconfig jenkins on
What does this package do?
  • Jenkins will be launched as a daemon up on start. See /etc/init.d/jenkins for more details.
  • The 'jenkins' user is created to run this service. If you change this to a different user via the config file, you must change the owner of /var/log/jenkins, /var/lib/jenkins, and /var/cache/jenkins.
  • Log file will be placed in /var/log/jenkins/jenkins.log. Check this file if you are troubleshooting Jenkins.
  • /etc/sysconfig/jenkins will capture configuration parameters for the launch.
  • By default, Jenkins listen on port 8080. Access this port with your browser to start configuration.  Note that the built-in firewall may have to be opened to access this port from other computers.  (See http://www.cyberciti.biz/faq/disable-linux-firewall-under-centos-rhel-fedora/ for instructions how to disable the firewall permanently)
  • A Jenkins RPM repository is added in /etc/yum.repos.d/jenkins.repo

IPtables and SELinux

sudo iptables –L
getenforce
Disabled

Port Listen Test

sudo netstat -tnlp | grep 8080
sudo netstat –tulpen
sudo lsof -i :8080

Run Jenkins

sudo locate jenkins.war
sudo java -jar /usr/lib/jenkins/jenkins.war

sudo ps -u jenkins
 PID TTY          TIME CMD
22623 ?        00:00:17 java

Error

WARNING: FAILED SelectChannelConnector@0.0.0.0:8080: java.net.BindException: Address already in use.
sudo netstat -tnlp | grep 8080
sudo ps -u jenkins
Check the firewall and network configuration, proxy or your antivirus etc.

Packages Installed

sudo rpm -qa | grep httpd
httpd-tools-2.2.15-29.el6_4.x86_64
httpd-2.2.15-29.el6_4.x86_64

sudo rpm -qa | grep subversion
subversion-1.6.11-9.el6_4.x86_64

sudo rpm -qa | grep java
tzdata-java-2013i-1.el6.noarch
java-1.7.0-openjdk-1.7.0.45-2.4.3.4.el6_5.x86_64

sudo rpm -qa | grep jenkins
jenkins-1.551-1.1.noarch

Ref:

No comments:

Post a comment