CentOS6.5下安装Hadoop-2.7.3(图解教程)

注:图片如果损坏,点击文章链接:https://www.toutiao.com/i6627365258090512909/

 

已安装好虚拟机(3个节点)

YUM源已安装好、系统版本CentOS6.5、java版本是1.7,三个节点,其中一个节点完成Hadoop安装后,启动之前克隆两台节点,并完成hadoop用户的免密配置。

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

我们继续安装:

先安装工具:yum install –y net-tools

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

创建目录

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

在master1中创建用户hadoop、id查看创建用户信息(是否成功)、passwd设置密码

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

使用户成为sudoers,以root用户修改文件/etc/sudoers,修改方式如下

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

改回root用户,修改/opt/bigdata文件夹的权限

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

进入hadoop用户

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

进入我们的工具包目录

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

我们将软件解压到/opt/bigdata

解压命令

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

进目录查看下

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

在hadoop目录下建立tmp目录,并将权限设定为777,同时创建dfs、dfs/name、dfs/data

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

进入配置目录

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

以hadoop用户角色配置如下文件

core-site.xml

hdfs-site.xml

masters

slaves

yarn-site.xml

hadoop-env.sh

mapred-env.sh

yarn-env.sh

yarn-slaves

编辑yarn-env.sh

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

修改如下内容

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

编辑 hadoop-env.sh

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

修改如下内容

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

编辑mapred=env.sh

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

修改如下内容

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

修改core-site.xml

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

修改如下内容

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

文档内容:

<property>

<name>hadoop.tmp.dir</name>

<value>/opt/bigdata/hadoop-2.7.3/tmp</value>

</property>

<property>

<name>fs.default.name</name>

<value>hdfs://master1:9000</value>

</property>

<property>

<name>hadoop.proxyuser.hadoop.hosts</name>

<value>*</value>

</property>

<property>

<name>hadoop.proxyuser.hadoop.groups</name>

<value>*</value>

</property>

编辑hdfs-site.xml

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

修改如下内容

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

文档内容

<property>

<name>dfs.replication</name>

<value>3</value>

</property>

<property>

<name>dfs.namenode.name.dir</name>

<value>/opt/bigdata/hadoop-2.7.3/dfs/name</value>

</property>

<property>

<name>dfs.datanode.data.dir</name>

<value>/opt/bigdata/hadoop-2.7.3/dfs/data</value>

</property>

<property>

<name>dfs.web.ugi</name>

<value>hdfs,hadoop</value>

</property>

<property>

<name>dfs.permissions</name>

<value>false</value>

</property>

编辑yarn-site.xml

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

修改如下内容

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

文档内容:

<!-- Site specific YARN configuration properties -->

<property>

<name>yarn.resourcemanager.hostname</name>

<value>master1</value>

</property>

<property>

<name>yarn.resourcemanager.webapp.address</name>

<value>master1:8088</value>

</property>

<property>

<name>yarn.resourcemanager.scheduler.address</name>

<value>master1:8081</value>

</property>

<property>

<name>yarn.resourcemanager.resource-tracker.address</name>

<value>master1:8082</value>

</property>

<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.web-proxy.address</name>

<value>master1:54315</value>

</property>

编辑mapred-site.xml,我们先把之前的文件模板的文件名修改下

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

修改如下内容

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

文档内容

<property>

<name>mapreduce.framework.name</name>

<value>yarn</value>

</property>

<property>

<name>mapred.job.tracker</name>

<value>master1:9001</value>

</property>

<property>

<name>mapreduce.jobhistory.address</name>

<value>master:110020</value>

</property>

slaves配置(master、slave1和slave2均作为datanode)

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

编辑文件

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

保存退出

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

配置系统环境(转换为root用户)

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

添加内容

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

如果没有克隆,我们将文件拷贝到另外两个节点上(已克隆可忽略)

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

首次启动之前格式化hdfs(克隆完成后)

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

查看没有错误结果

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

我们继续,进入到目录执行下个命令

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

启动成功后查看

CentOS6.5下安装Hadoop-2.7.3(图解教程)

 

在浏览器里输入

CentOS6.5下安装Hadoop-2.7.3(图解教程)

posted on 2018-12-07 09:15  那山的狐狸  阅读(851)  评论(0编辑  收藏  举报

导航