Monday, October 22, 2018

Jenkins Dynamic Slaves setup - Quick Tip #2

Jenkins Dynamic Slaves setup - Quick Tip #2






While setting up Amazon EC2 plugin configuration of dynamic slaves, i recently came across quite some errors/issues and would like to share it here based on the error messages rather clubbing resolutions provided, altogether in one single thread post

So, now lets move on to the Tip of the day



I have created an AMI in AWS and have mapped this AMI to Jenkins Amazon EC2 plugin configuration and all sanity tests worked well. But while launching the agent, the EC2 with given AMI was up and running but always offline

Why ??? weird right ??

There was Java exception raised as below



Issue: java version installed in the Slave AMI is conflicting i.e., either updated or outdated version when compared to the Jenkins masters' version of Java

Cause: My AMI was having Java 1.7.0-openjdk were in, Jenkins master had java-1.8.0

Resolution: I have re-created my AMI with java-1.8.0 installed and removed java-1.7.0-openjdk

Steps:
Commands applied to upgrade the AMI image with latest Java version are as below
  1. Login to the base EC2 of the AMI or create one, if you dont have any
To get latest version of java:

sudo yum install java-1.8.0
To remove older version of java:
sudo yum remove java-1.7.0-openjdk

Now re-create the AMI with the latest setup of Java
Re-start or Launch agent from Jenkins-> Manage Nodes -> Nodes -> Slave Agent(offline)

Yes it starts Instance as expected and is connected for Jenkins jobs to use !!!


No comments:

Post a Comment