2) Tracker Cluster
The Tracker server in a FASTDFS cluster can have more than one, Tracker server is equal to each other while providing services, Tracker server does not have a single point of failure. The client requests tracker Server to poll, and another tracker if the requested tracker cannot provide the service.
3) Storage Cluster
The storage cluster uses a packet storage method . A storage cluster consists of one or more groups consisting of one or more storage servers, and the storage server within the group is an equal relationship between the different groups of storage servers that do not communicate with each other, within the same group storage The servers are connected to each other for file synchronization, ensuring that the files on each storage in the group are exactly the same . The storage capacity of A group is the smallest storage server capacity in the group, the total capacity of the cluster storage is the sum of the storage capacity of all the groups in the cluster , it is obvious that the hardware and software configuration of the storage server in the group is best consistent.
The advantage of using the packet storage method is that it is flexible and controllable. such as uploading a file, can be directly specified by the client to upload the group can also be selected by the tracker scheduling. When a packet storage server has a large access pressure, the storage server can be increased in that group to expand the service capacity ( vertical scaling ). When the system capacity is insufficient, the group can be increased to expand the storage capacity ( horizontal expansion ).
4) Storage Status Collection
Storage server connects all the tracker servers in the cluster and periodically reports its status to them, including statistics such as disk space remaining, file sync status, file upload download count, and so on.
5) File Upload process
After the client uploads the file, the storage server returns the file ID to the client, which is used for subsequent access to the file's index information. File index information includes: Group name, virtual disk path, data level two directory, file name.
N Group name : The name of the storage group where the file was uploaded, and the storage server returns after the file upload is successful, which requires the client to save itself.
n Virtual Disk path : The virtual path of the storage configuration, corresponding to the disk options store_path*. If Store_path0 is configured, it is M00, if STORE_PATH1 is configured M01, and so on.
n data Level two directory : A level Two directory created by the storage server under each virtual disk path for storing data files.
n filename : Different from file upload. is generated by the storage server based on specific information, including information such as the source storage server IP address, file creation timestamp, file size, random number, and file name extension.
6) File download process
Tracker quickly defines a file based on the requested file path, which is the file ID.
For example, request the file below:
1. By group name Tracker can quickly locate the storage server group that the client needs to access, and select the appropriate storage server to provide client access to the group1.
2. The storage server can quickly locate the directory where the file resides, based on the file storage virtual disk path and the data file level two directory, and locate the files that the client needs to access based on the file name.
"Reprint" "Java Second technology picture upload" based on Nginx and Fastdfs, complete the upload and display of pictures