HDFS Quota Management Guide

Original address: http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_quota_admin_guide.html

Hadoop Distributed File System (HDFS) allows administrators to set quotas per directory. Newly created directories have no quota. The maximum quota is Long.Max_Value. A quota of 1 forces the directory to remain empty.

A directory quota is a hard limit on the number of names in that directory on the directory tree. The operation fails if the quota is exceeded when the file or directory is created. Renaming does not change the directory's quota; if the renaming operation would result in a quota violation, the operation will fail. If an attempt is made to set a quota and the number of existing files exceeds the new quota, the set fails.

Quotas are the same as fsimage. When booting, if the fsimage violates some quota limit (perhaps the fsimage was surreptitiously changed), the boot fails and an error report is generated. Setting or removing a quota creates corresponding log records.

The new commands or options below are for quota support. The first two are administrator commands.

    • dfsadmin -setquota <N> <directory>...<directory>
      Set per-directory quotas to N. This command will try on each directory, and if N is not a positive long, the directory does not exist or has a filename, or the directory exceeds quota, an error report will be generated.
    • dfsadmin -clrquota <directory>...<director>
      removes quotas for each directory. This command will be tried on each directory, and if the directory does not exist or is a file, an error report will be generated. No error will be reported if the directory does not have a quota set.
    • fs -count -q <directory>...<directory>
      With the -q option, the quota set per directory is reported, as well as the remaining quota. If the directory has no quota set, none and inf will be reported.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324486833&siteId=291194637