In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use HDFS to recover deleted files". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use HDFS to recover deleted files.
Hadoop has a "garbage collection bin" function to recover files that have been deleted in the past. If a file has been deleted multiple times, you can also restore the deleted file. This feature is disabled by default. If you want to enable it, you need to add the following configuration in the $HADOOP_HOME/etc/hadoop/core-site.xml file:
Fs.trash.interval 10
The above configuration means: Hadoop will set up a Recycle Bin, which will be emptied every 10 minutes.
If you delete the same file or directory multiple times in a recycling cycle, the file you deleted each time will be saved in different versions within Trash. This means that you can restore files that have been deleted at some point.
For example:
Time point action Trash content 12:40 Recycle Bin empty empty12:41 delete fruit.datafruit.data12:42 re-upload fruit.data and delete fruit.datafruit.data,fruit.data144635293518612:45 re-upload fruit.data and delete fruit.datafruit.data,fruit.data1446352935186,fruit.data144635310039012:50 Recycle Bin empty empty
According to the above table, the second time you delete friut.data at 12:41, fruit. data1446352935186 appears in the Recycle Bin, followed by a string of numbers that are the timestamp of the moment you deleted it. Then we can restore files deleted at 12:41 or 12:45 before the garbage collection bin is emptied.
Combined with the use of hive, there are generally many scheduled tasks to insert updated data into hive, so there will be many versions of a certain table in .Trash. If you want to view the data at a certain time, you only need to restore the data at that time in Trash, which is especially useful for accidental deletion.
At this point, I believe you have a deeper understanding of "how to use HDFS to recover deleted files". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.