Hadoop2.0环境安装

Posted shiyueyu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hadoop2.0环境安装相关的知识,希望对你有一定的参考价值。

0. Hadoop源码包下载
http://mirror.bit.edu.cn/apache/hadoop/common
 
1. 集群环境
Master 172.16.11.97
Slave1 172.16.11.98
Slave2 172.16.11.99
 
2. 下载安装包
#Master
wget http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-2.8.2/hadoop-2.8.2.tar.gz
tar zxvf hadoop-2.8.2.tar.gz
 
3. 修改Hadoop配置文件
#Master
cd hadoop-2.8.2/etc/hadoop
vim hadoop-env.sh
export JAVA_HOME=/usr/local/src/jdk1.8.0_152
 
vim yarn-env.sh
export JAVA_HOME=/usr/local/src/jdk1.8.0_152
 
vim slaves
slave1
slave2
 
vim core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://172.16.11.97:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/usr/local/src/hadoop-2.8.2/tmp</value>
</property>
</configuration>
 
vim hdfs-site.xml
<configuration>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>master:9001</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/usr/local/src/hadoop-2.8.2/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/local/src/hadoop-2.8.2/dfs/data</value>
</property>
<property>
<name>dfs.repliction</name>
<value>3</value>
</property>
</configuration>
 
vim mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
 
vim yarn-site.xml
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.resourcemanager.address</name>
<value>master:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>master:8030</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>master:8035</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>master:8033</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>master:8088</value>
</property>
</configuration>
#创建临时目录和文件目录
mkdir /usr/local/src/hadoop-2.8.2/tmp
mkdir -p /usr/local/src/hadoop-2.8.2/dfs/name
mkdir -p /usr/local/src/hadoop-2.8.2/dfs/data
 
 
4. 配置环境变量
#Master、Slave1、Slave2
vim ~/.bashrc
HADOOP_HOME=/usr/local/src/hadoop-2.8.2
export PATH=$PATH:$HADOOP_HOME/bin
#刷新环境变量
source ~/.bashrc
 
5. 拷贝安装包
#Master
scp -r /usr/local/src/hadoop-2.8.2 [email protected]:/usr/local/src/hadoop-2.8.2
scp -r /usr/local/src/hadoop-2.8.2 [email protected]:/usr/local/src/hadoop-2.8.2
 

以上是关于Hadoop2.0环境安装的主要内容,如果未能解决你的问题,请参考以下文章

大数据笔记——Hadoop2.0的安装与配置

Hadoop2.0高可用集群搭建保姆级教程

Eclipse环境搭建并且运行wordcount程序

Hadoop2.0 集群环境的搭建

Hadoop2.0分布式集群的平台搭建

flume 1.8+Hadoop2.0