Set Environment Variables for all Users on the Node
About this task
Procedure
-
As root or using sudo, set
JAVA_HOME
andHADOOP_CONF_DIR
in the/etc/environment
file.- Ubuntu example with MapReduce
V1:
JAVA_HOME=/usr/lib/jvm/<version> HADOOP_CONF_DIR=/opt/mapr/hadoop/hadoop-<version>/conf
- RedHat/CentOS example with
YARN:
JAVA_HOME=/usr/java/<version> HADOOP_CONF_DIR=/opt/mapr/hadoop/hadoop-<version>/etc/hadoop/
NOTE: The order of the environment variables in the file does not matter. - Ubuntu example with MapReduce
V1:
-
Run the following command to activate the environment variables for the current
session:
$ source /etc/environment