Support Questions
Find answers, ask questions, and share your expertise

Whre JAVA_HOME and HADOOP_HOME is initialized in the HDP cluster



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?



Super Mentor


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 also allows you to choose a custom JDK then you can refer to the following DOC:

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.


Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.