Apache Hadoop -2.2.0 - How to Install a Three Nodes Cluster

http://tonylixu.blogspot.ca/2014/02/apache-hadoop-how-to-install-three.html

Centos 6.5 hadoop 2.2.0 全分布式安装

http://xjliao.me/2014/03/21/hadoop-2.2.0-cluster-setup.html

==============================

cluster: n0,n1,n2

n0:NameNode,ResourceManager ;

n1.n2:DataNode,NodeManager;

1. prerequiration

1.1 添加用户hm

#useradd hm

#passwd hm

1.2 jdk 1.6/1.7

Remove OpenJDK.
    yum -y remove  *jdk*
    yum -y remove  *java*

1.3 ssh 无密码登录

  1.所有机器: 使用hm用户登录
$cd /home/hm
$mkdir .ssh 2. 在namenode上生成密钥对
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
2.1 .ssh目录要设成700 有执行权限
2.2 authorized_keys要设成600 否则会出错
2.3 还有ssh 登陆要加入用户名的 比如(需要密码)
$ssh n1
$ssh n2 3. 复制公钥(需要密码)
$cd .ssh
$scp authorized_keys n1:/home/hm/.ssh
$scp authorized_keys n2:/home/hm/.ssh
4.测试 (!!不需要密码)
ssh n1
ssh n2

2. hadoop 通用配置

2.1 hadoop-env.sh

2.2 slave 工作节点

3. hadoop四大组件配置

3.1 组件core-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://n0:9000</value>
</property>
<property>
<name>io.file.buffer.size</name>
<value>131072</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/home/hm/temp</value>
</property>
<property>
<name>hadoop.proxyuser.hm.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hm.groups</name>
<value>*</value>
</property>
</configuration>

3.2 组件 hdfs-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>n0:9001</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/home/hm/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/home/hm/dfs/data</value>
</property>
<property>
<name>dfs.replication</name>
<value>2</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
</configuration>

3.3 组件yarn-site.xml

<?xml version="1.0"?>

<configuration>

<!-- Site specific YARN configuration properties -->
<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>n0:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>n0:8030</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>n0:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>n0:8033</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>n0:8088</value>
</property>
</configuration>

3.4 组件mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.jobhistory.address</name>
<value>n0:10020</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>n0:19888</value>
</property>
</configuration>

4. 启动和停止

4.1 启动

sbin/start-dfs.sh

sbin/start-yarn.sh

4.2 停止

sbin/stop-dfs.sh

sbin/stop-yarn.sh

5.测试

运行wordcount单词计数案例:

$ mkdir input
$ cat > input/file
This is word count example
using hadoop 2.2.0

将目录加入hadoop:

$ bin/hadoop hdfs -copyFromLocal input /input

在HADOOP_HOME运行wordcount案例::
$ bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.3.0.jar wordcount /input /output
检查输出:
$ bin/hadoop dfs -cat /out/*

===================

yarn hadoop-2.3.0 installation cluster Centos 64bits的更多相关文章

  1. Centos 6.5 hadoop 2.2.0 全分布式安装

    hadoop 2.2.0 cluster setup 环境: 操作系统:Centos 6.5 jdk:jdk1.7.0_51 hadoop版本:2.2.0 hostname    ip master ...

  2. Hadoop 3.0完全分布式集群搭建方法(CentOS 7+Hadoop 3.2.0)

    本文详细介绍搭建4个节点的完全分布式Hadoop集群的方法,Linux系统版本是CentOS 7,Hadoop版本是3.2.0,JDK版本是1.8. 一.准备环境 1. 在VMware worksta ...

  3. Centos 6.5 X64 环境下编译 hadoop 2.6.0 --已验证

    Centos 6.5 x64 hadoop 2.6.0 jdk 1.7 protobuf-2.5.0 maven-3.0.5 set environment export JAVA_HOME=/hom ...

  4. CentOS 6.4 64位 源码编译hadoop 2.2.0

    搭建环境:Centos 6.4 64bit 1.安装JDK 参考这里2.安装mavenmaven官方下载地址,可以选择源码编码安装,这里就直接下载编译好的wget http://mirror.bit. ...

  5. 64位CentOS上编译 Hadoop 2.2.0

    下载了Hadoop预编译好的二进制包,hadoop-2.2.0.tar.gz,启动起来后.总是出现这样的警告: WARN util.NativeCodeLoader: Unable to load n ...

  6. CentOS 64位上编译 Hadoop 2.6.0

    Hadoop不提供64位编译好的版本号,仅仅能用源代码自行编译64位版本号. 学习一项技术从安装開始.学习hadoop要从编译開始. 1.操作系统编译环境 yum install cmake lzo- ...

  7. 基于Hadoop 2.2.0的高可用性集群搭建步骤(64位)

    内容概要: CentSO_64bit集群搭建, hadoop2.2(64位)编译,安装,配置以及测试步骤 新版亮点: 基于yarn计算框架和高可用性DFS的第一个稳定版本. 注1:官网只提供32位re ...

  8. Hadoop 2.6.0分布式部署參考手冊

    Hadoop 2.6.0分布式部署參考手冊 关于本參考手冊的word文档.能够到例如以下地址下载:http://download.csdn.net/detail/u012875880/8291493 ...

  9. hadoop 2.2.0集群安装

    相关阅读: hbase 0.98.1集群安装 本文将基于hadoop 2.2.0解说其在linux集群上的安装方法,并对一些重要的设置项进行解释,本文原文链接:http://blog.csdn.net ...

随机推荐

  1. Bootstrap3基础 img-rounded 图片的四个角改成圆角

      内容 参数   OS   Windows 10 x64   browser   Firefox 65.0.2   framework     Bootstrap 3.3.7   editor    ...

  2. POJ-1038 Bugs Integrated, Inc. (状压+滚动数组+深搜 的动态规划)

    本题的题眼很明显,N (1 <= N <= 150), M (1 <= M <= 10),摆明了是想让你用状态压缩dp. 整个思路如下:由于要填2*3或者3*2的芯片,那么就要 ...

  3. 【做题】atc_cf17-final_E - Combination Lock——巧妙转化及图论

    题意:给出一个由26个小写字母组成的字符串,可以任意地进行若干个操作,每次操作是让指定区间内的字母变为下一个字母(z变成a).问是否存在方案使得这个字符串变为回文串. 一开始的想法是构造len/2条模 ...

  4. iis6-0 cve-2017-7269 批量验证脚本

    代码地址 import subprocess f = open('ips.txt', 'r') flines = f.readlines() vulnsrvs = 0 i = 1 for line i ...

  5. python 之 运算符

    Python 运算符   Python 运算符 什么是运算符? 本章节主要说明Python的运算符.举个简单的例子 4 +5 = 9 . 例子中,4和5被称为操作数,"+"号为运算 ...

  6. Rime输入法的配色方案

    致青春 so_young: name: "致青春/So Young" author: "五磅兔 zcunlin@foxmail.com" text_color: ...

  7. 【ASP.Net】 http请求中get,put,post,delete的区别与使用总结

    在web api的设计上, 需要设计这个每个action对应的资源的请求方法是什么. Get方法是对服务器资源的请求获取, 一般get方法的参数都放在URL当中的. 所以通常情况下这种请求方式都是不安 ...

  8. kubernetes 实战5_命令_Assign Pods to Nodes&Configure a Pod to Use a ConfigMap

    Assign Pods to Nodes how to assign a Kubernetes Pod to a particular node in a Kubernetes cluster. Ad ...

  9. UVa 11624 Fire!(着火了!)

    UVa 11624 - Fire!(着火了!) Time limit: 1.000 seconds Description - 题目描述 Joe works in a maze. Unfortunat ...

  10. Python: find the smallest and largest value

    题目要求: Write a program that repeatedly prompts a user for integer numbers until the user enters 'done ...