Created 06-21-2021 03:32 AM
HDFS服务 /user/hive/warehouse整个目录被删,请协助
Created 06-21-2021 04:15 AM
HDFS has a trash facility, in which deleted files are not actually deleted but rather are moved to a trash folder, where they remain for a minimum period before being permanently deleted by the system. The minimum period in minutes that a file will remain in the trash is set using the fs.trash.interval configuration property in core-site.xml.
The above said is true only when we have trash enabled or when -skipTrash is not used during delete operation. So please check whether the directory is present under "/user/<user-name>/.Trash". If the file is present then we can simply use mv or ditscp to recover the file to its original location.
If you have executed the operation recently then you can check NN UI for Blocks Pending Deletion. If this shows 0 blocks/relicas, then this means the blocks are already removed, and then we might need to use other mechanisms like snapshot or copy from the remote cluster. Please refer to below article for more details.
Created 06-21-2021 03:37 AM
Translation in English: The entire directory of HDFS service /user/hive/warehouse has been deleted, please assist
Regards,
Vidya Sargur,Created 06-21-2021 03:49 AM
Hi @FEIDAI
Check in hdfs trash if the deleted folder is there. (if you haven't used -skipTrash)
If you manage to find the folder under trash, copy it to your destination path
hdfs dfs -cp /user/hdfs/.Trash/Current/<your file> <destination>
Otherwise, The best option is probably to find and use a data recovery tool or backup,
Regards,
Created 06-21-2021 04:15 AM
HDFS has a trash facility, in which deleted files are not actually deleted but rather are moved to a trash folder, where they remain for a minimum period before being permanently deleted by the system. The minimum period in minutes that a file will remain in the trash is set using the fs.trash.interval configuration property in core-site.xml.
The above said is true only when we have trash enabled or when -skipTrash is not used during delete operation. So please check whether the directory is present under "/user/<user-name>/.Trash". If the file is present then we can simply use mv or ditscp to recover the file to its original location.
If you have executed the operation recently then you can check NN UI for Blocks Pending Deletion. If this shows 0 blocks/relicas, then this means the blocks are already removed, and then we might need to use other mechanisms like snapshot or copy from the remote cluster. Please refer to below article for more details.
Created 06-27-2021 11:50 PM
Hi @FEIDAI, has any of the replies resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.
Regards,
Vidya Sargur,