Under linux set up hadoop environment steps to share
- 2020-05-06 12:09:47
- OfStack
1. Download hadoop package
wget http://apache.freelamp.com/hadoop/core/stable/hadoop-0.20.2.tar.gz
2, tar xvzf hadoop - 0.20.2. tar. gz
3, install JDK, from direct download JDK oracle website, address: http: / / www oracle. com technetwork/java javase/downloads/index html
4. chmod +x jdk-6u21-linux-i586. ./ jdk-6u21-linux-i586.bin, jdk1.6.0_21 directory
appears in the current directory
5. Configure java environment variable vi /etc/profile
export JAVA_HOME=/root/src/hadoop/jdk1.6.0_21
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$PATH:$JAVA_HOME/bin
Execute source /etc/profile under terminal to enable configuration
6. You can view
with the following command
Display JAVA version java-vesion
echo $JAVA_HOME
which java
echo $PATH
echo $CLASSPATH
If java-version does not display your version of JDK, please check your path Settings.
7. Configure hadoop environment variable vi /etc/profile
export HADOOP_INSTALL=/root/src/hadoop/hadoop-0.20.2
export PATH=$PATH:$HADOOP_INSTALL/bin
source /etc/profile enables configuration to take effect
8. Test environment
hadoop version shows
Hadoop 0.20.2
Subversion https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707
Compiled by chrisdo on Fri Feb 19 08:07:34 UTC 2010
9. Configure
hadoop each component is configured using an XML file, with the core properties in core-site.xml, HDFS in hdfs-site.xml, and MapReduce in mapred-site.xml. These files are in the conf subdirectory.
hadoop comes in local, pseudo-distributed, and fully distributed modes. It is configured as local by default, has no daemon, and runs everything on a single JVM.