Hadoop environment variable configuration

Hadoop environment variable configuration

# Configure the JAVA_HOME environment variable. Add the following command to the front of the bashrc file. If it already exists in the file, you do not need to add it

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
View Code

 


# Configure the PATH variable. Add the bin and sbin directories of Hadoop and the bin directory of Java to the PATH variable, so that you can directly execute the commands of hadoop and java on the command line, no longer need to write the complete path. The values ​​of each environment variable are separated by ":">, and use "$" to refer to the environment variables that have been defined.

export PATH=$PATH:$JAVA_HOME/bin:/usr/local/hadoop/bin:/usr/local/hadoop/sbin
View Code

 


#Configure HADOOP_CLASSPATH variable

export HADOOP_CLASSPATH=$(/usr/local/hadoop/bin/hadoop classpath)
View Code

 

 


#Configure the CLASSPATH variable

export CLASSPATH=$CLASSPATH:$HADOOP_CLASSPATH
View Code

 



 

Guess you like

Origin www.cnblogs.com/WLCYSYS/p/12749034.html