cluster_setup.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936
  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>Hadoop Cluster Setup</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">Hadoop Quick Start</a>
  111. </div>
  112. <div class="menupage">
  113. <div class="menupagetitle">Hadoop Cluster Setup</div>
  114. </div>
  115. <div class="menuitem">
  116. <a href="mapred_tutorial.html">Hadoop Map/Reduce Tutorial</a>
  117. </div>
  118. <div class="menuitem">
  119. <a href="commands_manual.html">Hadoop Command Guide</a>
  120. </div>
  121. <div class="menuitem">
  122. <a href="hdfs_shell.html">Hadoop FS Shell Guide</a>
  123. </div>
  124. <div class="menuitem">
  125. <a href="distcp.html">Hadoop DistCp Guide</a>
  126. </div>
  127. <div class="menuitem">
  128. <a href="native_libraries.html">Hadoop Native Libraries</a>
  129. </div>
  130. <div class="menuitem">
  131. <a href="streaming.html">Hadoop Streaming</a>
  132. </div>
  133. <div class="menuitem">
  134. <a href="hadoop_archives.html">Hadoop Archives</a>
  135. </div>
  136. <div class="menuitem">
  137. <a href="hdfs_user_guide.html">HDFS User Guide</a>
  138. </div>
  139. <div class="menuitem">
  140. <a href="hdfs_design.html">HDFS Architecture</a>
  141. </div>
  142. <div class="menuitem">
  143. <a href="hdfs_permissions_guide.html">HDFS Admin Guide: Permissions</a>
  144. </div>
  145. <div class="menuitem">
  146. <a href="hdfs_quota_admin_guide.html">HDFS Admin Guide: Quotas</a>
  147. </div>
  148. <div class="menuitem">
  149. <a href="SLG_user_guide.html">HDFS Utilities</a>
  150. </div>
  151. <div class="menuitem">
  152. <a href="hod_user_guide.html">HOD User Guide</a>
  153. </div>
  154. <div class="menuitem">
  155. <a href="hod_admin_guide.html">HOD Admin Guide</a>
  156. </div>
  157. <div class="menuitem">
  158. <a href="hod_config_guide.html">HOD Config Guide</a>
  159. </div>
  160. <div class="menuitem">
  161. <a href="capacity_scheduler.html">Capacity Scheduler</a>
  162. </div>
  163. <div class="menuitem">
  164. <a href="api/index.html">API Docs</a>
  165. </div>
  166. <div class="menuitem">
  167. <a href="jdiff/changes.html">API Changes</a>
  168. </div>
  169. <div class="menuitem">
  170. <a href="http://wiki.apache.org/hadoop/">Wiki</a>
  171. </div>
  172. <div class="menuitem">
  173. <a href="http://wiki.apache.org/hadoop/FAQ">FAQ</a>
  174. </div>
  175. <div class="menuitem">
  176. <a href="releasenotes.html">Release Notes</a>
  177. </div>
  178. <div class="menuitem">
  179. <a href="changes.html">Change Log</a>
  180. </div>
  181. </div>
  182. <div id="credit"></div>
  183. <div id="roundbottom">
  184. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  185. <!--+
  186. |alternative credits
  187. +-->
  188. <div id="credit2"></div>
  189. </div>
  190. <!--+
  191. |end Menu
  192. +-->
  193. <!--+
  194. |start content
  195. +-->
  196. <div id="content">
  197. <div title="Portable Document Format" class="pdflink">
  198. <a class="dida" href="cluster_setup.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  199. PDF</a>
  200. </div>
  201. <h1>Hadoop Cluster Setup</h1>
  202. <div id="minitoc-area">
  203. <ul class="minitoc">
  204. <li>
  205. <a href="#Purpose">Purpose</a>
  206. </li>
  207. <li>
  208. <a href="#Pre-requisites">Pre-requisites</a>
  209. </li>
  210. <li>
  211. <a href="#Installation">Installation</a>
  212. </li>
  213. <li>
  214. <a href="#Configuration">Configuration</a>
  215. <ul class="minitoc">
  216. <li>
  217. <a href="#Configuration+Files">Configuration Files</a>
  218. </li>
  219. <li>
  220. <a href="#Site+Configuration">Site Configuration</a>
  221. <ul class="minitoc">
  222. <li>
  223. <a href="#Configuring+the+Environment+of+the+Hadoop+Daemons">Configuring the Environment of the Hadoop Daemons</a>
  224. </li>
  225. <li>
  226. <a href="#Configuring+the+Hadoop+Daemons">Configuring the Hadoop Daemons</a>
  227. </li>
  228. <li>
  229. <a href="#Slaves">Slaves</a>
  230. </li>
  231. <li>
  232. <a href="#Logging">Logging</a>
  233. </li>
  234. </ul>
  235. </li>
  236. </ul>
  237. </li>
  238. <li>
  239. <a href="#Cluster+Restartability">Cluster Restartability</a>
  240. <ul class="minitoc">
  241. <li>
  242. <a href="#Map%2FReduce">Map/Reduce</a>
  243. </li>
  244. </ul>
  245. </li>
  246. <li>
  247. <a href="#Hadoop+Rack+Awareness">Hadoop Rack Awareness</a>
  248. </li>
  249. <li>
  250. <a href="#Hadoop+Startup">Hadoop Startup</a>
  251. </li>
  252. <li>
  253. <a href="#Hadoop+Shutdown">Hadoop Shutdown</a>
  254. </li>
  255. </ul>
  256. </div>
  257. <a name="N1000D"></a><a name="Purpose"></a>
  258. <h2 class="h3">Purpose</h2>
  259. <div class="section">
  260. <p>This document describes how to install, configure and manage non-trivial
  261. Hadoop clusters ranging from a few nodes to extremely large clusters with
  262. thousands of nodes.</p>
  263. <p>
  264. To play with Hadoop, you may first want to install Hadoop on a single machine (see <a href="quickstart.html"> Hadoop Quick Start</a>).
  265. </p>
  266. </div>
  267. <a name="N1001E"></a><a name="Pre-requisites"></a>
  268. <h2 class="h3">Pre-requisites</h2>
  269. <div class="section">
  270. <ol>
  271. <li>
  272. Make sure all <a href="quickstart.html#PreReqs">requisite</a> software
  273. is installed on all nodes in your cluster.
  274. </li>
  275. <li>
  276. <a href="quickstart.html#Download">Get</a> the Hadoop software.
  277. </li>
  278. </ol>
  279. </div>
  280. <a name="N10036"></a><a name="Installation"></a>
  281. <h2 class="h3">Installation</h2>
  282. <div class="section">
  283. <p>Installing a Hadoop cluster typically involves unpacking the software
  284. on all the machines in the cluster.</p>
  285. <p>Typically one machine in the cluster is designated as the
  286. <span class="codefrag">NameNode</span> and another machine the as <span class="codefrag">JobTracker</span>,
  287. exclusively. These are the <em>masters</em>. The rest of the machines in
  288. the cluster act as both <span class="codefrag">DataNode</span> <em>and</em>
  289. <span class="codefrag">TaskTracker</span>. These are the <em>slaves</em>.</p>
  290. <p>The root of the distribution is referred to as
  291. <span class="codefrag">HADOOP_HOME</span>. All machines in the cluster usually have the same
  292. <span class="codefrag">HADOOP_HOME</span> path.</p>
  293. </div>
  294. <a name="N10061"></a><a name="Configuration"></a>
  295. <h2 class="h3">Configuration</h2>
  296. <div class="section">
  297. <p>The following sections describe how to configure a Hadoop cluster.</p>
  298. <a name="N1006A"></a><a name="Configuration+Files"></a>
  299. <h3 class="h4">Configuration Files</h3>
  300. <p>Hadoop configuration is driven by two important configuration files
  301. found in the <span class="codefrag">conf/</span> directory of the distribution:</p>
  302. <ol>
  303. <li>
  304. <a href="http://hadoop.apache.org/core/docs/current/hadoop-default.html">hadoop-default.xml</a> - Read-only
  305. default configuration.
  306. </li>
  307. <li>
  308. <em>hadoop-site.xml</em> - Site-specific configuration.
  309. </li>
  310. </ol>
  311. <p>To learn more about how the Hadoop framework is controlled by these
  312. configuration files, look
  313. <a href="api/org/apache/hadoop/conf/Configuration.html">here</a>.</p>
  314. <p>Additionally, you can control the Hadoop scripts found in the
  315. <span class="codefrag">bin/</span> directory of the distribution, by setting site-specific
  316. values via the <span class="codefrag">conf/hadoop-env.sh</span>.</p>
  317. <a name="N10097"></a><a name="Site+Configuration"></a>
  318. <h3 class="h4">Site Configuration</h3>
  319. <p>To configure the the Hadoop cluster you will need to configure the
  320. <em>environment</em> in which the Hadoop daemons execute as well as
  321. the <em>configuration parameters</em> for the Hadoop daemons.</p>
  322. <p>The Hadoop daemons are <span class="codefrag">NameNode</span>/<span class="codefrag">DataNode</span>
  323. and <span class="codefrag">JobTracker</span>/<span class="codefrag">TaskTracker</span>.</p>
  324. <a name="N100B5"></a><a name="Configuring+the+Environment+of+the+Hadoop+Daemons"></a>
  325. <h4>Configuring the Environment of the Hadoop Daemons</h4>
  326. <p>Administrators should use the <span class="codefrag">conf/hadoop-env.sh</span> script
  327. to do site-specific customization of the Hadoop daemons' process
  328. environment.</p>
  329. <p>At the very least you should specify the
  330. <span class="codefrag">JAVA_HOME</span> so that it is correctly defined on each
  331. remote node.</p>
  332. <p>Administrators can configure individual daemons using the
  333. configuration options <span class="codefrag">HADOOP_*_OPTS</span>. Various options
  334. available are shown below in the table. </p>
  335. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  336. <tr>
  337. <th colspan="1" rowspan="1">Daemon</th><th colspan="1" rowspan="1">Configure Options</th>
  338. </tr>
  339. <tr>
  340. <td colspan="1" rowspan="1">NameNode</td><td colspan="1" rowspan="1">HADOOP_NAMENODE_OPTS</td>
  341. </tr>
  342. <tr>
  343. <td colspan="1" rowspan="1">DataNode</td><td colspan="1" rowspan="1">HADOOP_DATANODE_OPTS</td>
  344. </tr>
  345. <tr>
  346. <td colspan="1" rowspan="1">SecondaryNamenode</td>
  347. <td colspan="1" rowspan="1">HADOOP_SECONDARYNAMENODE_OPTS</td>
  348. </tr>
  349. <tr>
  350. <td colspan="1" rowspan="1">JobTracker</td><td colspan="1" rowspan="1">HADOOP_JOBTRACKER_OPTS</td>
  351. </tr>
  352. <tr>
  353. <td colspan="1" rowspan="1">TaskTracker</td><td colspan="1" rowspan="1">HADOOP_TASKTRACKER_OPTS</td>
  354. </tr>
  355. </table>
  356. <p> For example, To configure Namenode to use parallelGC, the
  357. following statement should be added in <span class="codefrag">hadoop-env.sh</span> :
  358. <br>
  359. <span class="codefrag">
  360. export HADOOP_NAMENODE_OPTS="-XX:+UseParallelGC ${HADOOP_NAMENODE_OPTS}"
  361. </span>
  362. <br>
  363. </p>
  364. <p>Other useful configuration parameters that you can customize
  365. include:</p>
  366. <ul>
  367. <li>
  368. <span class="codefrag">HADOOP_LOG_DIR</span> - The directory where the daemons'
  369. log files are stored. They are automatically created if they don't
  370. exist.
  371. </li>
  372. <li>
  373. <span class="codefrag">HADOOP_HEAPSIZE</span> - The maximum amount of heapsize
  374. to use, in MB e.g. <span class="codefrag">1000MB</span>. This is used to
  375. configure the heap size for the hadoop daemon. By default,
  376. the value is <span class="codefrag">1000MB</span>.
  377. </li>
  378. </ul>
  379. <a name="N10130"></a><a name="Configuring+the+Hadoop+Daemons"></a>
  380. <h4>Configuring the Hadoop Daemons</h4>
  381. <p>This section deals with important parameters to be specified in the
  382. <span class="codefrag">conf/hadoop-site.xml</span> for the Hadoop cluster.</p>
  383. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  384. <tr>
  385. <th colspan="1" rowspan="1">Parameter</th>
  386. <th colspan="1" rowspan="1">Value</th>
  387. <th colspan="1" rowspan="1">Notes</th>
  388. </tr>
  389. <tr>
  390. <td colspan="1" rowspan="1">fs.default.name</td>
  391. <td colspan="1" rowspan="1">URI of <span class="codefrag">NameNode</span>.</td>
  392. <td colspan="1" rowspan="1"><em>hdfs://hostname/</em></td>
  393. </tr>
  394. <tr>
  395. <td colspan="1" rowspan="1">mapred.job.tracker</td>
  396. <td colspan="1" rowspan="1">Host or IP and port of <span class="codefrag">JobTracker</span>.</td>
  397. <td colspan="1" rowspan="1"><em>host:port</em> pair.</td>
  398. </tr>
  399. <tr>
  400. <td colspan="1" rowspan="1">dfs.name.dir</td>
  401. <td colspan="1" rowspan="1">
  402. Path on the local filesystem where the <span class="codefrag">NameNode</span>
  403. stores the namespace and transactions logs persistently.</td>
  404. <td colspan="1" rowspan="1">
  405. If this is a comma-delimited list of directories then the name
  406. table is replicated in all of the directories, for redundancy.
  407. </td>
  408. </tr>
  409. <tr>
  410. <td colspan="1" rowspan="1">dfs.data.dir</td>
  411. <td colspan="1" rowspan="1">
  412. Comma separated list of paths on the local filesystem of a
  413. <span class="codefrag">DataNode</span> where it should store its blocks.
  414. </td>
  415. <td colspan="1" rowspan="1">
  416. If this is a comma-delimited list of directories, then data will
  417. be stored in all named directories, typically on different
  418. devices.
  419. </td>
  420. </tr>
  421. <tr>
  422. <td colspan="1" rowspan="1">mapred.system.dir</td>
  423. <td colspan="1" rowspan="1">
  424. Path on the HDFS where where the Map/Reduce framework stores
  425. system files e.g. <span class="codefrag">/hadoop/mapred/system/</span>.
  426. </td>
  427. <td colspan="1" rowspan="1">
  428. This is in the default filesystem (HDFS) and must be accessible
  429. from both the server and client machines.
  430. </td>
  431. </tr>
  432. <tr>
  433. <td colspan="1" rowspan="1">mapred.local.dir</td>
  434. <td colspan="1" rowspan="1">
  435. Comma-separated list of paths on the local filesystem where
  436. temporary Map/Reduce data is written.
  437. </td>
  438. <td colspan="1" rowspan="1">Multiple paths help spread disk i/o.</td>
  439. </tr>
  440. <tr>
  441. <td colspan="1" rowspan="1">mapred.tasktracker.{map|reduce}.tasks.maximum</td>
  442. <td colspan="1" rowspan="1">
  443. The maximum number of Map/Reduce tasks, which are run
  444. simultaneously on a given <span class="codefrag">TaskTracker</span>, individually.
  445. </td>
  446. <td colspan="1" rowspan="1">
  447. Defaults to 2 (2 maps and 2 reduces), but vary it depending on
  448. your hardware.
  449. </td>
  450. </tr>
  451. <tr>
  452. <td colspan="1" rowspan="1">dfs.hosts/dfs.hosts.exclude</td>
  453. <td colspan="1" rowspan="1">List of permitted/excluded DataNodes.</td>
  454. <td colspan="1" rowspan="1">
  455. If necessary, use these files to control the list of allowable
  456. datanodes.
  457. </td>
  458. </tr>
  459. <tr>
  460. <td colspan="1" rowspan="1">mapred.hosts/mapred.hosts.exclude</td>
  461. <td colspan="1" rowspan="1">List of permitted/excluded TaskTrackers.</td>
  462. <td colspan="1" rowspan="1">
  463. If necessary, use these files to control the list of allowable
  464. TaskTrackers.
  465. </td>
  466. </tr>
  467. <tr>
  468. <td colspan="1" rowspan="1">mapred.queue.names</td>
  469. <td colspan="1" rowspan="1">Comma separated list of queues to which jobs can be submitted.</td>
  470. <td colspan="1" rowspan="1">
  471. The Map/Reduce system always supports atleast one queue
  472. with the name as <em>default</em>. Hence, this parameter's
  473. value should always contain the string <em>default</em>.
  474. Some job schedulers supported in Hadoop, like the
  475. <a href="capacity_scheduler.html">Capacity
  476. Scheduler</a>, support multiple queues. If such a scheduler is
  477. being used, the list of configured queue names must be
  478. specified here. Once queues are defined, users can submit
  479. jobs to a queue using the property name
  480. <em>mapred.job.queue.name</em> in the job configuration.
  481. There could be a separate
  482. configuration file for configuring properties of these
  483. queues that is managed by the scheduler.
  484. Refer to the documentation of the scheduler for information on
  485. the same.
  486. </td>
  487. </tr>
  488. <tr>
  489. <td colspan="1" rowspan="1">mapred.acls.enabled</td>
  490. <td colspan="1" rowspan="1">Specifies whether ACLs are supported for controlling job
  491. submission and administration</td>
  492. <td colspan="1" rowspan="1">
  493. If <em>true</em>, ACLs would be checked while submitting
  494. and administering jobs. ACLs can be specified using the
  495. configuration parameters of the form
  496. <em>mapred.queue.queue-name.acl-name</em>, defined below.
  497. </td>
  498. </tr>
  499. <tr>
  500. <td colspan="1" rowspan="1">mapred.queue.<em>queue-name</em>.acl-submit-job</td>
  501. <td colspan="1" rowspan="1">List of users and groups that can submit jobs to the
  502. specified <em>queue-name</em>.</td>
  503. <td colspan="1" rowspan="1">
  504. The list of users and groups are both comma separated
  505. list of names. The two lists are separated by a blank.
  506. Example: <em>user1,user2 group1,group2</em>.
  507. If you wish to define only a list of groups, provide
  508. a blank at the beginning of the value.
  509. </td>
  510. </tr>
  511. <tr>
  512. <td colspan="1" rowspan="1">mapred.queue.<em>queue-name</em>.acl-administer-job</td>
  513. <td colspan="1" rowspan="1">List of users and groups that can change the priority
  514. or kill jobs that have been submitted to the
  515. specified <em>queue-name</em>.</td>
  516. <td colspan="1" rowspan="1">
  517. The list of users and groups are both comma separated
  518. list of names. The two lists are separated by a blank.
  519. Example: <em>user1,user2 group1,group2</em>.
  520. If you wish to define only a list of groups, provide
  521. a blank at the beginning of the value. Note that an
  522. owner of a job can always change the priority or kill
  523. his/her own job, irrespective of the ACLs.
  524. </td>
  525. </tr>
  526. </table>
  527. <p>Typically all the above parameters are marked as
  528. <a href="api/org/apache/hadoop/conf/Configuration.html#FinalParams">
  529. final</a> to ensure that they cannot be overriden by user-applications.
  530. </p>
  531. <a name="N1027C"></a><a name="Real-World+Cluster+Configurations"></a>
  532. <h5>Real-World Cluster Configurations</h5>
  533. <p>This section lists some non-default configuration parameters which
  534. have been used to run the <em>sort</em> benchmark on very large
  535. clusters.</p>
  536. <ul>
  537. <li>
  538. <p>Some non-default configuration values used to run sort900,
  539. that is 9TB of data sorted on a cluster with 900 nodes:</p>
  540. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  541. <tr>
  542. <th colspan="1" rowspan="1">Parameter</th>
  543. <th colspan="1" rowspan="1">Value</th>
  544. <th colspan="1" rowspan="1">Notes</th>
  545. </tr>
  546. <tr>
  547. <td colspan="1" rowspan="1">dfs.block.size</td>
  548. <td colspan="1" rowspan="1">134217728</td>
  549. <td colspan="1" rowspan="1">HDFS blocksize of 128MB for large file-systems.</td>
  550. </tr>
  551. <tr>
  552. <td colspan="1" rowspan="1">dfs.namenode.handler.count</td>
  553. <td colspan="1" rowspan="1">40</td>
  554. <td colspan="1" rowspan="1">
  555. More NameNode server threads to handle RPCs from large
  556. number of DataNodes.
  557. </td>
  558. </tr>
  559. <tr>
  560. <td colspan="1" rowspan="1">mapred.reduce.parallel.copies</td>
  561. <td colspan="1" rowspan="1">20</td>
  562. <td colspan="1" rowspan="1">
  563. Higher number of parallel copies run by reduces to fetch
  564. outputs from very large number of maps.
  565. </td>
  566. </tr>
  567. <tr>
  568. <td colspan="1" rowspan="1">mapred.child.java.opts</td>
  569. <td colspan="1" rowspan="1">-Xmx512M</td>
  570. <td colspan="1" rowspan="1">
  571. Larger heap-size for child jvms of maps/reduces.
  572. </td>
  573. </tr>
  574. <tr>
  575. <td colspan="1" rowspan="1">fs.inmemory.size.mb</td>
  576. <td colspan="1" rowspan="1">200</td>
  577. <td colspan="1" rowspan="1">
  578. Larger amount of memory allocated for the in-memory
  579. file-system used to merge map-outputs at the reduces.
  580. </td>
  581. </tr>
  582. <tr>
  583. <td colspan="1" rowspan="1">io.sort.factor</td>
  584. <td colspan="1" rowspan="1">100</td>
  585. <td colspan="1" rowspan="1">More streams merged at once while sorting files.</td>
  586. </tr>
  587. <tr>
  588. <td colspan="1" rowspan="1">io.sort.mb</td>
  589. <td colspan="1" rowspan="1">200</td>
  590. <td colspan="1" rowspan="1">Higher memory-limit while sorting data.</td>
  591. </tr>
  592. <tr>
  593. <td colspan="1" rowspan="1">io.file.buffer.size</td>
  594. <td colspan="1" rowspan="1">131072</td>
  595. <td colspan="1" rowspan="1">Size of read/write buffer used in SequenceFiles.</td>
  596. </tr>
  597. </table>
  598. </li>
  599. <li>
  600. <p>Updates to some configuration values to run sort1400 and
  601. sort2000, that is 14TB of data sorted on 1400 nodes and 20TB of
  602. data sorted on 2000 nodes:</p>
  603. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  604. <tr>
  605. <th colspan="1" rowspan="1">Parameter</th>
  606. <th colspan="1" rowspan="1">Value</th>
  607. <th colspan="1" rowspan="1">Notes</th>
  608. </tr>
  609. <tr>
  610. <td colspan="1" rowspan="1">mapred.job.tracker.handler.count</td>
  611. <td colspan="1" rowspan="1">60</td>
  612. <td colspan="1" rowspan="1">
  613. More JobTracker server threads to handle RPCs from large
  614. number of TaskTrackers.
  615. </td>
  616. </tr>
  617. <tr>
  618. <td colspan="1" rowspan="1">mapred.reduce.parallel.copies</td>
  619. <td colspan="1" rowspan="1">50</td>
  620. <td colspan="1" rowspan="1"></td>
  621. </tr>
  622. <tr>
  623. <td colspan="1" rowspan="1">tasktracker.http.threads</td>
  624. <td colspan="1" rowspan="1">50</td>
  625. <td colspan="1" rowspan="1">
  626. More worker threads for the TaskTracker's http server. The
  627. http server is used by reduces to fetch intermediate
  628. map-outputs.
  629. </td>
  630. </tr>
  631. <tr>
  632. <td colspan="1" rowspan="1">mapred.child.java.opts</td>
  633. <td colspan="1" rowspan="1">-Xmx1024M</td>
  634. <td colspan="1" rowspan="1">Larger heap-size for child jvms of maps/reduces.</td>
  635. </tr>
  636. </table>
  637. </li>
  638. </ul>
  639. <a name="N1039A"></a><a name="Slaves"></a>
  640. <h4>Slaves</h4>
  641. <p>Typically you choose one machine in the cluster to act as the
  642. <span class="codefrag">NameNode</span> and one machine as to act as the
  643. <span class="codefrag">JobTracker</span>, exclusively. The rest of the machines act as
  644. both a <span class="codefrag">DataNode</span> and <span class="codefrag">TaskTracker</span> and are
  645. referred to as <em>slaves</em>.</p>
  646. <p>List all slave hostnames or IP addresses in your
  647. <span class="codefrag">conf/slaves</span> file, one per line.</p>
  648. <a name="N103B9"></a><a name="Logging"></a>
  649. <h4>Logging</h4>
  650. <p>Hadoop uses the <a href="http://logging.apache.org/log4j/">Apache
  651. log4j</a> via the <a href="http://commons.apache.org/logging/">Apache
  652. Commons Logging</a> framework for logging. Edit the
  653. <span class="codefrag">conf/log4j.properties</span> file to customize the Hadoop
  654. daemons' logging configuration (log-formats and so on).</p>
  655. <a name="N103CD"></a><a name="History+Logging"></a>
  656. <h5>History Logging</h5>
  657. <p> The job history files are stored in central location
  658. <span class="codefrag"> hadoop.job.history.location </span> which can be on DFS also,
  659. whose default value is <span class="codefrag">${HADOOP_LOG_DIR}/history</span>.
  660. The history web UI is accessible from job tracker web UI.</p>
  661. <p> The history files are also logged to user specified directory
  662. <span class="codefrag">hadoop.job.history.user.location</span>
  663. which defaults to job output directory. The files are stored in
  664. "_logs/history/" in the specified directory. Hence, by default
  665. they will be in "mapred.output.dir/_logs/history/". User can stop
  666. logging by giving the value <span class="codefrag">none</span> for
  667. <span class="codefrag">hadoop.job.history.user.location</span>
  668. </p>
  669. <p> User can view the history logs summary in specified directory
  670. using the following command <br>
  671. <span class="codefrag">$ bin/hadoop job -history output-dir</span>
  672. <br>
  673. This command will print job details, failed and killed tip
  674. details. <br>
  675. More details about the job such as successful tasks and
  676. task attempts made for each task can be viewed using the
  677. following command <br>
  678. <span class="codefrag">$ bin/hadoop job -history all output-dir</span>
  679. <br>
  680. </p>
  681. <p>Once all the necessary configuration is complete, distribute the files
  682. to the <span class="codefrag">HADOOP_CONF_DIR</span> directory on all the machines,
  683. typically <span class="codefrag">${HADOOP_HOME}/conf</span>.</p>
  684. </div>
  685. <a name="N10405"></a><a name="Cluster+Restartability"></a>
  686. <h2 class="h3">Cluster Restartability</h2>
  687. <div class="section">
  688. <a name="N1040B"></a><a name="Map%2FReduce"></a>
  689. <h3 class="h4">Map/Reduce</h3>
  690. <p>The job tracker restart can recover running jobs if
  691. <span class="codefrag">mapred.jobtracker.restart.recover</span> is set true and
  692. <a href="#Logging">JobHistory logging</a> is enabled. Also
  693. <span class="codefrag">mapred.jobtracker.job.history.block.size</span> value should be
  694. set to an optimal value to dump job history to disk as soon as
  695. possible, the typical value is 3145728(3MB).</p>
  696. </div>
  697. <a name="N10420"></a><a name="Hadoop+Rack+Awareness"></a>
  698. <h2 class="h3">Hadoop Rack Awareness</h2>
  699. <div class="section">
  700. <p>The HDFS and the Map/Reduce components are rack-aware.</p>
  701. <p>The <span class="codefrag">NameNode</span> and the <span class="codefrag">JobTracker</span> obtains the
  702. <span class="codefrag">rack id</span> of the slaves in the cluster by invoking an API
  703. <a href="api/org/apache/hadoop/net/DNSToSwitchMapping.html#resolve(java.util.List)">resolve</a> in an administrator configured
  704. module. The API resolves the slave's DNS name (also IP address) to a
  705. rack id. What module to use can be configured using the configuration
  706. item <span class="codefrag">topology.node.switch.mapping.impl</span>. The default
  707. implementation of the same runs a script/command configured using
  708. <span class="codefrag">topology.script.file.name</span>. If topology.script.file.name is
  709. not set, the rack id <span class="codefrag">/default-rack</span> is returned for any
  710. passed IP address. The additional configuration in the Map/Reduce
  711. part is <span class="codefrag">mapred.cache.task.levels</span> which determines the number
  712. of levels (in the network topology) of caches. So, for example, if it is
  713. the default value of 2, two levels of caches will be constructed -
  714. one for hosts (host -&gt; task mapping) and another for racks
  715. (rack -&gt; task mapping).
  716. </p>
  717. </div>
  718. <a name="N10446"></a><a name="Hadoop+Startup"></a>
  719. <h2 class="h3">Hadoop Startup</h2>
  720. <div class="section">
  721. <p>To start a Hadoop cluster you will need to start both the HDFS and
  722. Map/Reduce cluster.</p>
  723. <p>
  724. Format a new distributed filesystem:<br>
  725. <span class="codefrag">$ bin/hadoop namenode -format</span>
  726. </p>
  727. <p>
  728. Start the HDFS with the following command, run on the designated
  729. <span class="codefrag">NameNode</span>:<br>
  730. <span class="codefrag">$ bin/start-dfs.sh</span>
  731. </p>
  732. <p>The <span class="codefrag">bin/start-dfs.sh</span> script also consults the
  733. <span class="codefrag">${HADOOP_CONF_DIR}/slaves</span> file on the <span class="codefrag">NameNode</span>
  734. and starts the <span class="codefrag">DataNode</span> daemon on all the listed slaves.</p>
  735. <p>
  736. Start Map-Reduce with the following command, run on the designated
  737. <span class="codefrag">JobTracker</span>:<br>
  738. <span class="codefrag">$ bin/start-mapred.sh</span>
  739. </p>
  740. <p>The <span class="codefrag">bin/start-mapred.sh</span> script also consults the
  741. <span class="codefrag">${HADOOP_CONF_DIR}/slaves</span> file on the <span class="codefrag">JobTracker</span>
  742. and starts the <span class="codefrag">TaskTracker</span> daemon on all the listed slaves.
  743. </p>
  744. </div>
  745. <a name="N1048C"></a><a name="Hadoop+Shutdown"></a>
  746. <h2 class="h3">Hadoop Shutdown</h2>
  747. <div class="section">
  748. <p>
  749. Stop HDFS with the following command, run on the designated
  750. <span class="codefrag">NameNode</span>:<br>
  751. <span class="codefrag">$ bin/stop-dfs.sh</span>
  752. </p>
  753. <p>The <span class="codefrag">bin/stop-dfs.sh</span> script also consults the
  754. <span class="codefrag">${HADOOP_CONF_DIR}/slaves</span> file on the <span class="codefrag">NameNode</span>
  755. and stops the <span class="codefrag">DataNode</span> daemon on all the listed slaves.</p>
  756. <p>
  757. Stop Map/Reduce with the following command, run on the designated
  758. the designated <span class="codefrag">JobTracker</span>:<br>
  759. <span class="codefrag">$ bin/stop-mapred.sh</span>
  760. <br>
  761. </p>
  762. <p>The <span class="codefrag">bin/stop-mapred.sh</span> script also consults the
  763. <span class="codefrag">${HADOOP_CONF_DIR}/slaves</span> file on the <span class="codefrag">JobTracker</span>
  764. and stops the <span class="codefrag">TaskTracker</span> daemon on all the listed slaves.</p>
  765. </div>
  766. </div>
  767. <!--+
  768. |end content
  769. +-->
  770. <div class="clearboth">&nbsp;</div>
  771. </div>
  772. <div id="footer">
  773. <!--+
  774. |start bottomstrip
  775. +-->
  776. <div class="lastmodified">
  777. <script type="text/javascript"><!--
  778. document.write("Last Published: " + document.lastModified);
  779. // --></script>
  780. </div>
  781. <div class="copyright">
  782. Copyright &copy;
  783. 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  784. </div>
  785. <!--+
  786. |end bottomstrip
  787. +-->
  788. </div>
  789. </body>
  790. </html>