What isFastdfs
Fastdfs is an open source Distributed file system written in C language. Fastdfs is tailor-made for the Internet, taking into account such mechanisms as redundant backup, load balancing, and linear scaling, and focusing on high availability, high performance indicators, using fastdfs It is easy to set up a high-performance file server cluster to provide file upload, download and other services.
fastdfs schema includes tracker server and storage server tracker server file upload, download, Through the tracker server Dispatch is ultimately made by Span style= "FONT-FAMILY:CALIBRI;" >storage server complete file upload and download.
The Tracker server role is load balancing and scheduling, and Tracker server can find Storage server based on some policies when uploading files Provide file upload service. You can call Tracker a tracking server or a dispatch server.
Storage Server is a file store, and the files uploaded by the client are eventually stored on the Storage server,storageserver Instead of implementing its own file system, it uses the operating system's file system to manage files. You can call storage a storage server.
Server Two roles:
Tracker: Manage Clusters,Tracker can also implement clusters. Each tracker node has equal status. Collects The status of the Storage cluster.
Storage: The actual save file Storage is divided into groups, and the files that are saved between each group are different. Within each group, there can be multiple members, the contents of which are stored within the membership are the same, the membership is consistent, without the concept of master-slave.
File upload Process
after the client uploads the file, the storage server The ID is returned to the client, and this file ID 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.
Group name : The name of the storage group where the file was uploaded , and the storage server returned after the file upload was successful , it needs to be saved by the client.
n Virtual Disk path : The virtual path of the storage configuration, corresponding to the disk options store_path* . If you have configured
Store_path0 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
File.
n filename : Different from file upload. is generated by the storage server based on specific information, and the file name contains: Source Storage
Server information such as IP address, file creation timestamp, file size, random number, and file extension name.
File download Process
The simplest fastdfs architecture
Summarize
That is, our client is accessing the Tracker server, the Tracker server is the management Storage server, and our files are finally present on the Storage server.
A successful upload returns an array. Contains the group name and a string of links, all of which are strings. Then we can access the uploaded image by visiting this link on the browser. Of course, with the server IP
Fastdfs Preliminary Understanding-Upload Download Process Introduction