Statement: For hadoop-related information, please refer to the official documentation and select different versions as needed:
Current version, http://hadoop.apache.org/docs/current/
Version list, http://hadoop.apache.org/docs/
This article uses hadoop version 0.20.2 and Mac OS X 10.7.5.
0. Download hadoop
Https://archive.apache.org/dist/hadoop/core/hadoop-0.20.2/
1. Java environment setup:
Omitted
2. Decompress hadoop:
$ Tar xvzf hadoop-0.20.2.tar.gz
3. $ Vim hadoop-0.20.2/CONF/hadoop-env.sh, configure java_home:
Add "Export java_home =/system/library/Java/javavirtualmachines/1.6.0.jdk/contents/home" in double quotation marks"
4. Modify the environment variables for hadoop. (1) and (2) select one:
(1) Global modification:
$ Vim/etc/paths
Add the section in double quotes, "/users/waterforest/hadoop/hadoop-0.20.2/bin"
(2) User modification:
$ Vim ~ /. Profile
Add the section in double quotes, "Export Path = $ path:/users/waterforest/hadoop/hadoop-0.20.2/bin"
Test 1:
$ Hadoop version
If you see the following content, the configuration is successful:
Hadoop 0.20.2Subversion https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707Compiled by chrisdo on Fri Feb 19 08:07:34 UTC 2010
Test 2:
$ Hadoop-0.20.2 CD
$ Mkdir Input
$ Cp conf/*. xml Input
$ Hadoop jar hadoop-*-examples. Jar grep input output 'dfs [A-Z.] +'
$ Cat output /*
If the following information is displayed, the configuration is successful:
1dfsadmin