hdfs_quota_admin_guide.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta content="Apache Forrest" name="Generator">
  6. <meta name="Forrest-version" content="0.8">
  7. <meta name="Forrest-skin-name" content="pelt">
  8. <title> Directory Quotas Administrator's Guide </title>
  9. <link type="text/css" href="skin/basic.css" rel="stylesheet">
  10. <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
  11. <link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
  12. <link type="text/css" href="skin/profile.css" rel="stylesheet">
  13. <script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
  14. <link rel="shortcut icon" href="images/favicon.ico">
  15. </head>
  16. <body onload="init()">
  17. <script type="text/javascript">ndeSetTextSize();</script>
  18. <div id="top">
  19. <!--+
  20. |breadtrail
  21. +-->
  22. <div class="breadtrail">
  23. <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://hadoop.apache.org/">Hadoop</a> &gt; <a href="http://hadoop.apache.org/core/">Core</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  24. </div>
  25. <!--+
  26. |header
  27. +-->
  28. <div class="header">
  29. <!--+
  30. |start group logo
  31. +-->
  32. <div class="grouplogo">
  33. <a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
  34. </div>
  35. <!--+
  36. |end group logo
  37. +-->
  38. <!--+
  39. |start Project Logo
  40. +-->
  41. <div class="projectlogo">
  42. <a href="http://hadoop.apache.org/core/"><img class="logoImage" alt="Hadoop" src="images/core-logo.gif" title="Scalable Computing Platform"></a>
  43. </div>
  44. <!--+
  45. |end Project Logo
  46. +-->
  47. <!--+
  48. |start Search
  49. +-->
  50. <div class="searchbox">
  51. <form action="http://www.google.com/search" method="get" class="roundtopsmall">
  52. <input value="hadoop.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp;
  53. <input name="Search" value="Search" type="submit">
  54. </form>
  55. </div>
  56. <!--+
  57. |end search
  58. +-->
  59. <!--+
  60. |start Tabs
  61. +-->
  62. <ul id="tabs">
  63. <li>
  64. <a class="unselected" href="http://hadoop.apache.org/core/">Project</a>
  65. </li>
  66. <li>
  67. <a class="unselected" href="http://wiki.apache.org/hadoop">Wiki</a>
  68. </li>
  69. <li class="current">
  70. <a class="selected" href="index.html">Hadoop 0.19 Documentation</a>
  71. </li>
  72. </ul>
  73. <!--+
  74. |end Tabs
  75. +-->
  76. </div>
  77. </div>
  78. <div id="main">
  79. <div id="publishedStrip">
  80. <!--+
  81. |start Subtabs
  82. +-->
  83. <div id="level2tabs"></div>
  84. <!--+
  85. |end Endtabs
  86. +-->
  87. <script type="text/javascript"><!--
  88. document.write("Last Published: " + document.lastModified);
  89. // --></script>
  90. </div>
  91. <!--+
  92. |breadtrail
  93. +-->
  94. <div class="breadtrail">
  95. &nbsp;
  96. </div>
  97. <!--+
  98. |start Menu, mainarea
  99. +-->
  100. <!--+
  101. |start Menu
  102. +-->
  103. <div id="menu">
  104. <div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Documentation</div>
  105. <div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
  106. <div class="menuitem">
  107. <a href="index.html">Overview</a>
  108. </div>
  109. <div class="menuitem">
  110. <a href="quickstart.html">Quickstart</a>
  111. </div>
  112. <div class="menuitem">
  113. <a href="cluster_setup.html">Cluster Setup</a>
  114. </div>
  115. <div class="menuitem">
  116. <a href="hdfs_design.html">HDFS Architecture</a>
  117. </div>
  118. <div class="menuitem">
  119. <a href="hdfs_user_guide.html">HDFS User Guide</a>
  120. </div>
  121. <div class="menuitem">
  122. <a href="hdfs_permissions_guide.html">HDFS Permissions Guide</a>
  123. </div>
  124. <div class="menupage">
  125. <div class="menupagetitle">HDFS Quotas Administrator Guide</div>
  126. </div>
  127. <div class="menuitem">
  128. <a href="commands_manual.html">Commands Manual</a>
  129. </div>
  130. <div class="menuitem">
  131. <a href="hdfs_shell.html">FS Shell Guide</a>
  132. </div>
  133. <div class="menuitem">
  134. <a href="SLG_user_guide.html">Synthetic Load Generator User Guide</a>
  135. </div>
  136. <div class="menuitem">
  137. <a href="distcp.html">DistCp Guide</a>
  138. </div>
  139. <div class="menuitem">
  140. <a href="mapred_tutorial.html">Map-Reduce Tutorial</a>
  141. </div>
  142. <div class="menuitem">
  143. <a href="native_libraries.html">Native Hadoop Libraries</a>
  144. </div>
  145. <div class="menuitem">
  146. <a href="streaming.html">Streaming</a>
  147. </div>
  148. <div class="menuitem">
  149. <a href="hadoop_archives.html">Hadoop Archives</a>
  150. </div>
  151. <div class="menuitem">
  152. <a href="hod.html">Hadoop On Demand</a>
  153. </div>
  154. <div class="menuitem">
  155. <a href="api/index.html">API Docs</a>
  156. </div>
  157. <div class="menuitem">
  158. <a href="jdiff/changes.html">API Changes</a>
  159. </div>
  160. <div class="menuitem">
  161. <a href="http://wiki.apache.org/hadoop/">Wiki</a>
  162. </div>
  163. <div class="menuitem">
  164. <a href="http://wiki.apache.org/hadoop/FAQ">FAQ</a>
  165. </div>
  166. <div class="menuitem">
  167. <a href="http://hadoop.apache.org/core/mailing_lists.html">Mailing Lists</a>
  168. </div>
  169. <div class="menuitem">
  170. <a href="releasenotes.html">Release Notes</a>
  171. </div>
  172. <div class="menuitem">
  173. <a href="changes.html">All Changes</a>
  174. </div>
  175. </div>
  176. <div id="credit"></div>
  177. <div id="roundbottom">
  178. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  179. <!--+
  180. |alternative credits
  181. +-->
  182. <div id="credit2"></div>
  183. </div>
  184. <!--+
  185. |end Menu
  186. +-->
  187. <!--+
  188. |start content
  189. +-->
  190. <div id="content">
  191. <div title="Portable Document Format" class="pdflink">
  192. <a class="dida" href="hdfs_quota_admin_guide.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  193. PDF</a>
  194. </div>
  195. <h1> Directory Quotas Administrator's Guide </h1>
  196. <div id="minitoc-area">
  197. <ul class="minitoc">
  198. <li>
  199. <a href="#Name+Quotas">Name Quotas</a>
  200. </li>
  201. <li>
  202. <a href="#Space+Quotas">Space Quotas</a>
  203. </li>
  204. <li>
  205. <a href="#Administrative+Commands">Administrative Commands</a>
  206. </li>
  207. <li>
  208. <a href="#Reporting+Command">Reporting Command</a>
  209. </li>
  210. </ul>
  211. </div>
  212. <p> The Hadoop Distributed File System (HDFS) allows the administrator to set quotas for the number of names used and the
  213. amount of space used for individual directories. Name quotas and space quotas operate independently, but the administration and
  214. implementation of the two types of quotas are closely parallel. </p>
  215. <a name="N10010"></a><a name="Name+Quotas"></a>
  216. <h2 class="h3">Name Quotas</h2>
  217. <div class="section">
  218. <p> The name quota is a hard limit on the number of file and directory names in the tree rooted at that directory. File and
  219. directory creations fail if the quota would be exceeded. Quotas stick with renamed directories; the rename operation fails if
  220. operation would result in a quota violation. The attempt to set a quota fails if the directory would be in violation of the new
  221. quota. A newly created directory has no associated quota. The largest quota is <span class="codefrag">Long.Max_Value</span>. A quota of one
  222. forces a directory to remain empty. (Yes, a directory counts against its own quota!) </p>
  223. <p> Quotas are persistent with the <span class="codefrag">fsimage</span>. When starting, if the <span class="codefrag">fsimage</span> is immediately in
  224. violation of a quota (perhaps the <span class="codefrag">fsimage</span> was surreptitiously modified),
  225. a warning is printed for each of such violations. Setting or removing a quota creates a journal entry. </p>
  226. </div>
  227. <a name="N10029"></a><a name="Space+Quotas"></a>
  228. <h2 class="h3">Space Quotas</h2>
  229. <div class="section">
  230. <p> The space quota is a hard limit on the number of bytes used by files in the tree rooted at that directory. Block
  231. allocations fail if the quota would not allow a full block to be written. Each replica of a block counts against the quota. Quotas
  232. stick with renamed directories; the rename operation fails if the operation would result in a quota violation. The attempt to
  233. set a quota fails if the directory would be in violation of the new quota. A newly created directory has no associated quota.
  234. The largest quota is <span class="codefrag">Long.Max_Value</span>. A quota of zero still permits files to be created, but no blocks can be added to the files.
  235. Directories don't use host file system space and don't count against the space quota. The host file system space used to save
  236. the file meta data is not counted against the quota. Quotas are charged at the intended replication factor for the file;
  237. changing the replication factor for a file will credit or debit quotas. </p>
  238. <p> Quotas are persistent with the <span class="codefrag">fsimage</span>. When starting, if the <span class="codefrag">fsimage</span> is immediately in
  239. violation of a quota (perhaps the <span class="codefrag">fsimage</span> was surreptitiously modified), a warning is printed for
  240. each of such violations. Setting or removing a quota creates a journal entry. </p>
  241. </div>
  242. <a name="N10042"></a><a name="Administrative+Commands"></a>
  243. <h2 class="h3">Administrative Commands</h2>
  244. <div class="section">
  245. <p> Quotas are managed by a set of commands available only to the administrator. </p>
  246. <ul>
  247. <li>
  248. <span class="codefrag">dfsadmin -setquota &lt;N&gt; &lt;directory&gt;...&lt;directory&gt;</span>
  249. <br> Set the name quota to be <span class="codefrag">N</span> for
  250. each directory. Best effort for each directory, with faults reported if <span class="codefrag">N</span> is not a positive long integer, the
  251. directory does not exist or it is a file, or the directory would immediately exceed the new quota. </li>
  252. <li>
  253. <span class="codefrag">dfsadmin -clrquota &lt;directory&gt;...&lt;director&gt;</span>
  254. <br> Remove any name quota for each directory. Best
  255. effort for each directory, with faults reported if the directory does not exist or it is a file. It is not a fault if the
  256. directory has no quota. </li>
  257. <li>
  258. <span class="codefrag">dfsadmin -setspacequota &lt;N&gt; &lt;directory&gt;...&lt;directory&gt;</span>
  259. <br> Set the space quota to be
  260. N&times;2<sup>30</sup> bytes (GB) for each directory. Best effort for each directory, with faults reported if <span class="codefrag">N</span> is
  261. neither zero nor a positive integer, the directory does not exist or it is a file, or the directory would immediately exceed
  262. the new quota. </li>
  263. <li>
  264. <span class="codefrag">dfsadmin -clrspacequota &lt;directory&gt;...&lt;director&gt;</span>
  265. <br> Remove any space quota for each directory. Best
  266. effort for each directory, with faults reported if the directory does not exist or it is a file. It is not a fault if the
  267. directory has no quota. </li>
  268. </ul>
  269. </div>
  270. <a name="N10079"></a><a name="Reporting+Command"></a>
  271. <h2 class="h3">Reporting Command</h2>
  272. <div class="section">
  273. <p> An an extension to the <span class="codefrag">count</span> command of the HDFS shell reports quota values and the current count of names and bytes in use. </p>
  274. <ul>
  275. <li>
  276. <span class="codefrag">fs -count -q &lt;directory&gt;...&lt;directory&gt;</span>
  277. <br> With the <span class="codefrag">-q</span> option, also report the name quota
  278. value set for each directory, the available name quota remaining, the space quota value set, and the available space quota
  279. remaining. If the directory does not have a quota set, the reported values are <span class="codefrag">none</span> and <span class="codefrag">inf</span>. Space
  280. values are rounded to multiples of 2<sup>30</sup> bytes (GB).
  281. </li>
  282. </ul>
  283. </div>
  284. </div>
  285. <!--+
  286. |end content
  287. +-->
  288. <div class="clearboth">&nbsp;</div>
  289. </div>
  290. <div id="footer">
  291. <!--+
  292. |start bottomstrip
  293. +-->
  294. <div class="lastmodified">
  295. <script type="text/javascript"><!--
  296. document.write("Last Published: " + document.lastModified);
  297. // --></script>
  298. </div>
  299. <div class="copyright">
  300. Copyright &copy;
  301. 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  302. </div>
  303. <!--+
  304. |end bottomstrip
  305. +-->
  306. </div>
  307. </body>
  308. </html>