- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Accidentally deleted directories on HDFS
- Labels:
-
Apache Hadoop
Created 04-23-2018 04:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When data is accidentally removed from HDFS, is there a way to recover it from Trash? Trash is enabled to 360.
However I don’t see the files in the user’s /.Trash.
Created 04-23-2018 06:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you are deleting a data from HDFS all the data will be moved to Trash. But there is a time span between which the trash will be flushed out on regular frequency. If its flushed out then there is no way to recover the data unless you DR in place which is possible only in production environment.
Hope it Helps!!
Created 04-23-2018 07:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey don't panic the files is right in there, the .Trash hides some subdirectories /Current/user see below.
Replace {xxx} with the hdfs who deleted the file and after the last / you will see all the files deleted and are not yet expurged from HDFS in your case 360.
As the user or hdfs run the below
$hdfs dfs -ls /user/{xxx}/.Trash/Current/user/{xxx}/
and to restore the file
$ hdfs dfs -cp /user/{xxx}/.Trash/Current/user/{xxx}/deleted_file /user/{xxx}/
Hope that helps