名称节点Vs辅助名称节点 [英] name node Vs secondary name node

查看:150
本文介绍了名称节点Vs辅助名称节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hadoop具有一致性和分区容错性,即它属于CAP theoram的CP类。



Hadoop不可用,因为所有节点都依赖于名称节点。如果名称节点下降,集群就会关闭。



但考虑到HDFS集群有一个辅助名称节点,为什么我们不能将hadoop称为可用。如果名称节点关闭,则可以使用辅助名称节点进行写入。



名称节点和辅助名称节点之间的主要区别使hadoop不可用。 / p>

预先致谢。

解决方案

namenode将HDFS文件系统信息存储在名为fsimage的文件中。对文件系统的更新(添加/删除块)没有更新fsimage文件,而是登录到一个文件中,所以I / O只是快速追加流式而不是随机文件写入。在恢复时,namenode会读取fsimage,然后应用日志文件中的所有更改,以使文件系统状态在内存中保持最新状态。这个过程需要时间。



secondarynamenode作业不是次要名称节点,而是定期读取文件系统更改日志并将它们应用到fsimage文件中,从而使其更新。这允许namenode下次更快地启动。

Unfortunatley尽管名称存在,但secondarynamenode服务不是备用辅助名称节点。具体而言,它不提供名称节点的HA。这可以在这里找到。



<请参阅了解HDFS中的NameNode启动操作。请注意,最近的发行版(当前的Hadoop 2.6)引入了 namenode使用NFS(共享存储)的高可用性和/或 namenode使用Quorum Journal Manager的高可用性


Hadoop is Consistent and partition tolerant, i.e. It falls under the CP category of the CAP theoram.

Hadoop is not available because all the nodes are dependent on the name node. If the name node falls the cluster goes down.

But considering the fact that the HDFS cluster has a secondary name node why cant we call hadoop as available. If the name node is down the secondary name node can be used for the writes.

What is the major difference between name node and secondary name node that makes hadoop unavailable.

Thanks in advance.

解决方案

The namenode stores the HDFS filesystem information in a file named fsimage. Updates to the file system (add/remove blocks) are not updating the fsimage file, but instead are logged into a file, so the I/O is fast append only streaming as opposed to random file writes. When restaring, the namenode reads the fsimage and then applies all the changes from the log file to bring the filesystem state up to date in memory. This process takes time.

The secondarynamenode job is not to be a secondary to the name node, but only to periodically read the filesystem changes log and apply them into the fsimage file, thus bringing it up to date. This allows the namenode to start up faster next time.

Unfortunatley the secondarynamenode service is not a standby secondary namenode, despite its name. Specifically, it does not offer HA for the namenode. This is well illustrated here.

See Understanding NameNode Startup Operations in HDFS.

Note that more recent distributions (current Hadoop 2.6) introduces namenode High Availability using NFS (shared storage) and/or namenode High Availability using Quorum Journal Manager.

这篇关于名称节点Vs辅助名称节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆