Change to OpenJDK

Details

Description

As discussed on the mailinglist, Oracle removed the Sun JDK from the Ubuntu repos which caused services like Hadoop to stop working.
Here is a patch which installs OpenJDK instead of the Sun JDK and works when using Ubuntu image, whirr.image-id=49 (Ubuntu 10.04 LTS)

To make it work with rpms, OpenJDK needs to be uploaded to the whirr-third-party S3 bucket. Correct?

Karel Vervaeke
added a comment - 20/Feb/12 12:14 IIRC I had problems running hadoop and hbase with just whirr.java.install-function=install_openjdk.
I also had to add
hadoop-env.JAVA_HOME=/usr/lib/jvm/java-6-openjdk
hbase-env.JAVA_HOME=/usr/lib/jvm/java-6-openjdk
(the reason being that the hadoop/hbase scripts look at fixed places for detecting JAVA_HOME, but the openjdk path isn't amongst those places).
Actually the 'export JAVA_HOME' from install_openjdk.sh should be enough, but apparently it didn't get into the environment under which hadoop/hbase is run.

Andrei Savu
added a comment - 20/Feb/12 12:37 - edited Karel do you think we should add them to whirr-hadoop-default.properties and whirr-hbase-default.properties? How about something like this (not tested):
hadoop-env.JAVA_HOME=$(source /etc/profile;echo $JAVA_HOME)

Marco Didonna
added a comment - 20/Feb/12 14:13 If anyone cares about the sun-jdk I've modified the install_java function in order to install the jdk debs using this script https://github.com/flexiondotorg/oab-java6 .
It works on EC2

I'm trying to get the openjdk solution to work with the cdh hadoop stack, and I'm running into the JAVA_HOME issue.

Karel, Andrei: if I use Andrei's solution and re-build the whirr-hadoop artifact, will this also ensure that JAVA_HOME is set for the cdh_hadoop services? Or, would that be managed by a different codepath? (forgive my lack of familiarity with the whirr codebase).

ETA: Karel – was your fix to just add those lines to your cluster properties file? If so, that would be a simpler fix for me...

Evan Pollan
added a comment - 20/Feb/12 14:22 - edited I'm trying to get the openjdk solution to work with the cdh hadoop stack, and I'm running into the JAVA_HOME issue.
Karel, Andrei: if I use Andrei's solution and re-build the whirr-hadoop artifact, will this also ensure that JAVA_HOME is set for the cdh_hadoop services? Or, would that be managed by a different codepath? (forgive my lack of familiarity with the whirr codebase).
ETA: Karel – was your fix to just add those lines to your cluster properties file? If so, that would be a simpler fix for me...

Andrei Savu
added a comment - 20/Feb/12 14:57 Nothing like a minor emergency to get oneself familiarized with an open-source project's codebase
Priceless moments Watch for 0.7.1 over the next few days.

Andrei Savu
added a comment - 21/Feb/12 21:38 This is a slightly updated version of the original patch for the 0.7 branch. Hadoop seems to be working fine on aws-ec2 but I haven't tested CDH yet. Wdyt?

Hadoop hasn't been well tested against OpenJDK, so I'm a little reluctant - although the limited testing I've done hasn't uncovered any problems. Also, folks can use the install_oab_java.sh script which will be in 0.7.1 if they want to use Sun JDK 1.6, although that has other problems (e.g. it's slower to install). Installing from a .tar.gz would be a good alternative too, so it's great to hear that's being worked on - the more options the better until a solid solution emerges.

Tom White
added a comment - 23/Feb/12 05:13 Hadoop hasn't been well tested against OpenJDK, so I'm a little reluctant - although the limited testing I've done hasn't uncovered any problems. Also, folks can use the install_oab_java.sh script which will be in 0.7.1 if they want to use Sun JDK 1.6, although that has other problems (e.g. it's slower to install). Installing from a .tar.gz would be a good alternative too, so it's great to hear that's being worked on - the more options the better until a solid solution emerges.