1, download the 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, download JDK directly from Oracle website, address: http://www.oracle.com/technetwork/java/javase/downloads/index.html
4, chmod +x jdk-6u21-linux-i586.bin; /jdk-6u21-linux-i586.bin, the jdk1.6.0_21 directory appears in the current directory
5. Configure Java environment variable Vi/etc/profile
Copy Code code as follows:
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 make configuration effective
6, you can use the following command to view
Show Java version java-vesion
Copy Code code as follows:
Echo $JAVA _home
which Java
Echo $PATH
Echo $CLASSPATH
If Java-version does not display your JDK version, please check your path settings.
7. Configure Hadoop environment variable Vi/etc/profile
Copy Code code as follows:
Export hadoop_install=/root/src/hadoop/hadoop-0.20.2
Export path= $PATH: $HADOOP _install/bin
Source/etc/profile the configuration to take effect
8. Test environment
Hadoop version Display
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 08:07:34 UTC 2010
9, configuration
Hadoop each component uses an XML file configuration, the core attributes in Core-site.xml, the HDFs attribute in Hdfs-site.xml, and the MapReduce attribute in Mapred-site.xml. These files are in the Conf subdirectory.
Hadoop has three kinds of local mode, pseudo distribution mode and full distribution mode, default configuration is local mode, no daemon, everything is running on a single JVM.