Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to manually upgrade from Java 1.7 to Java 1.8 in HDP 2.4?

avatar
Expert Contributor

I have setup a four node cluster using HDP 2.4. Currently is has Java 1.7 installed. I tried to upgrade to java 1.8 by executing "ambari-server setup". I select Option [1]. This starts the downloading of Java 1.8, but after trying for a few minutes, I see the following error. I have not been able to figure out the issue, but wondering if there is way to manually upgrade the java version from 1.7 to 1.8 without ambari-server setup? I have read the below thread, but I would like to confirm whether it is fine to do so.

Thread

https://community.hortonworks.com/questions/46432/upgrading-jdk-17-to-18-on-hdp-242.html

Error:

REASON: Downloading or installing JDK failed: 'Fatal exception: Failed to download JDK: <urlopen error [Errno 110] Connection timed out>. Please check that the JDK is available at http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-8u60-linux-x64.tar.gz. Also you may specify JDK file location in local filesystem using --jdk-location command line argument., exit code 1'. Exiting.

The above error message also mentions "Also you may specify JDK file location in local filesystem using --jdk-location command line argument", so can anyone please help me with the steps?

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Pradeep kumar

You should try the following approach:

1). Download your desired JDK 1.8 and place it in all your Cluster Hosts including Ambari in the same location on all hosts Example: /usr/jdk64/jdk1.8.0_121

2). Now run the ambari-server setup command as following:

# ambari-server setup --java-home=/usr/jdk64/jdk1.8.0_121

. In the Output you will notice:

.
.
OK to continue [y/n] (y)? 
Checking JDK...
WARNING: JAVA_HOME /usr/jdk64/jdk1.8.0_121 must be valid on ALL hosts
.

.

Hence you will need to make sure that your JDK path (/usr/jdk64/jdk1.8.0_121) present in the abari server is identical through out the cluster nodes.

View solution in original post

7 REPLIES 7

avatar
Master Mentor

@Pradeep kumar

- When you are running the "ambari-server setup" for upgrading the java to 1.8 what error are you getting?

- Do you see the "jdk1.8" tar.gz file inside your Ambari Server host ?

# ls -l /var/lib/ambari-server/resources/jdk-8*
-rw-r--r--. 1 root root 181238643 Aug 18  2016 /var/lib/ambari-server/resources/jdk-8u60-linux-x64.tar.gz

.

- If you are managing cluster via ambari then "ambari-server setup" option is better to upgrade the java.

However you can take a look at the following link to see how to point to upgraded java: https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.5.3/bk_command-line-installation/content/meet-m...

avatar
Expert Contributor

@Jay SenSharma

I agree that ambari-setup is a better option, but what if I keep getting the error (I have edited the post with the error message). I want to double check, whether installing java manually is okay and that it doesn't cripple the cluster. I love ambari but what I hate is that, any small change might bring more errors and the cluster might stop. I do not see any JDK folder under /var/lib/ambari-server/resources/

avatar
Master Mentor

@Pradeep kumar

Please make sure that you do not have any HTTP proxy setup at your end. If it is setup then you should use the following approach:

1. Edit /var/lib/ambari-server/ambari-env.sh. 2. Add "-Dhttp.proxyHost=myproxyhost -Dhttp.proxyPort=4444" to the AMBARI_JVM_ARGS. (here 4444 port may be different in your case) 3. Restart the Ambari Server.

.

If you have any internet connectivity issue then you can you can also try using the "--jdk-location" after manually downloading it and scp it to ambari host the Desired JDK to your ambari server host. This option can be used to specify JDK file in local filesystem instead of downloading.

.

avatar
Expert Contributor
@Jay SenSharma

The proxy server is already mentioned in the ambari-env.sh, so I can confirm you that this is not a proxy issue. Regarding "--Jdk-location" option, I do not understand which command to execute with this argument? Can you please paste the full command with the option "--Jdk-location"?

avatar
Master Mentor

@Pradeep kumar

You should try the following approach:

1). Download your desired JDK 1.8 and place it in all your Cluster Hosts including Ambari in the same location on all hosts Example: /usr/jdk64/jdk1.8.0_121

2). Now run the ambari-server setup command as following:

# ambari-server setup --java-home=/usr/jdk64/jdk1.8.0_121

. In the Output you will notice:

.
.
OK to continue [y/n] (y)? 
Checking JDK...
WARNING: JAVA_HOME /usr/jdk64/jdk1.8.0_121 must be valid on ALL hosts
.

.

Hence you will need to make sure that your JDK path (/usr/jdk64/jdk1.8.0_121) present in the abari server is identical through out the cluster nodes.

avatar
Expert Contributor

@Jay SenSharma Thanks. This is the command I was looking for. I have downloaded 'jdk-8u121-linux-x64.tar.gz' and kept it under /usr/jdk folder in all the hosts. But when I execute the command 'ambari-server setup --java-home=/usr/jdk' I get the eerror ERROR: Exiting with exit code 1. REASON: Downloading or installing JDK failed: 'Fatal exception: Path to java home /usr/jdk/ or java binary file does not exists, exit code 1'. Exiting.

Could you please confirm whether the correct file is jdk-8u121-linux-x64.tar.gz

avatar
Master Mentor

@Pradeep kumar

You will need to extract the tzr.gz file and then the extarcted path you need to pass.

Example

# ambari-server setup --java-home=/usr/jdk/jdk1.8.0_121

.