hod_admin_guide.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  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>
  9. Hadoop On Demand
  10. </title>
  11. <link type="text/css" href="skin/basic.css" rel="stylesheet">
  12. <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
  13. <link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
  14. <link type="text/css" href="skin/profile.css" rel="stylesheet">
  15. <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>
  16. <link rel="shortcut icon" href="images/favicon.ico">
  17. </head>
  18. <body onload="init()">
  19. <script type="text/javascript">ndeSetTextSize();</script>
  20. <div id="top">
  21. <!--+
  22. |breadtrail
  23. +-->
  24. <div class="breadtrail">
  25. <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>
  26. </div>
  27. <!--+
  28. |header
  29. +-->
  30. <div class="header">
  31. <!--+
  32. |start group logo
  33. +-->
  34. <div class="grouplogo">
  35. <a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
  36. </div>
  37. <!--+
  38. |end group logo
  39. +-->
  40. <!--+
  41. |start Project Logo
  42. +-->
  43. <div class="projectlogo">
  44. <a href="http://hadoop.apache.org/core/"><img class="logoImage" alt="Hadoop" src="images/core-logo.gif" title="Scalable Computing Platform"></a>
  45. </div>
  46. <!--+
  47. |end Project Logo
  48. +-->
  49. <!--+
  50. |start Search
  51. +-->
  52. <div class="searchbox">
  53. <form action="http://www.google.com/search" method="get" class="roundtopsmall">
  54. <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;
  55. <input name="Search" value="Search" type="submit">
  56. </form>
  57. </div>
  58. <!--+
  59. |end search
  60. +-->
  61. <!--+
  62. |start Tabs
  63. +-->
  64. <ul id="tabs">
  65. <li>
  66. <a class="unselected" href="http://hadoop.apache.org/core/">Project</a>
  67. </li>
  68. <li>
  69. <a class="unselected" href="http://wiki.apache.org/hadoop">Wiki</a>
  70. </li>
  71. <li class="current">
  72. <a class="selected" href="index.html">Hadoop 0.19 Documentation</a>
  73. </li>
  74. </ul>
  75. <!--+
  76. |end Tabs
  77. +-->
  78. </div>
  79. </div>
  80. <div id="main">
  81. <div id="publishedStrip">
  82. <!--+
  83. |start Subtabs
  84. +-->
  85. <div id="level2tabs"></div>
  86. <!--+
  87. |end Endtabs
  88. +-->
  89. <script type="text/javascript"><!--
  90. document.write("Last Published: " + document.lastModified);
  91. // --></script>
  92. </div>
  93. <!--+
  94. |breadtrail
  95. +-->
  96. <div class="breadtrail">
  97. &nbsp;
  98. </div>
  99. <!--+
  100. |start Menu, mainarea
  101. +-->
  102. <!--+
  103. |start Menu
  104. +-->
  105. <div id="menu">
  106. <div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Documentation</div>
  107. <div id="menu_1.1" class="menuitemgroup">
  108. <div class="menuitem">
  109. <a href="index.html">Overview</a>
  110. </div>
  111. <div class="menuitem">
  112. <a href="quickstart.html">Quickstart</a>
  113. </div>
  114. <div class="menuitem">
  115. <a href="cluster_setup.html">Cluster Setup</a>
  116. </div>
  117. <div class="menuitem">
  118. <a href="hdfs_design.html">HDFS Architecture</a>
  119. </div>
  120. <div class="menuitem">
  121. <a href="hdfs_user_guide.html">HDFS User Guide</a>
  122. </div>
  123. <div class="menuitem">
  124. <a href="hdfs_permissions_guide.html">HDFS Permissions Guide</a>
  125. </div>
  126. <div class="menuitem">
  127. <a href="hdfs_quota_admin_guide.html">HDFS Quotas Administrator Guide</a>
  128. </div>
  129. <div class="menuitem">
  130. <a href="commands_manual.html">Commands Manual</a>
  131. </div>
  132. <div class="menuitem">
  133. <a href="hdfs_shell.html">FS Shell Guide</a>
  134. </div>
  135. <div class="menuitem">
  136. <a href="SLG_user_guide.html">Synthetic Load Generator User Guide</a>
  137. </div>
  138. <div class="menuitem">
  139. <a href="distcp.html">DistCp Guide</a>
  140. </div>
  141. <div class="menuitem">
  142. <a href="mapred_tutorial.html">Map-Reduce Tutorial</a>
  143. </div>
  144. <div class="menuitem">
  145. <a href="native_libraries.html">Native Hadoop Libraries</a>
  146. </div>
  147. <div class="menuitem">
  148. <a href="streaming.html">Streaming</a>
  149. </div>
  150. <div class="menuitem">
  151. <a href="hadoop_archives.html">Hadoop Archives</a>
  152. </div>
  153. <div class="menuitem">
  154. <a href="hod.html">Hadoop On Demand</a>
  155. </div>
  156. <div class="menuitem">
  157. <a href="capacity_scheduler.html">Capacity Scheduler</a>
  158. </div>
  159. <div class="menuitem">
  160. <a href="api/index.html">API Docs</a>
  161. </div>
  162. <div class="menuitem">
  163. <a href="jdiff/changes.html">API Changes</a>
  164. </div>
  165. <div class="menuitem">
  166. <a href="http://wiki.apache.org/hadoop/">Wiki</a>
  167. </div>
  168. <div class="menuitem">
  169. <a href="http://wiki.apache.org/hadoop/FAQ">FAQ</a>
  170. </div>
  171. <div class="menuitem">
  172. <a href="http://hadoop.apache.org/core/mailing_lists.html">Mailing Lists</a>
  173. </div>
  174. <div class="menuitem">
  175. <a href="releasenotes.html">Release Notes</a>
  176. </div>
  177. <div class="menuitem">
  178. <a href="changes.html">All Changes</a>
  179. </div>
  180. </div>
  181. <div id="credit"></div>
  182. <div id="roundbottom">
  183. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  184. <!--+
  185. |alternative credits
  186. +-->
  187. <div id="credit2"></div>
  188. </div>
  189. <!--+
  190. |end Menu
  191. +-->
  192. <!--+
  193. |start content
  194. +-->
  195. <div id="content">
  196. <div title="Portable Document Format" class="pdflink">
  197. <a class="dida" href="hod_admin_guide.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  198. PDF</a>
  199. </div>
  200. <h1>
  201. Hadoop On Demand
  202. </h1>
  203. <div id="minitoc-area">
  204. <ul class="minitoc">
  205. <li>
  206. <a href="#Overview">Overview</a>
  207. </li>
  208. <li>
  209. <a href="#Pre-requisites">Pre-requisites</a>
  210. </li>
  211. <li>
  212. <a href="#Resource+Manager">Resource Manager</a>
  213. </li>
  214. <li>
  215. <a href="#Installing+HOD">Installing HOD</a>
  216. </li>
  217. <li>
  218. <a href="#Configuring+HOD">Configuring HOD</a>
  219. <ul class="minitoc">
  220. <li>
  221. <a href="#Minimal+Configuration">Minimal Configuration</a>
  222. </li>
  223. <li>
  224. <a href="#Advanced+Configuration">Advanced Configuration</a>
  225. </li>
  226. </ul>
  227. </li>
  228. <li>
  229. <a href="#Running+HOD">Running HOD</a>
  230. </li>
  231. <li>
  232. <a href="#Supporting+Tools+and+Utilities">Supporting Tools and Utilities</a>
  233. <ul class="minitoc">
  234. <li>
  235. <a href="#logcondense.py+-+Manage+Log+Files">logcondense.py - Manage Log Files</a>
  236. <ul class="minitoc">
  237. <li>
  238. <a href="#Running+logcondense.py">Running logcondense.py</a>
  239. </li>
  240. <li>
  241. <a href="#Command+Line+Options+for+logcondense.py">Command Line Options for logcondense.py</a>
  242. </li>
  243. </ul>
  244. </li>
  245. <li>
  246. <a href="#checklimits.sh+-+Monitor+Resource+Limits">checklimits.sh - Monitor Resource Limits</a>
  247. <ul class="minitoc">
  248. <li>
  249. <a href="#Running+checklimits.sh">Running checklimits.sh</a>
  250. </li>
  251. </ul>
  252. </li>
  253. <li>
  254. <a href="#verify-account+-+Script+to+verify+an+account+under+which+%0A+++++++++++++jobs+are+submitted">verify-account - Script to verify an account under which
  255. jobs are submitted</a>
  256. <ul class="minitoc">
  257. <li>
  258. <a href="#Integrating+the+verify-account+script+with+HOD">Integrating the verify-account script with HOD</a>
  259. </li>
  260. </ul>
  261. </li>
  262. </ul>
  263. </li>
  264. </ul>
  265. </div>
  266. <a name="N1000C"></a><a name="Overview"></a>
  267. <h2 class="h3">Overview</h2>
  268. <div class="section">
  269. <p>The Hadoop On Demand (HOD) project is a system for provisioning and
  270. managing independent Hadoop Map/Reduce and Hadoop Distributed File System (HDFS)
  271. instances on a shared cluster
  272. of nodes. HOD is a tool that makes it easy for administrators and users to
  273. quickly setup and use Hadoop. It is also a very useful tool for Hadoop developers
  274. and testers who need to share a physical cluster for testing their own Hadoop
  275. versions.
  276. </p>
  277. <p>HOD relies on a resource manager (RM) for allocation of nodes that it can use for
  278. running Hadoop instances. At present it runs with the <a href="http://www.clusterresources.com/pages/products/torque-resource-manager.php">Torque
  279. resource manager</a>.
  280. </p>
  281. <p>
  282. The basic system architecture of HOD includes these components:</p>
  283. <ul>
  284. <li>A Resource manager (possibly together with a scheduler)</li>
  285. <li>Various HOD components</li>
  286. <li>Hadoop Map/Reduce and HDFS daemons</li>
  287. </ul>
  288. <p>
  289. HOD provisions and maintains Hadoop Map/Reduce and, optionally, HDFS instances
  290. through interaction with the above components on a given cluster of nodes. A cluster of
  291. nodes can be thought of as comprising two sets of nodes:</p>
  292. <ul>
  293. <li>Submit nodes: Users use the HOD client on these nodes to allocate clusters, and then
  294. use the Hadoop client to submit Hadoop jobs. </li>
  295. <li>Compute nodes: Using the resource manager, HOD components are run on these nodes to
  296. provision the Hadoop daemons. After that Hadoop jobs run on them.</li>
  297. </ul>
  298. <p>
  299. Here is a brief description of the sequence of operations in allocating a cluster and
  300. running jobs on them.
  301. </p>
  302. <ul>
  303. <li>The user uses the HOD client on the Submit node to allocate a desired number of
  304. cluster nodes and to provision Hadoop on them.</li>
  305. <li>The HOD client uses a resource manager interface (qsub, in Torque) to submit a HOD
  306. process, called the RingMaster, as a Resource Manager job, to request the user's desired number
  307. of nodes. This job is submitted to the central server of the resource manager (pbs_server, in Torque).</li>
  308. <li>On the compute nodes, the resource manager slave daemons (pbs_moms in Torque) accept
  309. and run jobs that they are assigned by the central server (pbs_server in Torque). The RingMaster
  310. process is started on one of the compute nodes (mother superior, in Torque).</li>
  311. <li>The RingMaster then uses another resource manager interface (pbsdsh, in Torque) to run
  312. the second HOD component, HodRing, as distributed tasks on each of the compute
  313. nodes allocated.</li>
  314. <li>The HodRings, after initializing, communicate with the RingMaster to get Hadoop commands,
  315. and run them accordingly. Once the Hadoop commands are started, they register with the RingMaster,
  316. giving information about the daemons.</li>
  317. <li>All the configuration files needed for Hadoop instances are generated by HOD itself,
  318. some obtained from options given by user in its own configuration file.</li>
  319. <li>The HOD client keeps communicating with the RingMaster to find out the location of the
  320. JobTracker and HDFS daemons.</li>
  321. </ul>
  322. <p>The rest of this document describes how to setup HOD on a physical cluster of nodes.</p>
  323. </div>
  324. <a name="N10056"></a><a name="Pre-requisites"></a>
  325. <h2 class="h3">Pre-requisites</h2>
  326. <div class="section">
  327. <p>To use HOD, your system should include the following hardware and software
  328. components.</p>
  329. <p>Operating System: HOD is currently tested on RHEL4.<br>
  330. Nodes : HOD requires a minimum of three nodes configured through a resource manager.<br>
  331. </p>
  332. <p> Software </p>
  333. <p>The following components must be installed on ALL nodes before using HOD:</p>
  334. <ul>
  335. <li>
  336. <a href="http://www.clusterresources.com/pages/products/torque-resource-manager.php">Torque: Resource manager</a>
  337. </li>
  338. <li>
  339. <a href="http://www.python.org">Python</a> : HOD requires version 2.5.1 of Python.</li>
  340. </ul>
  341. <p>The following components are optional and can be installed to obtain better
  342. functionality from HOD:</p>
  343. <ul>
  344. <li>
  345. <a href="http://twistedmatrix.com/trac/">Twisted Python</a>: This can be
  346. used for improving the scalability of HOD. If this module is detected to be
  347. installed, HOD uses it, else it falls back to default modules.</li>
  348. <li>
  349. <a href="http://hadoop.apache.org/core/">Hadoop</a>: HOD can automatically
  350. distribute Hadoop to all nodes in the cluster. However, it can also use a
  351. pre-installed version of Hadoop, if it is available on all nodes in the cluster.
  352. HOD currently supports Hadoop 0.15 and above.</li>
  353. </ul>
  354. <p>NOTE: HOD configuration requires the location of installs of these
  355. components to be the same on all nodes in the cluster. It will also
  356. make the configuration simpler to have the same location on the submit
  357. nodes.
  358. </p>
  359. </div>
  360. <a name="N1008F"></a><a name="Resource+Manager"></a>
  361. <h2 class="h3">Resource Manager</h2>
  362. <div class="section">
  363. <p> Currently HOD works with the Torque resource manager, which it uses for its node
  364. allocation and job submission. Torque is an open source resource manager from
  365. <a href="http://www.clusterresources.com">Cluster Resources</a>, a community effort
  366. based on the PBS project. It provides control over batch jobs and distributed compute nodes. Torque is
  367. freely available for download from <a href="http://www.clusterresources.com/downloads/torque/">here</a>.
  368. </p>
  369. <p> All documentation related to torque can be seen under
  370. the section TORQUE Resource Manager <a href="http://www.clusterresources.com/pages/resources/documentation.php">here</a>. You can
  371. get wiki documentation from <a href="http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki">here</a>.
  372. Users may wish to subscribe to TORQUE&rsquo;s mailing list or view the archive for questions,
  373. comments <a href="http://www.clusterresources.com/pages/resources/mailing-lists.php">here</a>.
  374. </p>
  375. <p>To use HOD with Torque:</p>
  376. <ul>
  377. <li>Install Torque components: pbs_server on one node (head node), pbs_mom on all
  378. compute nodes, and PBS client tools on all compute nodes and submit
  379. nodes. Perform at least a basic configuration so that the Torque system is up and
  380. running, that is, pbs_server knows which machines to talk to. Look <a href="http://www.clusterresources.com/wiki/doku.php?id=torque:1.2_basic_configuration">here</a>
  381. for basic configuration.
  382. For advanced configuration, see <a href="http://www.clusterresources.com/wiki/doku.php?id=torque:1.3_advanced_configuration">here</a>
  383. </li>
  384. <li>Create a queue for submitting jobs on the pbs_server. The name of the queue is the
  385. same as the HOD configuration parameter, resource-manager.queue. The HOD client uses this queue to
  386. submit the RingMaster process as a Torque job.</li>
  387. <li>Specify a cluster name as a property for all nodes in the cluster.
  388. This can be done by using the qmgr command. For example:
  389. <span class="codefrag">qmgr -c "set node node properties=cluster-name"</span>. The name of the cluster is the same as
  390. the HOD configuration parameter, hod.cluster. </li>
  391. <li>Make sure that jobs can be submitted to the nodes. This can be done by
  392. using the qsub command. For example:
  393. <span class="codefrag">echo "sleep 30" | qsub -l nodes=3</span>
  394. </li>
  395. </ul>
  396. </div>
  397. <a name="N100CE"></a><a name="Installing+HOD"></a>
  398. <h2 class="h3">Installing HOD</h2>
  399. <div class="section">
  400. <p>Once the resource manager is set up, you can obtain and
  401. install HOD.</p>
  402. <ul>
  403. <li>If you are getting HOD from the Hadoop tarball, it is available under the
  404. 'contrib' section of Hadoop, under the root directory 'hod'.</li>
  405. <li>If you are building from source, you can run ant tar from the Hadoop root
  406. directory to generate the Hadoop tarball, and then get HOD from there,
  407. as described above.</li>
  408. <li>Distribute the files under this directory to all the nodes in the
  409. cluster. Note that the location where the files are copied should be
  410. the same on all the nodes.</li>
  411. <li>Note that compiling hadoop would build HOD with appropriate permissions
  412. set on all the required script files in HOD.</li>
  413. </ul>
  414. </div>
  415. <a name="N100E7"></a><a name="Configuring+HOD"></a>
  416. <h2 class="h3">Configuring HOD</h2>
  417. <div class="section">
  418. <p>You can configure HOD once it is installed. The minimal configuration needed
  419. to run HOD is described below. More advanced configuration options are discussed
  420. in the HOD Configuration Guide.</p>
  421. <a name="N100F0"></a><a name="Minimal+Configuration"></a>
  422. <h3 class="h4">Minimal Configuration</h3>
  423. <p>To get started using HOD, the following minimal configuration is
  424. required:</p>
  425. <ul>
  426. <li>On the node from where you want to run HOD, edit the file hodrc
  427. located in the &lt;install dir&gt;/conf directory. This file
  428. contains the minimal set of values required to run hod.</li>
  429. <li>
  430. <p>Specify values suitable to your environment for the following
  431. variables defined in the configuration file. Note that some of these
  432. variables are defined at more than one place in the file.</p>
  433. <ul>
  434. <li>${JAVA_HOME}: Location of Java for Hadoop. Hadoop supports Sun JDK
  435. 1.6.x and above.</li>
  436. <li>${CLUSTER_NAME}: Name of the cluster which is specified in the
  437. 'node property' as mentioned in resource manager configuration.</li>
  438. <li>${HADOOP_HOME}: Location of Hadoop installation on the compute and
  439. submit nodes.</li>
  440. <li>${RM_QUEUE}: Queue configured for submitting jobs in the resource
  441. manager configuration.</li>
  442. <li>${RM_HOME}: Location of the resource manager installation on the
  443. compute and submit nodes.</li>
  444. </ul>
  445. </li>
  446. <li>
  447. <p>The following environment variables may need to be set depending on
  448. your environment. These variables must be defined where you run the
  449. HOD client and must also be specified in the HOD configuration file as the
  450. value of the key resource_manager.env-vars. Multiple variables can be
  451. specified as a comma separated list of key=value pairs.</p>
  452. <ul>
  453. <li>HOD_PYTHON_HOME: If you install python to a non-default location
  454. of the compute nodes, or submit nodes, then this variable must be
  455. defined to point to the python executable in the non-standard
  456. location.</li>
  457. </ul>
  458. </li>
  459. </ul>
  460. <a name="N10124"></a><a name="Advanced+Configuration"></a>
  461. <h3 class="h4">Advanced Configuration</h3>
  462. <p> You can review and modify other configuration options to suit
  463. your specific needs. Refer to the <a href="hod_config_guide.html">Configuration
  464. Guide</a> for more information.</p>
  465. </div>
  466. <a name="N10133"></a><a name="Running+HOD"></a>
  467. <h2 class="h3">Running HOD</h2>
  468. <div class="section">
  469. <p>You can run HOD once it is configured. Refer to <a href="hod_user_guide.html">the HOD User Guide</a> for more information.</p>
  470. </div>
  471. <a name="N10141"></a><a name="Supporting+Tools+and+Utilities"></a>
  472. <h2 class="h3">Supporting Tools and Utilities</h2>
  473. <div class="section">
  474. <p>This section describes supporting tools and utilities that can be used to
  475. manage HOD deployments.</p>
  476. <a name="N1014A"></a><a name="logcondense.py+-+Manage+Log+Files"></a>
  477. <h3 class="h4">logcondense.py - Manage Log Files</h3>
  478. <p>As mentioned in the
  479. <a href="hod_user_guide.html#Collecting+and+Viewing+Hadoop+Logs">HOD User Guide</a>,
  480. HOD can be configured to upload
  481. Hadoop logs to a statically configured HDFS. Over time, the number of logs uploaded
  482. to HDFS could increase. logcondense.py is a tool that helps
  483. administrators to remove log files uploaded to HDFS. </p>
  484. <a name="N10157"></a><a name="Running+logcondense.py"></a>
  485. <h4>Running logcondense.py</h4>
  486. <p>logcondense.py is available under hod_install_location/support folder. You can either
  487. run it using python, for example, <em>python logcondense.py</em>, or give execute permissions
  488. to the file, and directly run it as <em>logcondense.py</em>. logcondense.py needs to be
  489. run by a user who has sufficient permissions to remove files from locations where log
  490. files are uploaded in the HDFS, if permissions are enabled. For example as mentioned in the
  491. <a href="hod_config_guide.html#3.7+hodring+options">configuration guide</a>, the logs could
  492. be configured to come under the user's home directory in HDFS. In that case, the user
  493. running logcondense.py should have super user privileges to remove the files from under
  494. all user home directories.</p>
  495. <a name="N1016B"></a><a name="Command+Line+Options+for+logcondense.py"></a>
  496. <h4>Command Line Options for logcondense.py</h4>
  497. <p>The following command line options are supported for logcondense.py.</p>
  498. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  499. <tr>
  500. <td colspan="1" rowspan="1">Short Option</td>
  501. <td colspan="1" rowspan="1">Long option</td>
  502. <td colspan="1" rowspan="1">Meaning</td>
  503. <td colspan="1" rowspan="1">Example</td>
  504. </tr>
  505. <tr>
  506. <td colspan="1" rowspan="1">-p</td>
  507. <td colspan="1" rowspan="1">--package</td>
  508. <td colspan="1" rowspan="1">Complete path to the hadoop script. The version of hadoop must be the same as the
  509. one running HDFS.</td>
  510. <td colspan="1" rowspan="1">/usr/bin/hadoop</td>
  511. </tr>
  512. <tr>
  513. <td colspan="1" rowspan="1">-d</td>
  514. <td colspan="1" rowspan="1">--days</td>
  515. <td colspan="1" rowspan="1">Delete log files older than the specified number of days</td>
  516. <td colspan="1" rowspan="1">7</td>
  517. </tr>
  518. <tr>
  519. <td colspan="1" rowspan="1">-c</td>
  520. <td colspan="1" rowspan="1">--config</td>
  521. <td colspan="1" rowspan="1">Path to the Hadoop configuration directory, under which hadoop-site.xml resides.
  522. The hadoop-site.xml must point to the HDFS NameNode from where logs are to be removed.</td>
  523. <td colspan="1" rowspan="1">/home/foo/hadoop/conf</td>
  524. </tr>
  525. <tr>
  526. <td colspan="1" rowspan="1">-l</td>
  527. <td colspan="1" rowspan="1">--logs</td>
  528. <td colspan="1" rowspan="1">A HDFS path, this must be the same HDFS path as specified for the log-destination-uri,
  529. as mentioned in the <a href="hod_config_guide.html#3.7+hodring+options">configuration guide</a>,
  530. without the hdfs:// URI string</td>
  531. <td colspan="1" rowspan="1">/user</td>
  532. </tr>
  533. <tr>
  534. <td colspan="1" rowspan="1">-n</td>
  535. <td colspan="1" rowspan="1">--dynamicdfs</td>
  536. <td colspan="1" rowspan="1">If true, this will indicate that the logcondense.py script should delete HDFS logs
  537. in addition to Map/Reduce logs. Otherwise, it only deletes Map/Reduce logs, which is also the
  538. default if this option is not specified. This option is useful if
  539. dynamic HDFS installations
  540. are being provisioned by HOD, and the static HDFS installation is being used only to collect
  541. logs - a scenario that may be common in test clusters.</td>
  542. <td colspan="1" rowspan="1">false</td>
  543. </tr>
  544. </table>
  545. <p>So, for example, to delete all log files older than 7 days using a hadoop-site.xml stored in
  546. ~/hadoop-conf, using the hadoop installation under ~/hadoop-0.17.0, you could say:</p>
  547. <p>
  548. <em>python logcondense.py -p ~/hadoop-0.17.0/bin/hadoop -d 7 -c ~/hadoop-conf -l /user</em>
  549. </p>
  550. <a name="N1020E"></a><a name="checklimits.sh+-+Monitor+Resource+Limits"></a>
  551. <h3 class="h4">checklimits.sh - Monitor Resource Limits</h3>
  552. <p>checklimits.sh is a HOD tool specific to the Torque/Maui environment
  553. (<a href="http://www.clusterresources.com/pages/products/maui-cluster-scheduler.php">Maui Cluster Scheduler</a> is an open source job
  554. scheduler for clusters and supercomputers, from clusterresources). The
  555. checklimits.sh script
  556. updates the torque comment field when newly submitted job(s) violate or
  557. exceed
  558. over user limits set up in Maui scheduler. It uses qstat, does one pass
  559. over the torque job-list to determine queued or unfinished jobs, runs Maui
  560. tool checkjob on each job to see if user limits are violated and then
  561. runs torque's qalter utility to update job attribute 'comment'. Currently
  562. it updates the comment as <em>User-limits exceeded. Requested:([0-9]*)
  563. Used:([0-9]*) MaxLimit:([0-9]*)</em> for those jobs that violate limits.
  564. This comment field is then used by HOD to behave accordingly depending on
  565. the type of violation.</p>
  566. <a name="N1021E"></a><a name="Running+checklimits.sh"></a>
  567. <h4>Running checklimits.sh</h4>
  568. <p>checklimits.sh is available under the hod_install_location/support
  569. folder. This shell script can be run directly as <em>sh
  570. checklimits.sh </em>or as <em>./checklimits.sh</em> after enabling
  571. execute permissions. Torque and Maui binaries should be available
  572. on the machine where the tool is run and should be in the path
  573. of the shell script process. To update the
  574. comment field of jobs from different users, this tool must be run with
  575. torque administrative privileges. This tool must be run repeatedly
  576. after specific intervals of time to frequently update jobs violating
  577. constraints, for example via cron. Please note that the resource manager
  578. and scheduler commands used in this script can be expensive and so
  579. it is better not to run this inside a tight loop without sleeping.</p>
  580. <a name="N1022F"></a><a name="verify-account+-+Script+to+verify+an+account+under+which+%0A+++++++++++++jobs+are+submitted"></a>
  581. <h3 class="h4">verify-account - Script to verify an account under which
  582. jobs are submitted</h3>
  583. <p>Production systems use accounting packages to charge users for using
  584. shared compute resources. HOD supports a parameter
  585. <em>resource_manager.pbs-account</em> to allow users to identify the
  586. account under which they would like to submit jobs. It may be necessary
  587. to verify that this account is a valid one configured in an accounting
  588. system. The <em>hod-install-dir/bin/verify-account</em> script
  589. provides a mechanism to plug-in a custom script that can do this
  590. verification.</p>
  591. <a name="N1023E"></a><a name="Integrating+the+verify-account+script+with+HOD"></a>
  592. <h4>Integrating the verify-account script with HOD</h4>
  593. <p>HOD runs the <em>verify-account</em> script passing in the
  594. <em>resource_manager.pbs-account</em> value as argument to the script,
  595. before allocating a cluster. Sites can write a script that verify this
  596. account against their accounting systems. Returning a non-zero exit
  597. code from this script will cause HOD to fail allocation. Also, in
  598. case of an error, HOD will print the output of script to the user.
  599. Any descriptive error message can be passed to the user from the
  600. script in this manner.</p>
  601. <p>The default script that comes with the HOD installation does not
  602. do any validation, and returns a zero exit code.</p>
  603. <p>If the verify-account script is not found, then HOD will treat
  604. that verification is disabled, and continue allocation as is.</p>
  605. </div>
  606. </div>
  607. <!--+
  608. |end content
  609. +-->
  610. <div class="clearboth">&nbsp;</div>
  611. </div>
  612. <div id="footer">
  613. <!--+
  614. |start bottomstrip
  615. +-->
  616. <div class="lastmodified">
  617. <script type="text/javascript"><!--
  618. document.write("Last Published: " + document.lastModified);
  619. // --></script>
  620. </div>
  621. <div class="copyright">
  622. Copyright &copy;
  623. 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  624. </div>
  625. <!--+
  626. |end bottomstrip
  627. +-->
  628. </div>
  629. </body>
  630. </html>