Ha-Federation-hdfs +Yarn集群部署方式
经过一下午的尝试,终于把这个集群的搭建好了,搭完感觉也没有太大的必要,就当是学习了吧,为之后搭建真实环境做基础。
以下搭建的是一个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集群部署方式的更多相关文章
- Kubernetes 企业级集群部署方式
一.Kubernetes介绍与特性 1.1.kubernetes是什么 官方网站:http://www.kubernetes.io • Kubernetes是Google在2014年开源的一个容器集群 ...
- 大数据【三】YARN集群部署
一 概述 YARN是一个资源管理.任务调度的框架,采用master/slave架构,主要包含三大模块:ResourceManager(RM).NodeManager(NM).ApplicationMa ...
- MinIO分布式集群部署方式
文章转载自:https://blog.51cto.com/u_10950710/4843738 关于分布式集群MinIo 单机Minio服务存在单点故障,如果是一个有N块硬盘的分布式Minio,只要有 ...
- 大数据Hadoop的HA高可用架构集群部署
1 概述 在Hadoop 2.0.0之前,一个Hadoop集群只有一个NameNode,那么NameNode就会存在单点故障的问题,幸运的是Hadoop 2.0.0之后解决了这个问题,即支持N ...
- activeMQ主要的几类集群部署方式
官方主从实现的文档:http://activemq.apache.org/masterslave.html 一.activeMQ主要的几类部署方式比较 1.默认的单机部署(kahadb) acti ...
- yarn 集群部署,遇到的问题小结
版本号信息: hadoop 2.3.0 hive 0.11.0 1. Application Master 无法訪问 点击application mater 链接,出现 http 500 错 ...
- (转)yarn 集群部署,遇到的问题小结
link:http://blog.csdn.net/uniquechao/article/details/26449761 版本信息: hadoop 2.3.0 hive 0.11.0 1. ...
- spark on yarn 集群部署
概述 hadoop2.7.1 spark 1.5.1 192.168.31.62 resourcemanager, namenode, master 192.168.31.63 nodeman ...
- Flink集群部署
部署方式 一般来讲有三种方式: Local Standalone Flink On Yarn/Mesos/K8s… 单机模式 参考上一篇Flink从入门到放弃(入门篇2)-本地环境搭建&构建第 ...
随机推荐
- 谈谈对zynq的浅显理解
zynq并不能说是一个嵌入arm核的FPGA.从它的启动过程就可以发现,绝对是arm主导的,所以称它为以高性能FPGA为外设的双核arm或许更为合适.以下是优势: 第一个:开发环境的大集成.从hls到 ...
- PTA 1004 Counting Leaves (30)(30 分)(dfs或者bfs)
1004 Counting Leaves (30)(30 分) A family hierarchy is usually presented by a pedigree tree. Your job ...
- Spring不支持静态注入
在springframework里,我们不能@Autowired一个静态变量,使之成为一个spring bean,例如下面这样: @Autowired private static YourClass ...
- iframe显示跨域url页面
可以通过JS搞定跨域问题,但是比较麻烦,我就在后台处理了,其实这样本质上也算不上是跨域了 后台otherwebsite.php: <?php $url="www.otherwebsit ...
- node的express中间件之bodyParser
bodyParser用于解析客户端请求的body中的内容,内部使用JSON编码处理,url编码处理以及对于文件的上传处理. 下面是一个文件上传的例子. 建立一个1.html页面 <!DOCTYP ...
- [转]搭建MySQL高可用负载均衡集群
转自:http://www.cnblogs.com/phpstudy2015-6/p/6706465.html 阅读目录 1.简介 2.基本环境 3.配置MySQL主主复制 4.中间件简述 4.1.H ...
- python 打造一个sql注入脚本 (一)
0x00前言: 昨天刚刚看完小迪老师的sql注入篇的第一章 所以有了新的笔记. 0x01笔记: sql注入原理: 网站数据传输中,接受变量传递的值未进行过滤,导致直接带入数据库查询执行的操作. sql ...
- Flask之视图(一)
2.关于Flask 知识点 从Hello World开始 给路由传递参数 返回状态码 重定向 正则URL 设置cookie和获取cookie 扩展 上下文 请求钩子 Flask装饰器路由的实现 Fla ...
- 用django实现redirect的几种方法总结
用django开发web应用, 经常会遇到从一个旧的url转向一个新的url.这种隐射也许有规则,也许没有.但都是为了实现业务的需要.总体说来,有如下几种方法实现 django的 redirect.1 ...
- Docker remote api 开启
https://www.cnblogs.com/520playboy/p/7921633.html ExecStart=/usr/bin/dockerd-current -H unix:///var/ ...