NameNode & DataNode
NameNode类位于org.apache.hadoop.hdfs.server.namenode包下。
NameNode serves as both directory namespace manager and "inode table" for the Hadoop DFS. There is a single NameNode running in any DFS deployment. (Well, except when there is a second backup/failover NameNode.)
The NameNode controls two critical tables:
1) filename->blocksequence (namespace)
2) block->machinelist ("inodes")
The first table is stored on disk and is very precious. The second table is rebuilt every time the NameNode comes up.
'NameNode' refers to both this class as well as the 'NameNode server'. The 'FSNamesystem' class actually performs most of the filesystem management. The majority of the 'NameNode' class itself is concerned with exposing the IPC interface and the http server to the outside world, plus some configuration management.
NameNode implements the ClientProtocol interface, which allows clients to ask for DFS services. ClientProtocol is not designed for direct use by authors of DFS client code. End-users should instead use the org.apache.nutch.hadoop.fs.FileSystem class.
NameNode also implements the DatanodeProtocol interface, used by DataNode programs that actually store DFS data blocks. These methods are invoked repeatedly and automatically by all the DataNodes in a DFS deployment.
NameNode also implements the NamenodeProtocol interface, used by secondary namenodes or rebalancing processes to get partial namenode's state, for example partial blocksMap etc.
DataNode 类位于org.apache.hadoop.hdfs.server.datanode包下。
DataNode is a class (and program) that stores a set of blocks for a DFS deployment. A single deployment can have one or many DataNodes. Each DataNode communicates regularly with a single NameNode. It also communicates with client code and other DataNodes from time to time.
DataNodes store a series of named blocks. The DataNode allows client code to read these blocks, or to write new block data. The DataNode may also, in response to instructions from its NameNode, delete blocks or copy blocks to/from other DataNodes.
The DataNode maintains just one critical table: 
block-> stream of bytes (of BLOCK_SIZE or less)
This info is stored on a local disk. The DataNode reports the table's contents to the NameNode upon startup and every so often afterwards.
DataNodes spend their lives in an endless loop of asking the NameNode for something to do. A NameNode cannot connect to a DataNode directly; a NameNode simply returns values from functions invoked by a DataNode.
DataNodes maintain an open server socket so that client code or other DataNodes can read/write data. The host/port for this server is reported to the NameNode, which then sends that information to clients or other DataNodes that might be interested.
查找工程里的类或者是资源文件:Ctrl + Shift + R。
查找jar包里的类:Ctrl + Shift + T。
NameNode & DataNode的更多相关文章
- HDFS Namenode&Datanode
		HDFS Namenode&Datanode HDFS 机制粗略示意图 客户端写入文件流程: NN && DN Namenode(NN)工作机制 NN是整个文件系统的管理节点. ... 
- hadoop stop-dfs.sh 无法停止 namenode datanode
		原因: HADOOP_PID_DIR 默认为 /tmp 目录,如果长期不访问/tmp/目录下的文件,文件会被自动清理,因此 stop-dfs.sh 无法根据 pid 停止 namenode, data ... 
- Hadoop学习笔记(老版本,YARN之前),MapReduce任务Namenode DataNode Jobtracker Tasktracker之间的关系
		一.基本概念 在MapReduce中,一个准备提交执行的应用程序称为“作业(job)”,而从一个作业划分出的运行于各个计算节点的工作单元称为“任务(task)”.此外,Hadoop提供的分布式文件系统 ... 
- hdfs namenode/datanode工作机制
		一. namenode工作机制 1. 客户端上传文件时,namenode先检查有没有同名的文件,如果有,则直接返回错误信息.如果没有,则根据要上传文件的大小以及block的大小,算出需要分成几个blo ... 
- namenode datanode理解
		HDFS是以NameNode和DataNode管理者和工作者模式运行的. NameNode管理着整个HDFS文件系统的元数据.从架构设计上看,元数据大致分成两个层次:Name ... 
- 【Hadoop】hdfs的秘密,namenode,datanode,yarn,安全模式,fsimage,edits...
		1.bin/hdfs namenode -format ** 注意事项 1.在配置好了配置文件之后,首次启动之前,做初始化操作 2.在后续启动的时候,不需要再初始化 3.初始化的一些影响 一.初始化操 ... 
- [Hadoop异常处理] Namenode和Datanode都正常启动,但是web页面不显示
		异常 namenode和data都正常启动 但是web页面却不显示,都为零 解决办法一: 在hdfs-site.xml配置文件中,加入 <property> <name>dfs ... 
- HDFS体系结构(NameNode、DataNode详解)
		hadoop项目地址:http://hadoop.apache.org/ NameNode.DataNode详解 (一)分布式文件系统概述 数据量越来越多,在一个操作系统管辖的范围存不下了,那么就分配 ... 
- datanode与namenode的通信
		在分析DataNode时, 因为DataNode上保存的是数据块, 因此DataNode主要是对数据块进行操作. A. DataNode的主要工作流程1. 客户端和DataNode的通信: 客户端向D ... 
随机推荐
- Distribute numbers to two “containers” and minimize their difference of sum
			it can be solved by Dynamical Programming.Here are some useful link: Tutorial and Code: http://www.c ... 
- 重构Web Api程序(Api Controller和Entity)
			Insus.NET较习惯做法,是在程序完成之后,抽一些少时间对写好的代码重新审视.比如这些天写的Web Api的程序来说,发现有很多值得重构代码. 开发ASP.NET MVC程序,与数据相关有关联的一 ... 
- [转]解决GET请求时中文乱码的问题
			原文地址:http://www.cnblogs.com/liukemng/p/4178882.html 之前项目中的web.xml中的编码设置: <filter> <filter-n ... 
- maven常用插件: 打包源码 / 跳过测试 / 单独打包依赖项
			一.指定编译文件的编码 maven-compile-plugin <plugin> <groupId>org.apache.maven.plugins</groupId& ... 
- ReactNative运行提示缺少文件xxxRootView.h解决方法
			我们经常在github获取源码后运行会出现缺少 "RCTRootView.h" notfound" 文件的错误,对于这种错误我们怎么解决了. 1.cd到项目根目录 删除项 ... 
- .net RPC框架选型
			近期开始研究分布式架构,会涉及到一个最核心的组件:RPC(Remote Procedure Call Protocol).这个东西的稳定性与性能,直接决定了分布式架构系统的好坏.RPC技术,我们的产品 ... 
- Spire.Doc组件读取与写入Word
			之前写了一篇开源组件DocX读写word的文章,当时时间比较匆忙选了这个组件,使用过程中还是有些不便,不能提前定义好模版,插入Form表单域进行替换.最近无意中发现Spire.Doc组件功能很强大,目 ... 
- suggest插件实现下拉选择筛选
			实现的效果展示: 代码如下: 1.需要引入jquery,bootstrap-suggest.js,bootstrap.min.css 2.html页面代码: <!DOCTYPE html> ... 
- ajax请求加载Loading或错误提示
			<div id="loadingDiv" style="color:#f39800;">Loading...</div> <scr ... 
- [NOIP摸你赛]Hzwer的陨石(带权并查集)
			题目描述: 经过不懈的努力,Hzwer召唤了很多陨石.已知Hzwer的地图上共有n个区域,且一开始的时候第i个陨石掉在了第i个区域.有电力喷射背包的ndsf很自豪,他认为搬陨石很容易,所以他将一些区域 ... 
