经过一下午的尝试,终于把这个集群的搭建好了,搭完感觉也没有太大的必要,就当是学习了吧,为之后搭建真实环境做基础。

以下搭建的是一个Ha-Federation-hdfs+Yarn的集群部署。

  首先讲一下我的配置:

  四个节点上的启动的分别是:

  1.qiang117:active namenode,

  2.qiang118 standby namenode ,journalnode,datanode

  3.qiang119 active namenode    ,journalnode,datanode

  4.qiang120 standby namenode ,journalnode,datanode

  这样做纯粹是因为电脑hold不住那么虚拟机了,其实这里所有的节点都应该在不同的服务器上。简单的说,就是117和119做active namenode,118和120做standby namenode,在118.119.120上分别放datanode和journalnode。

此处省略一万字,各种配置好之后。。遇到的问题和记录如下:

1.启动 journalnode,这个journalnode话说我也不是太明白他是干嘛的~~,后续研究吧。在各个节点上启动journalnode:

[qiang@qiang118 hadoop-2.6.]$ sbin/hadoop-daemon.sh start journalnode
starting journalnode, logging to /home/qiang/hadoop-2.6./logs/hadoop-qiang-journalnode-qiang118.qiang.out
[qiang@qiang118 hadoop-2.6.]$ jps
JournalNode
Jps

2. 格式化namenode时报错:(最后查出来是没有关防火墙。。。免密码登陆不代表不用关防火墙)

// :: INFO ipc.Client: Retrying connect to server: qiang119/192.168.75.119:. Already tried  time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=, sleepTime= MILLISECONDS)
// :: INFO ipc.Client: Retrying connect to server: qiang118/192.168.75.118:. Already tried time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=, sleepTime= MILLISECONDS)
// :: INFO ipc.Client: Retrying connect to server: qiang120/192.168.75.120:. Already tried time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=, sleepTime= MILLISECONDS)
// :: INFO ipc.Client: Retrying connect to server: qiang119/192.168.75.119:. Already tried time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=, sleepTime= MILLISECONDS)
// :: WARN namenode.NameNode: Encountered exception during format:
org.apache.hadoop.hdfs.qjournal.client.QuorumException: Unable to check if JNs are ready for formatting. exceptions thrown:
192.168.75.120:: No Route to Host from 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43 to qiang120: failed on socket timeout exception: java.net.NoRouteToHostException: No route to host; For more details see: http://wiki.apache.org/hadoop/NoRouteToHost
192.168.75.119:: No Route to Host from 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43 to qiang119: failed on socket timeout exception: java.net.NoRouteToHostException: No route to host; For more details see: http://wiki.apache.org/hadoop/NoRouteToHost
at org.apache.hadoop.hdfs.qjournal.client.QuorumException.create(QuorumException.java:)
at org.apache.hadoop.hdfs.qjournal.client.QuorumCall.rethrowException(QuorumCall.java:)
at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.hasSomeData(QuorumJournalManager.java:)
at org.apache.hadoop.hdfs.server.common.Storage.confirmFormat(Storage.java:)
at org.apache.hadoop.hdfs.server.namenode.FSImage.confirmFormat(FSImage.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:)
// :: INFO ipc.Client: Retrying connect to server: qiang118/192.168.75.118:. Already tried time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=, sleepTime= MILLISECONDS)
// :: FATAL namenode.NameNode: Failed to start namenode.
org.apache.hadoop.hdfs.qjournal.client.QuorumException: Unable to check if JNs are ready for formatting. exceptions thrown:
192.168.75.120:: No Route to Host from 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43 to qiang120: failed on socket timeout exception: java.net.NoRouteToHostException: No route to host; For more details see: http://wiki.apache.org/hadoop/NoRouteToHost
192.168.75.119:: No Route to Host from 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43 to qiang119: failed on socket timeout exception: java.net.NoRouteToHostException: No route to host; For more details see: http://wiki.apache.org/hadoop/NoRouteToHost
at org.apache.hadoop.hdfs.qjournal.client.QuorumException.create(QuorumException.java:)
at org.apache.hadoop.hdfs.qjournal.client.QuorumCall.rethrowException(QuorumCall.java:)
at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.hasSomeData(QuorumJournalManager.java:)
at org.apache.hadoop.hdfs.server.common.Storage.confirmFormat(Storage.java:)
at org.apache.hadoop.hdfs.server.namenode.FSImage.confirmFormat(FSImage.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:)
// :: INFO util.ExitUtil: Exiting with status
// :: INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43

格式化成功!

[qiang@qiang117 hadoop-2.6.]$ bin/hdfs namenode -format -clusterId hadoop-cluster
// :: INFO namenode.FSNamesystem: Append Enabled: true
// :: INFO util.GSet: Computing capacity for map INodeMap
// :: INFO util.GSet: VM type = -bit
// :: INFO util.GSet: 1.0% max memory MB = 8.9 MB
// :: INFO util.GSet: capacity = ^ = entries
// :: INFO namenode.NameNode: Caching file names occuring more than times
// :: INFO util.GSet: Computing capacity for map cachedBlocks
// :: INFO util.GSet: VM type = -bit
// :: INFO util.GSet: 0.25% max memory MB = 2.2 MB
// :: INFO util.GSet: capacity = ^ = entries
// :: INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
// :: INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes =
// :: INFO namenode.FSNamesystem: dfs.namenode.safemode.extension =
// :: INFO namenode.FSNamesystem: Retry cache on namenode is enabled
// :: INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is millis
// :: INFO util.GSet: Computing capacity for map NameNodeRetryCache
// :: INFO util.GSet: VM type = -bit
// :: INFO util.GSet: 0.029999999329447746% max memory MB = 273.1 KB
// :: INFO util.GSet: capacity = ^ = entries
// :: INFO namenode.NNConf: ACLs enabled? false
// :: INFO namenode.NNConf: XAttrs enabled? true
// :: INFO namenode.NNConf: Maximum size of an xattr:
// :: INFO namenode.FSImage: Allocated new BlockPoolId: BP--192.168.75.117-
// :: INFO common.Storage: Storage directory /home/qiang/hadoop/hdfs/name has been successfully formatted.
// :: INFO namenode.NNStorageRetentionManager: Going to retain images with txid >=
// :: INFO util.ExitUtil: Exiting with status
// :: INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at qiang117/192.168.75.117
************************************************************/

3.开启namenode:

[qiang@qiang117 hadoop-2.6.]$ sbin/hadoop-daemon.sh start namenode
starting namenode, logging to /home/qiang/hadoop-2.6./logs/hadoop-qiang-namenode-qiang117.out
[qiang@qiang117 hadoop-2.6.]$ jps
NameNode
Jps

4.格式化standby namenode

[qiang@qiang119 hadoop-2.6.]$ bin/hdfs namenode -bootstrapStandby
// :: INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = qiang119/192.168.75.119
STARTUP_MSG: args = [-bootstrapStandby]
STARTUP_MSG: version = 2.6.0
.....
.....
STARTUP_MSG: build = https://git-wip-us.apache.org/repos/asf/hadoop.git -r e3496499ecb8d220fba99dc5ed4c99c8f9e33bb1; compiled by 'jenkins' on 2014-11-13T21:10Z
STARTUP_MSG: java = 1.8.0_51
************************************************************/
// :: INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
// :: INFO namenode.NameNode: createNameNode [-bootstrapStandby]
=====================================================
About to bootstrap Standby ID nn2 from:
Nameservice ID: hadoop-cluster1
Other Namenode ID: nn1
Other NN's HTTP address: http://qiang117:50070
Other NN's IPC address: qiang117/192.168.75.117:8020
Namespace ID:
Block pool ID: BP--192.168.75.117-
Cluster ID: hadoop-cluster
Layout version: -
=====================================================
// :: INFO common.Storage: Storage directory /home/qiang/hadoop/hdfs/name has been successfully formatted.
// :: INFO namenode.TransferFsImage: Opening connection to http://qiang117:50070/imagetransfer?getimage=1&txid=0&storageInfo=-60:1244139539:0:hadoop-cluster
// :: INFO namenode.TransferFsImage: Image Transfer timeout configured to milliseconds
// :: INFO namenode.TransferFsImage: Transfer took .01s at 0.00 KB/s
// :: INFO namenode.TransferFsImage: Downloaded file fsimage.ckpt_0000000000000000000 size bytes.
// :: INFO util.ExitUtil: Exiting with status
// :: INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at qiang119/192.168.75.119
************************************************************/

5.开启standby namenode

[qiang@qiang119 hadoop-2.6.]$ sbin/hadoop-daemon.sh start namenode
starting namenode, logging to /home/qiang/hadoop-2.6./logs/hadoop-qiang-namenode-qiang119.out
[qiang@qiang119 hadoop-2.6.]$ jps
JournalNode
NameNode
Jps

在web上 打开以后二个显示都是standy状态:

使用这个命令将nn1切换为active状态:

bin/hdfs haadmin -ns hadoop-cluster1 -transitionToActive nn1

另外两个一样的道理:

开启所有的datanode,这里是在只有配置好ssh免密码登录的情况下才能使用。可以参考:http://www.cnblogs.com/qiangweikang/p/4740936.html

[qiang@qiang117 hadoop-2.6.]$ sbin/hadoop-daemons.sh start datanode

开了仨,就是之前预设好的192.168.1.118,192.168.1.119和192.168.1.120

启动yarn

[qiang@qiang117 hadoop-2.6.]$ sbin/start-yarn.sh 
starting yarn daemons
starting resourcemanager, logging to /home/qiang/hadoop-2.6./logs/yarn-qiang-resourcemanager-qiang117.out
qiang118: nodemanager running as process . Stop it first.
qiang120: nodemanager running as process . Stop it first.
qiang119: nodemanager running as process . Stop it first.
[qiang@qiang117 hadoop-2.6.]$ jps
NameNode
Jps
ResourceManager

也是可以看到有三个datanode

最后总结一下吧...... 自学大数据的话,有一个简单的部署就足够了,能够让你写好的程序放入hdfs中跑就可以了,这样的集群应该是在最后,或者需要的时候再去详细的做研究,抓紧进入之后的阶段吧~~

Ha-Federation-hdfs +Yarn集群部署方式的更多相关文章

  1. Kubernetes 企业级集群部署方式

    一.Kubernetes介绍与特性 1.1.kubernetes是什么 官方网站:http://www.kubernetes.io • Kubernetes是Google在2014年开源的一个容器集群 ...

  2. 大数据【三】YARN集群部署

    一 概述 YARN是一个资源管理.任务调度的框架,采用master/slave架构,主要包含三大模块:ResourceManager(RM).NodeManager(NM).ApplicationMa ...

  3. MinIO分布式集群部署方式

    文章转载自:https://blog.51cto.com/u_10950710/4843738 关于分布式集群MinIo 单机Minio服务存在单点故障,如果是一个有N块硬盘的分布式Minio,只要有 ...

  4. 大数据Hadoop的HA高可用架构集群部署

        1 概述 在Hadoop 2.0.0之前,一个Hadoop集群只有一个NameNode,那么NameNode就会存在单点故障的问题,幸运的是Hadoop 2.0.0之后解决了这个问题,即支持N ...

  5. activeMQ主要的几类集群部署方式

    官方主从实现的文档:http://activemq.apache.org/masterslave.html   一.activeMQ主要的几类部署方式比较 1.默认的单机部署(kahadb) acti ...

  6. yarn 集群部署,遇到的问题小结

    版本号信息: hadoop 2.3.0  hive 0.11.0 1. Application Master 无法訪问     点击application mater 链接,出现 http 500 错 ...

  7. (转)yarn 集群部署,遇到的问题小结

    link:http://blog.csdn.net/uniquechao/article/details/26449761   版本信息: hadoop 2.3.0  hive 0.11.0   1. ...

  8. spark on yarn 集群部署

    概述 hadoop2.7.1 spark 1.5.1 192.168.31.62   resourcemanager, namenode, master 192.168.31.63   nodeman ...

  9. Flink集群部署

    部署方式 一般来讲有三种方式: Local Standalone Flink On Yarn/Mesos/K8s… 单机模式 参考上一篇Flink从入门到放弃(入门篇2)-本地环境搭建&构建第 ...

随机推荐

  1. 嵌入式设备snmpd 移植和测试(78K为例)

    一.源码目录项内容 agent:编译snmpd程序所需的文件,mibs源文件: apps:其他相关的程序:snmpwalk,snmptrap,snmptest,snmpget,snmpset: mib ...

  2. 使用maven打包额外的jar

    当使用maven打包的时候,部分自己的额外使用的在maven基础库里面是没有的时候: 参考:  https://blog.csdn.net/hguisu/article/details/5107268 ...

  3. 问题排查-JVM堆外内存问题排查

    首先确认堆占用 jmap 查看heap内存使用情况 jmap -heap pid 1 可以查看到MetaspaceSize,CompressedClassSpaceSize,MaxMetaSize j ...

  4. 1103 Integer Factorization

    题意:给出一个正整数N,以及k,p,要求把N分解成k个因式,即N=n1^p + n2^p + ... + nk^p.要求n1,n2,...按降序排列,若有多个解,则选择n1+n2+...+nk最大的, ...

  5. 安装nagios检测hadoop

    Nagios是常用的系统监控工具,提供了很多基本服务的监控脚本,如HTTP,MYSQL等,同时具有不错的可扩展性,自己可定制针对特定参数的监控脚本以及报警的方式. 我现在有三台机器:192.168.0 ...

  6. document.getElementById/Name/TagName

    document.getElementById 1.getElementById 作用:一般页面里ID是唯一的,用于准备定位一个元素 语法: document.getElementById(id) 参 ...

  7. node+express+socket.io制作一个聊天室功能

    首先是下载包: npm install express npm install socket.io 建立文件: 服务器端代码:server.js var http=require("http ...

  8. 100.64.0.0/10运营商级(Carrier-grade)NAT保留IP地址

    在一次跟踪路由的网络操作时发现自己路由器下一跳路由节点的IP地址比较奇怪,是100.64.0.1.好奇促使我查询了这个IP地址的归属,结果是保留地址,到这里觉得比较奇怪了,按照常理以IPv4为例保留的 ...

  9. Python Twisted系列教程19:改变之前的想法

    作者:dave@http://krondo.com/i-thought-i-wanted-it-but-i-changed-my-mind/  译者: Cheng Luo 你可以从”第一部分 Twis ...

  10. 【转】几款移动跨平台App开发框架比较

    原文地址:https://www.cnblogs.com/songxingzheng/p/6482697.html 整理目前流行的跨平台WebApp开发技术的特点,仅供参考. 每个框架几乎都包含以下特 ...