HDFS问题

来源:互联网 发布:澳门mac专柜 编辑:程序博客网 时间:2024/06/05 06:34

问题1、为什么client在向第一个dataNode写入数据后,第一个dataNode不以并行的方式向第二个和第三个dataNode写数据

问题2、如果文件的大小大于block的大小,那么写入第二个block是在第一个block返回ack packet时,还是写完第一个dataNode的block时,或者是需要重新找到三个namenode来写入下一个block

问题三、客户端向第一个dataNode写数据和第一个dataNode向第二个dataNode写数据是同步的吗?还是client向第一个dataNode写完数据后,第一个dataNode才向第二个dataNode写数据

问题四、HDFS一次写入多次读取,看官方文档的意思是一旦文件created,writed, Closed就不能更改了。但看权威指南上指的是只能追加内容不能修改内容。我的问题是追加内容能否在文件关闭后在打开后进行。还是一旦文件创建完了就不能在进行追加操作了(已解决)

Simple Coherency Model

2.6关于简单一致性模型的描述

HDFS applications need a write-once-read-many access model for files. A file once created, written, and closed need not be changed. This assumption simplifies data coherency issues and enables high throughput data access. A Map/Reduce application or a web crawler application fits perfectly with this model. There is a plan to support appending-writes to files in the future.

2.7关于简单一致性模型的描述

HDFS applications need a write-once-read-many access model for files. A file once created, written, and closed need not be changed except for appends and truncates. Appending the content to the end of the files is supported but cannot be updated at arbitrary point. This assumption simplifies data coherency issues and enables high throughput data access. A MapReduce application or a web crawler application fits perfectly with this model.

由上面的两段文件表明。HDFS在hadoop2.7的版本中已经支持了内容追加和截断的功能。根据权威指南上的说法是:追加操作时可选的,并没有被所有的hadoop文件系统所实现。HDFS支持追加,但S3文件系统就不支持。
0 0