Details
-
New Feature
-
Status: Patch Available
-
Minor
-
Resolution: Unresolved
-
3.4.0
-
None
Description
We used protected dirs to ensure that important data directories cannot be deleted by mistake. But protected dirs can only be configured in hdfs-site.xml.
For ease of management, we add a way to get the list of protected dirs from a special configuration file.
How to use.
1. set the config in hdfs-site.xml
```
<property>
<name>fs.protected.directories</name>
<value>/hdfs/path/1,/hdfs/path/2,file:///path/to/protected.dirs.config</value>
</property>
```
2. add some protected dirs to the config file (file:///path/to/protected.dirs.config)
```
/hdfs/path/4
/hdfs/path/5
```
3. use command to refresh fs.protected.directories instead of FSDirectory.setProtectedDirectories(..)
```
hdfs dfsadmin -refreshProtectedDirectories
```
Attachments
Attachments
Issue Links
- links to