The invention discloses a method for storing a
mass of
small files on the basis of a master-slave
distributed file system, and aims to solve the problem about storing the
mass small files in the master-slave
distributed file system. The technical scheme includes that the method includes that a
mass small
file storage system is deployed and initialized, and then
small files are created and read by a SmallFileAPI (small file-application program interface) of a
client side according to a command received from a keyboard. When the small files are created by a
system, the SmallFileAPI creates data files of the small files according to small file paths obtained from the
client side, writes in small file data and simultaneously creates small file indexes at data nodes; when the small files are read by the
system,
data node information corresponding to a parent
directory is acquired according to the small file paths, an index request is transmitted to any of the data nodes, and finally the small file data are read from the data files according to index information. By the aid of the method, the problem about mass of storage
metadata of the mass of small files is solved, writing efficiency of the mass small
file storage system is improved, and reliability of the system is guaranteed.