Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Whre JAVA_HOME and HADOOP_HOME is initialized in the HDP cluster

Highlighted

Whre JAVA_HOME and HADOOP_HOME is initialized in the HDP cluster

New Contributor

Hi,

I wanted to know n which place in the HDP cluster , particularly in which bash scripts variables like JAVA_HOME and HADOOP_HOME is initialized. I guess they should be initialized somewhere in /etc/profile or ./.bash_profile file or other places?

Thanks

1 REPLY 1

Re: Whre JAVA_HOME and HADOOP_HOME is initialized in the HDP cluster

Super Mentor

@Lucky_Luke

If you are managing your cluster via Ambari then the easiest option is to setg the JAVA_HOME via abari setup command.

That way ambari will pass the JAVA_HOME variable to variaou components during their startup and your whole cluster components will be using the same path for Java_home.

You can find the java home property inside ambari's

# grep 'java.home' /etc/ambari-server/conf/ambari.properties

.

Ambari also allows you to choose a custom JDK then you can refer to the following DOC: https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.0/bk_ambari-administration/content/ch_changin...

If you choose Custom JDK, verify or add the custom JDK path on all hosts in the cluster. Use this option if you want to use OpenJDK or do not have an internet connection (and have pre-installed the JDK on all hosts). 
You must install this JDK on all hosts in the cluster to this same path on all hosts.

.

Using command line via Amabri setup:

# ambari-server setup -j /path/to/your/installed/jdk

Although you can manage the JAVA_HOME path on every host using "/etc/profile" file however it is best from maintenance perspective to delegate this task to Ambari.

Reference:

https://community.hortonworks.com/questions/109575/setuping-ambari-with-existing-jdk-cause-issues.ht...