Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st. We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here. Need help or have questions? Drop us a line at [email protected]
As soons as you realize that you have accidentally deleted the the files/directories in HDFS, immediately force the name node to go in SafeMode (hadoop namenode -safemode enter) to avoid further damage to file system. If possible, shutdown the NN and DataNodes
Check out the core-site.xml, to verify if Trash is enabled (look for configuration parameter ‘fs.trash.interval’. The value greater than zero value indicates number or minutes that data will be kept in Trash)
If the number is more than the duration between delete command execution and namenode shutdown/safe mode, then you can recover the files from user’s Trash folder. If Trash is not enabled, contact Hortonworks support immediately. DO NOT restart the namenode and/or bring it out of safe mode. Doing so may delete your data permanently.