hdfs_quota_admin_guide.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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="capacity_scheduler.html">Capacity Scheduler</a>
  156. </div>
  157. <div class="menuitem">
  158. <a href="api/index.html">API Docs</a>
  159. </div>
  160. <div class="menuitem">
  161. <a href="jdiff/changes.html">API Changes</a>
  162. </div>
  163. <div class="menuitem">
  164. <a href="http://wiki.apache.org/hadoop/">Wiki</a>
  165. </div>
  166. <div class="menuitem">
  167. <a href="http://wiki.apache.org/hadoop/FAQ">FAQ</a>
  168. </div>
  169. <div class="menuitem">
  170. <a href="http://hadoop.apache.org/core/mailing_lists.html">Mailing Lists</a>
  171. </div>
  172. <div class="menuitem">
  173. <a href="releasenotes.html">Release Notes</a>
  174. </div>
  175. <div class="menuitem">
  176. <a href="changes.html">All Changes</a>
  177. </div>
  178. </div>
  179. <div id="credit"></div>
  180. <div id="roundbottom">
  181. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  182. <!--+
  183. |alternative credits
  184. +-->
  185. <div id="credit2"></div>
  186. </div>
  187. <!--+
  188. |end Menu
  189. +-->
  190. <!--+
  191. |start content
  192. +-->
  193. <div id="content">
  194. <div title="Portable Document Format" class="pdflink">
  195. <a class="dida" href="hdfs_quota_admin_guide.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  196. PDF</a>
  197. </div>
  198. <h1> Directory Quotas Administrator's Guide </h1>
  199. <div id="minitoc-area">
  200. <ul class="minitoc">
  201. <li>
  202. <a href="#Name+Quotas">Name Quotas</a>
  203. </li>
  204. <li>
  205. <a href="#Space+Quotas">Space Quotas</a>
  206. </li>
  207. <li>
  208. <a href="#Administrative+Commands">Administrative Commands</a>
  209. </li>
  210. <li>
  211. <a href="#Reporting+Command">Reporting Command</a>
  212. </li>
  213. </ul>
  214. </div>
  215. <p> The Hadoop Distributed File System (HDFS) allows the administrator to set quotas for the number of names used and the
  216. amount of space used for individual directories. Name quotas and space quotas operate independently, but the administration and
  217. implementation of the two types of quotas are closely parallel. </p>
  218. <a name="N10010"></a><a name="Name+Quotas"></a>
  219. <h2 class="h3">Name Quotas</h2>
  220. <div class="section">
  221. <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
  222. directory creations fail if the quota would be exceeded. Quotas stick with renamed directories; the rename operation fails if
  223. operation would result in a quota violation. The attempt to set a quota fails if the directory would be in violation of the new
  224. quota. A newly created directory has no associated quota. The largest quota is <span class="codefrag">Long.Max_Value</span>. A quota of one
  225. forces a directory to remain empty. (Yes, a directory counts against its own quota!) </p>
  226. <p> Quotas are persistent with the <span class="codefrag">fsimage</span>. When starting, if the <span class="codefrag">fsimage</span> is immediately in
  227. violation of a quota (perhaps the <span class="codefrag">fsimage</span> was surreptitiously modified),
  228. a warning is printed for each of such violations. Setting or removing a quota creates a journal entry. </p>
  229. </div>
  230. <a name="N10029"></a><a name="Space+Quotas"></a>
  231. <h2 class="h3">Space Quotas</h2>
  232. <div class="section">
  233. <p> The space quota is a hard limit on the number of bytes used by files in the tree rooted at that directory. Block
  234. allocations fail if the quota would not allow a full block to be written. Each replica of a block counts against the quota. Quotas
  235. stick with renamed directories; the rename operation fails if the operation would result in a quota violation. The attempt to
  236. set a quota fails if the directory would be in violation of the new quota. A newly created directory has no associated quota.
  237. 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.
  238. Directories don't use host file system space and don't count against the space quota. The host file system space used to save
  239. the file meta data is not counted against the quota. Quotas are charged at the intended replication factor for the file;
  240. changing the replication factor for a file will credit or debit quotas. </p>
  241. <p> Quotas are persistent with the <span class="codefrag">fsimage</span>. When starting, if the <span class="codefrag">fsimage</span> is immediately in
  242. violation of a quota (perhaps the <span class="codefrag">fsimage</span> was surreptitiously modified), a warning is printed for
  243. each of such violations. Setting or removing a quota creates a journal entry. </p>
  244. </div>
  245. <a name="N10042"></a><a name="Administrative+Commands"></a>
  246. <h2 class="h3">Administrative Commands</h2>
  247. <div class="section">
  248. <p> Quotas are managed by a set of commands available only to the administrator. </p>
  249. <ul>
  250. <li>
  251. <span class="codefrag">dfsadmin -setquota &lt;N&gt; &lt;directory&gt;...&lt;directory&gt;</span>
  252. <br> Set the name quota to be <span class="codefrag">N</span> for
  253. each directory. Best effort for each directory, with faults reported if <span class="codefrag">N</span> is not a positive long integer, the
  254. directory does not exist or it is a file, or the directory would immediately exceed the new quota. </li>
  255. <li>
  256. <span class="codefrag">dfsadmin -clrquota &lt;directory&gt;...&lt;director&gt;</span>
  257. <br> Remove any name quota for each directory. Best
  258. 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
  259. directory has no quota. </li>
  260. <li>
  261. <span class="codefrag">dfsadmin -setspacequota &lt;N&gt; &lt;directory&gt;...&lt;directory&gt;</span>
  262. <br> Set the space quota to be
  263. 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
  264. neither zero nor a positive integer, the directory does not exist or it is a file, or the directory would immediately exceed
  265. the new quota. </li>
  266. <li>
  267. <span class="codefrag">dfsadmin -clrspacequota &lt;directory&gt;...&lt;director&gt;</span>
  268. <br> Remove any space quota for each directory. Best
  269. 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
  270. directory has no quota. </li>
  271. </ul>
  272. </div>
  273. <a name="N10079"></a><a name="Reporting+Command"></a>
  274. <h2 class="h3">Reporting Command</h2>
  275. <div class="section">
  276. <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>
  277. <ul>
  278. <li>
  279. <span class="codefrag">fs -count -q &lt;directory&gt;...&lt;directory&gt;</span>
  280. <br> With the <span class="codefrag">-q</span> option, also report the name quota
  281. value set for each directory, the available name quota remaining, the space quota value set, and the available space quota
  282. 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
  283. values are rounded to multiples of 2<sup>30</sup> bytes (GB).
  284. </li>
  285. </ul>
  286. </div>
  287. </div>
  288. <!--+
  289. |end content
  290. +-->
  291. <div class="clearboth">&nbsp;</div>
  292. </div>
  293. <div id="footer">
  294. <!--+
  295. |start bottomstrip
  296. +-->
  297. <div class="lastmodified">
  298. <script type="text/javascript"><!--
  299. document.write("Last Published: " + document.lastModified);
  300. // --></script>
  301. </div>
  302. <div class="copyright">
  303. Copyright &copy;
  304. 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  305. </div>
  306. <!--+
  307. |end bottomstrip
  308. +-->
  309. </div>
  310. </body>
  311. </html>