---
title: "经典漫画讲解HDFS原理"
author: "daoger"
date: "2015-08-11T16:32:53Z"
tags: []
categories: ["开源软件"]
slug: "hdfs"
draft: false
lastmod: "2015-08-11T16:32:53Z"
id: 2234522
url: "https://daoger.iteye.com/blog/2234522"
---

转载：http://blog.chinaunix.net/uid-27105712-id-3274395.html

 

分布式文件系统比较出名的有HDFS 和 GFS，其中HDFS比较简单一点。本文是一篇描述非常简洁易懂的漫画形式讲解HDFS的原理。比一般PPT要通俗易懂很多。不难得的学习资料。

1、三个部分: 客户端、nameserver（可理解为主控和文件索引类似linux的inode）、datanode（存放实际数据的存server）

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275494fwjW.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275491EUuz.png)

 

2、如何写数据过程

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275503C707.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275498Z1oo.png)

 

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_13422755124jZ4.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275507R78E.png)

 

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_13422755190MI6.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275516IB54.png)

3、读取数据过程

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275531HHQ6.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275526ud42.png)

4、容错：第一部分：故障类型及其检测方法（nodeserver 故障，和网络故障，和脏数据问题）

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275547E33k.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275539Te06.png)

 

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275559488f.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_13422755514VTl.png)

5、容错第二部分：读写容错

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275570VqbB.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_13422755647m0M.png)

6、容错第三部分：dataNode 失效

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_134227558030Ek.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_13422755744TT0.png)

7、备份规则

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275597rqxO.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_13422755887K2V.png)

8、结束语

[![image](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275603yedb.png "image")](http://blog.chinaunix.net/attachment/201207/14/27105712_1342275600Tfg3.png)