1. Install Sun's jdk1.6 and the JAVA_HOME environment variable has been directed to the jdk installation directory. (For details, refer to manual installation of SUN's jdk1.6 under Ubuntu10.4 [finishing])
2. Download the stable version of hadoop installation package and decompress it to the/opt/directory.
3. Run the command line
$ Sudo gedit/etc/profile Add at the end of the file
# Set Hadoop environment
Export HADOOP_INSTALL =/opt/hadoop-0.20.203.0
Export PATH = $ PATH: $ HADOOP_INSTALL/bin set the environment variable of the Hadoop installation location
4. Run the hadoop version command to test whether the command is successful.
5. Configuration:
1) independent mode:
In this mode, no special configuration operation is required, you only need to set the HAVA_HOME environment variable of java jdk in the hadoop-env.sh in the/conf directory
2) pseudo-distributed mode:
In this mode, you need to configure 3 profiles (core-site.xml hdfs-site.xml mapred-site.xml under the conf/directory)
<! -- Core-site.xml -->
<Configuration>
<Property>
<Name> fs. default. name </name>
<Value> hdfs: // localhost/</value>
</Property>
</Configuration> <! -- Hdfs-site.xml -->
<Configuration>
<Property>
<Name> dfs. replication </name>
<Value> 1 </value> <! -- If the copy is set to 1, the program will not attempt to copy other machines, and will not generate a warning that the copy cannot be copied -->
</Property>
</Configuration> <! -- Mapred-site.xml -->
<Configuration>
<Property>
<Name> mapred. job. tracker </name>
<Value> localhost: 8021 </value>
</Property>
</Configuration>
6. Configure SSH www.2cto.com
% Sudo apt-get install ssh
Create a new SSH key based on a blank password to start password-less Login
% Ssh-keygen-t rsa-p'-f ~ /. Ssh/id_rsa
% Cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys
Run the following command to test:
% Ssh localhost
If the operation succeeds, you do not need to enter the password.
7. start and end the daemon process
% Start-dfs.sh
% Start-mapred.sh
The local computer starts three daemon, one namenode, one secondary namenode, and one datanode.
In http: // localhost: 50030/view jobtracker or in http: // localhost: 50070/view the jps command of namenode java, you can also check whether the daemon process is running.
% Stop-dfs.sh
% Stop-mapred.sh
8. format the HDFS File System:
% Hadoop namenode-format,
From a strange blog