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.
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
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.
< ul>