|
Recently been self Hadoop, today, take the time to set up a development environment, and organize written.
We must first look at Hadoop operating modes:
Stand-alone mode (standalone)
Stand-alone mode is the default mode of Hadoop. When you first unpack the source package Hadoop, Hadoop can not understand the hardware installation environment, they chose a conservative minimum configuration. In this default mode for all three XML files are empty. When the configuration file is empty, Hadoop completely run locally. Because no other nodes interact with the stand-alone mode is not used HDFS, Hadoop does not load any of the daemon. This mode is mainly used for application development and debugging logic MapReduce programs.
Pseudo-distribution pattern (Pseudo-Distributed Mode)
Pseudo-run Hadoop distribution pattern in the "single-node cluster" on which all daemons running on the same machine. This mode is on stand-alone mode increases the code debugging function that allows you to check memory usage, HDFS input and output, as well as interact with other daemons.
Fully distributed mode (Fully Distributed Mode)
1. Install JDK, and specify the default jdk versions of Oracle, the default installation directory is /usr/java/jdk1.7.0_45, hereinafter set it
JAVA_HOME
rpm -ivh jdk-7u51-linux-i586.rpm
vi jdk_install.sh
Finally source jdk_install.sh, complete configurations, view the configuration method java -version, make sure not openJDK.
Modify environment variables, it is recommended to re-establish a shell script file in the etc / profile.d to install the jdk
#This Is a shell file for Java Environment Installation
export JAVA_HOME = / usr / java / jdk1.7.0_45
PATH = $ JAVA_HOME / bin: $ PATH
export JRE_HOME = $ JAVA_HOME / jre
export CLASSPATH = /:. $ JAVA_HOME / lib: $ JAVA_HOME / jre / lib
2. Configure hadoop environment variable
#set hadoop2.2.0 environment
export HADOOP_HOME = / hadoop / hadoop-2.2.0
export PATH = $ PATH: $ HADOOP_HOME / bin
export PATH = $ PATH: $ HADOOP_HOME / sbin
3.hadoop Unzip the package
tar -zcvf hadoop-2.2.0.tar.gz
4. Modify the XML file, the file hadoop hadoop file in the directory etc / hadoop, add the following content
Here is a set of namenode daatanode and storage paths.
The last to join jdk specified in hadoop-env.sh this file, the file finally add export JAVA_HOME = / usr / java / jdk1.7.0_45 is your jdk directory |
|
|
|