Support Questions

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

CentOs Java Update

avatar
New Contributor

Hello,

i am trying to update the Java version from 7 to 8 on a Sandbox which is running on CentOS.

If i am trying this with the command:

ambari-server setup

i get asked which version i want to install but after the "upgrade" i have still the Java 7 on the sandbox. I am running it wih root.

I hope someone can help me with this.

Regrads,

Jan

1 ACCEPTED SOLUTION

avatar
Rising Star

To shortcut the procedure you can also set the other java version for the whole server:

/usr/sbin/alternatives --config java

This will change the java version for the whole system and not just Ambari and the HDP components.

View solution in original post

5 REPLIES 5

avatar
Rising Star

I assume that you did not use the 'custom Java' option in the setup dialog, right?

For the update of the used java to work, you will have to make sure that

  • you have internet connection on the host
  • and you must install this JDK on all hosts in the cluster to the same path.

(I guess in the sandbox setup you only have one machine, as long as you did not change it).

After setup completes, you must restart each component for the new JDK to be used by the Hadoop services.Using the Ambari Web UI, do the following tasks:

  • Restart each component
  • Restart each host
  • Restart all services

avatar
Rising Star

To shortcut the procedure you can also set the other java version for the whole server:

/usr/sbin/alternatives --config java

This will change the java version for the whole system and not just Ambari and the HDP components.

avatar
Rising Star

@Jan Bauer - did this solve your question?

avatar
New Contributor

Sorry for the late answer,

i had to install it like you said.

But additional i hade to modify all env files for the servies on the Cluster. (Set the new JAVA_HOME Path)

avatar
Expert Contributor

I had install new openjdk 1.8 and there is the old 1.6 version on the same version

I use

/usr/sbin/alternatives --config java

changed the java version,

and then use java -version,it shows me the openjdk version is 1.8

but I found /usr/lib/jvm/ linked to /etc/alternatives/java_sdk and still linked to /usr/lib/jvm/java-1.6.0-openjdk.x86_64

So I think nothing changed.

I just set JAVA_HOME to /usr/lib/jvm/java ,and want not to change the java home path after each jdk upgrade.

So I don't know why the /etc/alternatives/java_sdk link not change.