Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-15886

Add a way to get protected dirs from a special configuration file

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 3.4.0
    • None
    • namenode

    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

        1. HDFS-15886.patch
          115 kB
          Max Xie

        Issue Links

          Activity

            People

              max2049 Max Xie
              max2049 Max Xie
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m