Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Undeletable HDFS Files

SOLVED Go to solution

Undeletable HDFS Files

Contributor

Hi guys,

 

How can I make a file undeletable in Hdfs. Any suggestions ?

 

Thanks in advance

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Undeletable HDFS Files

Master Guru
There is no immutability attribute feature in HDFS as there is on certain
Linux filesystems. Your best bet is proper access and authentication
control.
6 REPLIES 6

Re: Undeletable HDFS Files

Champion

Just put it under the user directory and set the permission just like you we do Linux fs . 

 

Using  hadoop fs shell command. 

hadoop fs -chown
Usage: hadoop fs -chmod 

 

In addition for backup We can configure HDFS Snapshots point in time file recovery . 

https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html

Re: Undeletable HDFS Files

Contributor
Thanks csguna for you reply. I need put files that are not deletable even with superuser. Like chattr in Linux file system.

Re: Undeletable HDFS Files

Champion

Re: Undeletable HDFS Files

Contributor

@saranvisa


Superuser(hdfs) can delete any file in hdfs. So all i need is to make an hdfs file that cannot be deleted by anyone even superuser like the way chattr command do in linux. With ACLs i cannot make a file undeletable for all users. 

 

Thanks

Re: Undeletable HDFS Files

Master Guru
There is no immutability attribute feature in HDFS as there is on certain
Linux filesystems. Your best bet is proper access and authentication
control.

Re: Undeletable HDFS Files

Contributor
Thank you @Harsh J