Reputation: 5239
I installed CDH in Pseudo distributed mode on Ubuntu 12.04.
Prior to it, I installed Java and exported my JAVA_HOME
variables to /usr/lib/jvm/java-6-oracle
and exported JAVA_HOME
to path
as well, for both root as well as other users (self, hdfs). and it was echo
ed correctly as well as showed up in env
results.
Still my CDH installation complained of JAVA_HOME
not found/set so I added JAVA_HOME
to /etc/environment
as per this and the entry Defaults env_keep+=JAVA_HOME
in /etc/sudoers
All works fine, I can check services are running via Jps
, but when I try to stop them as root it says,
service hadoop-hdfs-datanode stop
* Stopping Hadoop datanode:
Error: JAVA_HOME is not set and could not be found.
same goes for all other services.
I don't have hadoop-env.sh
in my installation, the only one present is at /usr/lib/hadoop-0.20-mapreduce/example-confs/conf.secure/hadoop-env.sh
which is an example I believe
Upvotes: 1
Views: 8098
Reputation: 16698
You should edit etc/hadoop/hadoop-env.sh
and add export JAVA_HOME=/usr/java/latest
This way your JAVA_HOME
will be set permanently
Unpack the downloaded Hadoop distribution. In the distribution, edit the file etc/hadoop/hadoop-env.sh
to define some parameters as follows:
set to the root of your Java installation export JAVA_HOME=/usr/java/latest
Upvotes: 0
Reputation: 8223
Cloudera uses BIGTOP to try and detect JAVA_HOME for you. The practice is questionable at best, if you ask me.
You can make this behave correctly by editing a bigtop configuration file. On Debian/Ubuntu, add this to /etc/default/bigtop-utils
:
export JAVA_HOME=/correct/path/to/java-home
Upvotes: 3
Reputation: 5177
Did you try setting the JAVA_HOME in /etc/profile too. Can you please check this link too Hadoop: «ERROR : JAVA_HOME is not set»
Upvotes: 0