Install Jenkins on AWS EC2


Install Jenkins on AWS EC2


  • Login to AWS Instance

  • Become root using:
    • sudo su

  • Update yum
    • yum update


sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo


  • Get Jenkins repository key
    • sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
  • Install jenkins package
    • yum install jenkins

  • Start Jenkins
    • service jenkins start
    • chkconfig jenkins on



Notes:
If you encountered jenkins dead but pid file exists error, please restart jenkins using this command:
Sudo service jenkins restart

OR

Stop all processors with 8080 port.

OR

Got to /etc/sysconfig/jenkins file and add JENKINS_PORT="8070" after daemon word. If you don’t have the permission to do that, change folder permission by:
  • Cd  /etc/sysconfig/
  • Chmod 777 jenkins




The file should look like this:

# 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
"
for candidate in $candidates
do
 [ -x "$JENKINS_JAVA_CMD" ] && break
 JENKINS_JAVA_CMD="$candidate"
done
JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"
PARAMS="--logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon"
JENKINS_PORT="8070"
[ -n "$JENKINS_PORT" ] && PARAMS="$PARAMS --httpPort=$JENKINS_PORT"
[ -n "$JENKINS_LISTEN_ADDRESS" ] && PARAMS="$PARAMS --httpListenAddress=$JENKINS_LISTEN_ADDRESS"
[ -n "$JENKINS_HTTPS_PORT" ] && PARAMS="$PARAMS --httpsPort=$JENKINS_HTTPS_PORT"
[ -n "$JENKINS_HTTPS_KEYSTORE" ] && PARAMS="$PARAMS --httpsKeyStore=$JENKINS_HTTPS_KEYSTORE"
[ -n "$JENKINS_HTTPS_KEYSTORE_PASSWORD" ] && PARAMS="$PARAMS --httpsKeyStorePassword='$JENKINS_HTTPS_KEYSTORE_PASSWORD'"
[ -n "$JENKINS_HTTPS_LISTEN_ADDRESS" ] && PARAMS="$PARAMS --httpsListenAddress=$JENKINS_HTTPS_LISTEN_ADDRESS"
[ -n "$JENKINS_DEBUG_LEVEL" ] && PARAMS="$PARAMS --debug=$JENKINS_DEBUG_LEVEL"
[ -n "$JENKINS_HANDLER_STARTUP" ] && PARAMS="$PARAMS --handlerCountStartup=$JENKINS_HANDLER_STARTUP"
[ -n "$JENKINS_HANDLER_MAX" ] && PARAMS="$PARAMS --handlerCountMax=$JENKINS_HANDLER_MAX"
[ -n "$JENKINS_HANDLER_IDLE" ] && PARAMS="$PARAMS --handlerCountMaxIdle=$JENKINS_HANDLER_IDLE"
[ -n "$JENKINS_ARGS" ] && PARAMS="$PARAMS $JENKINS_ARGS"


OR

Change JENKINS_PORT="8080" to JENKINS_PORT="8070" in the same jenkins file above.
















































































Comments

Popular posts from this blog

How to Customize TestNG Emailable Report ?

Handling Selenium Grid Exceptions

Add customized jar as Maven Dependency