In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
FastDFS how to solve the problem of file synchronization delay, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
FastDFS file synchronization adopts the way of asynchronous replication, how to solve the delay problem of file synchronization? FastDFS's solution is very clever, using timestamps to solve the problem that new uploaded files may not be accessible due to file synchronization delays.
The file name generated by storage contains the source storage ID/IP address and the file creation timestamp. Storage periodically reports file synchronization to tracker, including file timestamps synchronized to other storage in the same group. After receiving the file synchronization report from storage, tracker finds out the minimum timestamp to which each storage in the group is synchronized, and saves it in memory as a storage attribute.
When downloading a file, how do you ensure that the file exists on the selected storage? When client asks tracker which (or which) storage can download the specified file, tracker returns the storage that meets one of the following four conditions:
1) the source storage to which the file is uploaded (identified by the storage ID/IP solved by the file name)
2) (current time-file creation timestamp) > file synchronization delay threshold (such as one day)
3) File creation timestamp
< storage被同步到的时间戳; 4)文件创建时间戳 == storage被同步到的时间戳,且(当前时间 -文件创建时间戳) >The maximum time it takes to synchronize a file (for example, 5 minutes).
The above two parameters, the file synchronization delay threshold and the maximum duration of synchronizing a file, are configured in tracker.conf, and the configuration items are storage_sync_file_max_delay and storage_sync_file_max_time, respectively.
FastDFS skillfully uses timestamps to solve the file access problem caused by file synchronization delay. The time of the servers in the cluster needs to be consistent, with a time error of less than 1 second. It is recommended to use a timing service such as NTP.
After reading the above, have you mastered how FastDFS can solve the problem of file synchronization delay? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.