The invention relates to the field of an HDFS of a computer, and discloses a method for storing and
processing small log type files in a Hadoop
distributed file system (HDFS). According to the method, files are combined in a nearby mode according to physical locations, and a Copy-On-Write mechanism is used for optimizing read-write of the
small files; specifically, the small log type files are combined in a nearby mode according to a physical path, a
client side reads and writes the combined files from a NameNode and
Metadata information of indexes of the combined files when reading and writing the small log type files, and then all the small log type file data are read and written from the combined files according to the indexes of the combined files. According to the new
processing method of the small log type files, the
memory load of the
metadata of the
small files are transmitted to the
client side from the NameNode, and the problem that when the HDFS processes a large number of
small files, efficiency is low is effectively solved. The
client side caches the
metadata of the small files, so that the speed of access to the small files is improved, and a user does not need to send a
metadata request to the NameNode when sequentially accessing small files which are adjacent in physical location.