1. Environment vmware10,centos6.4,64 bit, JDK1.8, Hadoop2.7 requires 64-bit Linux
2, install jdk,hadoop2.7 need JDK7, support JDK1.8, directly unzip the downloaded JDK and configure the variable can be
(1) Download "jdk-7u79-linux-x64.gz" and put it in the/usr/directory
(2) Decompression, input command, TAR-ZXVF jdk-7u79-linux-x64.gz
(3) Edit Vi/etc/profile
Export java_home=/usr/java/jdk1.7.0_79
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
(4) Make the configuration effective, enter the command, Source/etc/profile or. /etc/profile
(5) Enter command, java-version, see Display Java version information JDK configuration complete
3. Installing Hadoop2.7
(1) Download "hadoop-2.7.0.tar.gz" and put it in the/usr/directory
(2) Decompression, input command, TAR-XZVF hadoop-2.7.0.tar.gz
(3) Create Data folder in/root/directory, TMP, HDFS, Hdfs/data, hdfs/name do not create these directories manually Hadoop will also help us create them automatically
4. Configure the Core-site.xml in the/usr/hadoop/hadoop-2.7.0/etc/hadoop directory
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://192.168.241.132:9000</value>
</property>
</configuration>
5. Configure the Hdfs-site.xml in the/usr/hadoop/hadoop-2.7.0/etc/hadoop directory
<configuration>
<property>
<name>dfs.namenode.name.dir</name>
<value>/root/data/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/root/data/Datanode</value>
</property>
<property>
<name>dfs.tmp.dir</name>
<value>/root/data/tmp</value>
</property>
<property>
<name>dfs.replication</name>
<value>1000</value>
</property>
</configuration>
6. Configure the/usr/hadoop/hadoop-2.7.0/etc/hadoop directory under the hadoop-env.sh, yarn-env.sh java_home, do not set, can not start,
Export java_home=/home/java/jdk1.7.0_79
7, configure the/usr/hadoop/hadoop-2.7.0/etc/hadoop directory slaves, delete the default localhost, add a Slave node,
192.168.241.132
8. Start Hadoop on the master server, start automatically from the node and enter the/usr/hadoop/hadoop-2.7.0 directory
(1) Initialize, enter the bin directory input command,./hdfs Namenode-format
(2) Start all in the Sbin input command./start-all.sh, can also separate sbin/start-dfs.sh, sbin/start-yarn.sh
(3) Stop word, enter command, sbin/stop-all.sh
(4) Input command, JPS, can see the relevant information
27282 Secondarynamenode
27590 NodeManager
27434 ResourceManager
27114 DataNode
26988 NameNode
8. Because I am in the corporate network environment cannot be bridged so the use of the NAT way to connect the host and the virtual machine This part of me has been bothering me for a long time. Specific practices are as follows
(1) First shut down the virtual machine's iptables command chkconfig iptables off/on shut down and turn on service iptables stop/service iptables start stop and open I was using the back This
(2) Setting up the virtual machine's network because we are the NAT mode need to do the following first shut down the Windows Firewall, and then click on the virtual machine edit-"Virtual network editor-" Check VMnet-8 Click Set NAT Settings--"Add port mapping
I set up 2 port mappings here to distinguish between 192.168.241.132:8080 tomcat ports and 192.168.241.132:50070 ports
(3) Then we can see the Hadoop page by visiting 192.168.241.132:50070 locally.
Hadoop stand-alone mode configuration