APP下载

HDFS小文件读写优化策略*

2016-10-28朱永强周珂李丹赵亚萌

计算机时代 2016年9期

朱永强++周珂++李丹++赵亚萌

DOI:10.16644/j.cnki.cn33-1094/tp.2016.09.003

摘 要: HDFS是一种高容错性的分布式系统。它支持的数据集在GB到TB级别,然而对大量小文件存取支持不足。由于在处理大数量级的小文件时,会使得NameNode内存消耗过度,造成文件的存取性能降低。因此提出了一种根据文件类型分类小文件的合并策略。通过建立索引信息服务器来存储存放在用户文件中的小文件的元数据信息,可以达到高效读取小文件的目的。实验结果表明,该优化策略能有效降低NameNode内存消耗,提高HDFS文件系统对大量小文件读取效率。

关键词: HDFS; 小文件存取; 文件类型; 用户文件; 元数据信息

中图分类号:TP391 文献标志码:A 文章编号:1006-8228(2016)09-09-04

HDFS small file read and write optimization strategy

Zhu Yongqiang1,2, Zhou Ke1,2, Li Dan1,2, Zhao Yameng2

(1. School of Computer and Information Engineering Henan University, Kaifeng, Henan 475004, China;

2. Institute of Remote Sensing and Digital Earth Chinese Academy of Sciences)

Abstract: HDFS is a kind of distributed system with high fault tolerance. It supports data set at the GB to the TB level, but lacks of support for the access to a large number of small files. The processing of large number of small files will make the NameNode memory consumption excessive, and result in a reduction of the file access performance. This paper presents a method of merging small files according to the file type. Through the establishment of an index information server to store the metadata of small files stored in the user files, the purpose of reading small files efficiently can be achieved. Experimental results show that the optimization strategy can effectively reduce the NameNode memory consumption, improve the reading efficiency of HDFS file system to a large number of small files.

Key words: HDFS; small file access; file type; user file; Metadata information

0 引言

随着网络和信息技术的不断普及,人类产生的数据量正在呈指数级增长,大约每两年翻一番,根据监测,这个速度在2020年之前会继续保持下去,这意味着人类在最近两年产生的数据量相当于之前产生的数据量总和。资料显示,2011年,全球数据规模为1.8ZB,可以填满575亿个32GB的iPad,这些iPad可以在中国修建两座长城。淘宝网网站每天有超过数千万笔交易,单日产生数据量超过50TB,存储量40PB(1PB等于1000TB)。百度公司存储网页数量接近1万亿页,每天约处理60亿次搜索请求,几十PB数据[1]。云计算[2]已成为当今研究的热门课题,它很好的解决了大数据运算与存储的难题。HDFS是Apache Hadoop Core项目的一部分,现在已成为研究大数据,实现云存储服务的一个很好的模型[3],它是一个不错的分布式文件系统,大部分的HDFS程序对文件操作需要的是一次写多次读的操作模式[4]。……

登录APP查看全文