FastDFS

FastDFS Distributed File System

1. What is FastDFS

FastDFS is an open source distributed file system written in c language. FastDFS is tailor-made for the Internet, taking full consideration of mechanisms such as redundant backup, load balancing, and linear expansion, and paying attention to indicators such as high availability and high performance. With FastDFS, it is easy to build a high-performance file server cluster to provide file upload and download. And other services.

FastDFS architecture includes Tracker server and Storage server. The client requests the Tracker server to upload and download files, and the Storage server completes the file upload and download through the Tracker server scheduling.

  • Tracker server is used for load balancing and scheduling. The Tracker server can find Storage according to some strategies when files are uploaded. The server provides file upload services. You can call the tracker a tracking server or a dispatch server.

  • Storage server is used for file storage. The files uploaded by the client are finally stored on the Storage server, but the Storage server does not Realize your own file system but use the file system of the operating system to manage files. You can call storage a storage server.

share picture

Two roles on the server side:

  • Tracker: Manage clusters, tracker can also implement clusters. Each tracker node has equal status. Collect the status of the Storage cluster.
  • Storage: Actually save files, Storage is divided into multiple groups, and the files saved between each group are different. There can be multiple members in each group. The contents stored in the group members are the same, and the status of the group members is the same. There is no concept of master and slave.

2. File upload process

share picture

After the client uploads the file, the storage server returns the file ID to the client. This file ID is used for future access Index information of the file. File index information includes: group name, virtual disk path, data two-level directory, and file name.

share picture

< ul>

  • Group name: The name of the storage group where the file is uploaded. After the file is uploaded successfully, the storage server will return it and the client needs to save it by itself.
  • Virtual disk path: the virtual path configured by storage, which corresponds to the disk option store_path*. If store_path0 is configured, it is M00, if store_path1 is configured, it is M01, and so on.
  • Data two-level directory: A two-level directory created by the storage server under each virtual disk path to store data files.
  • File name: different from when the file was uploaded. It is generated by the storage server based on specific information. The file name includes: source storage server IP address, file creation timestamp, file size, random number, file extension and other information.
  • 3. Easy FastDFS build

    Share pictures

    WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
    SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2388 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

    Leave a Comment

    Your email address will not be published.