cluster_setup.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  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://lucene.apache.org/">Lucene</a> &gt; <a href="http://lucene.apache.org/hadoop/">Hadoop</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://lucene.apache.org/"><img class="logoImage" alt="Lucene" src="images/lucene_green_150.gif" title="Apache Lucene"></a>
  34. </div>
  35. <!--+
  36. |end group logo
  37. +-->
  38. <!--+
  39. |start Project Logo
  40. +-->
  41. <div class="projectlogo">
  42. <a href="http://lucene.apache.org/hadoop/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" 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="lucene.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://lucene.apache.org/hadoop/">Project</a>
  65. </li>
  66. <li>
  67. <a class="unselected" href="http://wiki.apache.org/lucene-hadoop">Wiki</a>
  68. </li>
  69. <li class="current">
  70. <a class="selected" href="index.html">Hadoop 0.16 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="menupage">
  113. <div class="menupagetitle">Cluster Setup</div>
  114. </div>
  115. <div class="menuitem">
  116. <a href="hdfs_design.html">HDFS Architecture</a>
  117. </div>
  118. <div class="menuitem">
  119. <a href="mapred_tutorial.html">Map-Reduce Tutorial</a>
  120. </div>
  121. <div class="menuitem">
  122. <a href="api/index.html">API Docs</a>
  123. </div>
  124. <div class="menuitem">
  125. <a href="http://wiki.apache.org/lucene-hadoop/">Wiki</a>
  126. </div>
  127. <div class="menuitem">
  128. <a href="http://wiki.apache.org/lucene-hadoop/FAQ">FAQ</a>
  129. </div>
  130. <div class="menuitem">
  131. <a href="http://lucene.apache.org/hadoop/mailing_lists.html">Mailing Lists</a>
  132. </div>
  133. </div>
  134. <div id="credit"></div>
  135. <div id="roundbottom">
  136. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  137. <!--+
  138. |alternative credits
  139. +-->
  140. <div id="credit2"></div>
  141. </div>
  142. <!--+
  143. |end Menu
  144. +-->
  145. <!--+
  146. |start content
  147. +-->
  148. <div id="content">
  149. <div title="Portable Document Format" class="pdflink">
  150. <a class="dida" href="cluster_setup.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  151. PDF</a>
  152. </div>
  153. <h1>Hadoop Cluster Setup</h1>
  154. <div id="minitoc-area">
  155. <ul class="minitoc">
  156. <li>
  157. <a href="#Purpose">Purpose</a>
  158. </li>
  159. <li>
  160. <a href="#Pre-requisites">Pre-requisites</a>
  161. </li>
  162. <li>
  163. <a href="#Installation">Installation</a>
  164. </li>
  165. <li>
  166. <a href="#Configuration">Configuration</a>
  167. <ul class="minitoc">
  168. <li>
  169. <a href="#Configuration+Files">Configuration Files</a>
  170. </li>
  171. <li>
  172. <a href="#Site+Configuration">Site Configuration</a>
  173. <ul class="minitoc">
  174. <li>
  175. <a href="#Configuring+the+Environment+of+the+Hadoop+Daemons">Configuring the Environment of the Hadoop Daemons</a>
  176. </li>
  177. <li>
  178. <a href="#Configuring+the+Hadoop+Daemons">Configuring the Hadoop Daemons</a>
  179. </li>
  180. <li>
  181. <a href="#Slaves">Slaves</a>
  182. </li>
  183. <li>
  184. <a href="#Logging">Logging</a>
  185. </li>
  186. </ul>
  187. </li>
  188. </ul>
  189. </li>
  190. <li>
  191. <a href="#Hadoop+Startup">Hadoop Startup</a>
  192. </li>
  193. <li>
  194. <a href="#Hadoop+Shutdown">Hadoop Shutdown</a>
  195. </li>
  196. </ul>
  197. </div>
  198. <a name="N1000C"></a><a name="Purpose"></a>
  199. <h2 class="h3">Purpose</h2>
  200. <div class="section">
  201. <p>This document describes how to install, configure and manage non-trivial
  202. Hadoop clusters ranging from a few nodes to extremely large clusters with
  203. thousands of nodes.</p>
  204. <p>If you are looking to install Hadoop on a single machine to play
  205. with it, you can find relevant details <a href="quickstart.html">here</a>.
  206. </p>
  207. </div>
  208. <a name="N1001D"></a><a name="Pre-requisites"></a>
  209. <h2 class="h3">Pre-requisites</h2>
  210. <div class="section">
  211. <ol>
  212. <li>
  213. Make sure all <a href="quickstart.html#PreReqs">requisite</a> software
  214. is installed on all nodes in your cluster.
  215. </li>
  216. <li>
  217. <a href="quickstart.html#Download">Get</a> the Hadoop software.
  218. </li>
  219. </ol>
  220. </div>
  221. <a name="N10035"></a><a name="Installation"></a>
  222. <h2 class="h3">Installation</h2>
  223. <div class="section">
  224. <p>Installing a Hadoop cluster typically involves unpacking the software
  225. on all the machines in the cluster.</p>
  226. <p>Typically one machine in the cluster is designated as the
  227. <span class="codefrag">NameNode</span> and another machine the as <span class="codefrag">JobTracker</span>,
  228. exclusively. These are the <em>masters</em>. The rest of the machines in
  229. the cluster act as both <span class="codefrag">DataNode</span> <em>and</em>
  230. <span class="codefrag">TaskTracker</span>. These are the <em>slaves</em>.</p>
  231. <p>The root of the distribution is referred to as
  232. <span class="codefrag">HADOOP_HOME</span>. All machines in the cluster usually have the same
  233. <span class="codefrag">HADOOP_HOME</span> path.</p>
  234. </div>
  235. <a name="N10060"></a><a name="Configuration"></a>
  236. <h2 class="h3">Configuration</h2>
  237. <div class="section">
  238. <p>The following sections describe how to configure a Hadoop cluster.</p>
  239. <a name="N10069"></a><a name="Configuration+Files"></a>
  240. <h3 class="h4">Configuration Files</h3>
  241. <p>Hadoop configuration is driven by two important configuration files
  242. found in the <span class="codefrag">conf/</span> directory of the distribution:</p>
  243. <ol>
  244. <li>
  245. <a href="http://lucene.apache.org/hadoop/hadoop-default.html">hadoop-default.xml</a> - Read-only
  246. default configuration.
  247. </li>
  248. <li>
  249. <em>hadoop-site.xml</em> - Site-specific configuration.
  250. </li>
  251. </ol>
  252. <p>To learn more about how the Hadoop framework is controlled by these
  253. configuration files, look
  254. <a href="api/org/apache/hadoop/conf/Configuration.html">here</a>.</p>
  255. <p>Additionally, you can control the Hadoop scripts found in the
  256. <span class="codefrag">bin/</span> directory of the distribution, by setting site-specific
  257. values via the <span class="codefrag">conf/hadoop-env.sh</span>.</p>
  258. <a name="N10096"></a><a name="Site+Configuration"></a>
  259. <h3 class="h4">Site Configuration</h3>
  260. <p>To configure the the Hadoop cluster you will need to configure the
  261. <em>environment</em> in which the Hadoop daemons execute as well as
  262. the <em>configuration parameters</em> for the Hadoop daemons.</p>
  263. <p>The Hadoop daemons are <span class="codefrag">NameNode</span>/<span class="codefrag">DataNode</span>
  264. and <span class="codefrag">JobTracker</span>/<span class="codefrag">TaskTracker</span>.</p>
  265. <a name="N100B4"></a><a name="Configuring+the+Environment+of+the+Hadoop+Daemons"></a>
  266. <h4>Configuring the Environment of the Hadoop Daemons</h4>
  267. <p>Administrators should use the <span class="codefrag">conf/hadoop-env.sh</span> script
  268. to do site-specific customization of the Hadoop daemons' process
  269. environment.</p>
  270. <p>At the very least you should specify the
  271. <span class="codefrag">JAVA_HOME</span> so that it is correctly defined on each
  272. remote node.</p>
  273. <p>Other useful configuration parameters that you can customize
  274. include:</p>
  275. <ul>
  276. <li>
  277. <span class="codefrag">HADOOP_LOG_DIR</span> - The directory where the daemons'
  278. log files are stored. They are automatically created if they don't
  279. exist.
  280. </li>
  281. <li>
  282. <span class="codefrag">HADOOP_HEAPSIZE</span> - The maximum amount of heapsize
  283. to use, in MB e.g. <span class="codefrag">2000MB</span>.
  284. </li>
  285. </ul>
  286. <a name="N100DC"></a><a name="Configuring+the+Hadoop+Daemons"></a>
  287. <h4>Configuring the Hadoop Daemons</h4>
  288. <p>This section deals with important parameters to be specified in the
  289. <span class="codefrag">conf/hadoop-site.xml</span> for the Hadoop cluster.</p>
  290. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  291. <tr>
  292. <th colspan="1" rowspan="1">Parameter</th>
  293. <th colspan="1" rowspan="1">Value</th>
  294. <th colspan="1" rowspan="1">Notes</th>
  295. </tr>
  296. <tr>
  297. <td colspan="1" rowspan="1">fs.default.name</td>
  298. <td colspan="1" rowspan="1">Hostname or IP address of <span class="codefrag">NameNode</span>.</td>
  299. <td colspan="1" rowspan="1"><em>host:port</em> pair.</td>
  300. </tr>
  301. <tr>
  302. <td colspan="1" rowspan="1">mapred.job.tracker</td>
  303. <td colspan="1" rowspan="1">Hostname or IP address of <span class="codefrag">JobTracker</span>.</td>
  304. <td colspan="1" rowspan="1"><em>host:port</em> pair.</td>
  305. </tr>
  306. <tr>
  307. <td colspan="1" rowspan="1">dfs.name.dir</td>
  308. <td colspan="1" rowspan="1">
  309. Path on the local filesystem where the <span class="codefrag">NameNode</span>
  310. stores the namespace and transactions logs persistently.</td>
  311. <td colspan="1" rowspan="1">
  312. If this is a comma-delimited list of directories then the name
  313. table is replicated in all of the directories, for redundancy.
  314. </td>
  315. </tr>
  316. <tr>
  317. <td colspan="1" rowspan="1">dfs.data.dir</td>
  318. <td colspan="1" rowspan="1">
  319. Comma separated list of paths on the local filesystem of a
  320. <span class="codefrag">DataNode</span> where it should store its blocks.
  321. </td>
  322. <td colspan="1" rowspan="1">
  323. If this is a comma-delimited list of directories, then data will
  324. be stored in all named directories, typically on different
  325. devices.
  326. </td>
  327. </tr>
  328. <tr>
  329. <td colspan="1" rowspan="1">mapred.system.dir</td>
  330. <td colspan="1" rowspan="1">
  331. Path on the HDFS where where the Map-Reduce framework stores
  332. system files e.g. <span class="codefrag">/hadoop/mapred/system/</span>.
  333. </td>
  334. <td colspan="1" rowspan="1">
  335. This is in the default filesystem (HDFS) and must be accessible
  336. from both the server and client machines.
  337. </td>
  338. </tr>
  339. <tr>
  340. <td colspan="1" rowspan="1">mapred.local.dir</td>
  341. <td colspan="1" rowspan="1">
  342. Comma-separated list of paths on the local filesystem where
  343. temporary Map-Reduce data is written.
  344. </td>
  345. <td colspan="1" rowspan="1">Multiple paths help spread disk i/o.</td>
  346. </tr>
  347. <tr>
  348. <td colspan="1" rowspan="1">mapred.tasktracker.tasks.maximum</td>
  349. <td colspan="1" rowspan="1">
  350. The maximum number of map and reduce tasks, which are run
  351. simultaneously on a given <span class="codefrag">TaskTracker</span>, individually.
  352. </td>
  353. <td colspan="1" rowspan="1">
  354. Defaults to 2 (2 maps and 2 reduces), but vary it depending on
  355. your hardware.
  356. </td>
  357. </tr>
  358. <tr>
  359. <td colspan="1" rowspan="1">dfs.hosts/dfs.hosts.exclude</td>
  360. <td colspan="1" rowspan="1">List of permitted/excluded DataNodes.</td>
  361. <td colspan="1" rowspan="1">
  362. If necessary, use these files to control the list of allowable
  363. datanodes.
  364. </td>
  365. </tr>
  366. <tr>
  367. <td colspan="1" rowspan="1">mapred.hosts/mapred.hosts.exclude</td>
  368. <td colspan="1" rowspan="1">List of permitted/excluded TaskTrackers.</td>
  369. <td colspan="1" rowspan="1">
  370. If necessary, use these files to control the list of allowable
  371. tasktrackers.
  372. </td>
  373. </tr>
  374. </table>
  375. <p>Typically all the above parameters are marked as
  376. <a href="api/org/apache/hadoop/conf/Configuration.html#FinalParams">
  377. final</a> to ensure that they cannot be overriden by user-applications.
  378. </p>
  379. <a name="N101BC"></a><a name="Real-World+Cluster+Configurations"></a>
  380. <h5>Real-World Cluster Configurations</h5>
  381. <p>This section lists some non-default configuration parameters which
  382. have been used to run the <em>sort</em> benchmark on very large
  383. clusters.</p>
  384. <ul>
  385. <li>
  386. <p>Some non-default configuration values used to run sort900,
  387. that is 9TB of data sorted on a cluster with 900 nodes:</p>
  388. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  389. <tr>
  390. <th colspan="1" rowspan="1">Parameter</th>
  391. <th colspan="1" rowspan="1">Value</th>
  392. <th colspan="1" rowspan="1">Notes</th>
  393. </tr>
  394. <tr>
  395. <td colspan="1" rowspan="1">dfs.block.size</td>
  396. <td colspan="1" rowspan="1">134217728</td>
  397. <td colspan="1" rowspan="1">HDFS blocksize of 128MB for large file-systems.</td>
  398. </tr>
  399. <tr>
  400. <td colspan="1" rowspan="1">dfs.namenode.handler.count</td>
  401. <td colspan="1" rowspan="1">40</td>
  402. <td colspan="1" rowspan="1">
  403. More NameNode server threads to handle RPCs from large
  404. number of DataNodes.
  405. </td>
  406. </tr>
  407. <tr>
  408. <td colspan="1" rowspan="1">mapred.reduce.parallel.copies</td>
  409. <td colspan="1" rowspan="1">20</td>
  410. <td colspan="1" rowspan="1">
  411. Higher number of parallel copies run by reduces to fetch
  412. outputs from very large number of maps.
  413. </td>
  414. </tr>
  415. <tr>
  416. <td colspan="1" rowspan="1">mapred.child.java.opts</td>
  417. <td colspan="1" rowspan="1">-Xmx512M</td>
  418. <td colspan="1" rowspan="1">
  419. Larger heap-size for child jvms of maps/reduces.
  420. </td>
  421. </tr>
  422. <tr>
  423. <td colspan="1" rowspan="1">fs.inmemory.size.mb</td>
  424. <td colspan="1" rowspan="1">200</td>
  425. <td colspan="1" rowspan="1">
  426. Larger amount of memory allocated for the in-memory
  427. file-system used to merge map-outputs at the reduces.
  428. </td>
  429. </tr>
  430. <tr>
  431. <td colspan="1" rowspan="1">io.sort.factor</td>
  432. <td colspan="1" rowspan="1">100</td>
  433. <td colspan="1" rowspan="1">More streams merged at once while sorting files.</td>
  434. </tr>
  435. <tr>
  436. <td colspan="1" rowspan="1">io.sort.mb</td>
  437. <td colspan="1" rowspan="1">200</td>
  438. <td colspan="1" rowspan="1">Higher memory-limit while sorting data.</td>
  439. </tr>
  440. <tr>
  441. <td colspan="1" rowspan="1">io.file.buffer.size</td>
  442. <td colspan="1" rowspan="1">131072</td>
  443. <td colspan="1" rowspan="1">Size of read/write buffer used in SequenceFiles.</td>
  444. </tr>
  445. </table>
  446. </li>
  447. <li>
  448. <p>Updates to some configuration values to run sort1400 and
  449. sort2000, that is 14TB of data sorted on 1400 nodes and 20TB of
  450. data sorted on 2000 nodes:</p>
  451. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  452. <tr>
  453. <th colspan="1" rowspan="1">Parameter</th>
  454. <th colspan="1" rowspan="1">Value</th>
  455. <th colspan="1" rowspan="1">Notes</th>
  456. </tr>
  457. <tr>
  458. <td colspan="1" rowspan="1">mapred.job.tracker.handler.count</td>
  459. <td colspan="1" rowspan="1">60</td>
  460. <td colspan="1" rowspan="1">
  461. More JobTracker server threads to handle RPCs from large
  462. number of TaskTrackers.
  463. </td>
  464. </tr>
  465. <tr>
  466. <td colspan="1" rowspan="1">mapred.reduce.parallel.copies</td>
  467. <td colspan="1" rowspan="1">50</td>
  468. <td colspan="1" rowspan="1"></td>
  469. </tr>
  470. <tr>
  471. <td colspan="1" rowspan="1">tasktracker.http.threads</td>
  472. <td colspan="1" rowspan="1">50</td>
  473. <td colspan="1" rowspan="1">
  474. More worker threads for the TaskTracker's http server. The
  475. http server is used by reduces to fetch intermediate
  476. map-outputs.
  477. </td>
  478. </tr>
  479. <tr>
  480. <td colspan="1" rowspan="1">mapred.child.java.opts</td>
  481. <td colspan="1" rowspan="1">-Xmx1024M</td>
  482. <td colspan="1" rowspan="1"></td>
  483. </tr>
  484. </table>
  485. </li>
  486. </ul>
  487. <a name="N102D9"></a><a name="Slaves"></a>
  488. <h4>Slaves</h4>
  489. <p>Typically you choose one machine in the cluster to act as the
  490. <span class="codefrag">NameNode</span> and one machine as to act as the
  491. <span class="codefrag">JobTracker</span>, exclusively. The rest of the machines act as
  492. both a <span class="codefrag">DataNode</span> and <span class="codefrag">TaskTracker</span> and are
  493. referred to as <em>slaves</em>.</p>
  494. <p>List all slave hostnames or IP addresses in your
  495. <span class="codefrag">conf/slaves</span> file, one per line.</p>
  496. <a name="N102F8"></a><a name="Logging"></a>
  497. <h4>Logging</h4>
  498. <p>Hadoop uses the <a href="http://logging.apache.org/log4j/">Apache
  499. log4j</a> via the <a href="http://commons.apache.org/logging/">Apache
  500. Commons Logging</a> framework for logging. Edit the
  501. <span class="codefrag">conf/log4j.properties</span> file to customize the Hadoop
  502. daemons' logging configuration (log-formats and so on).</p>
  503. <p>Once all the necessary configuration is complete, distribute the files
  504. to the <span class="codefrag">HADOOP_CONF_DIR</span> directory on all the machines,
  505. typically <span class="codefrag">${HADOOP_HOME}/conf</span>.</p>
  506. </div>
  507. <a name="N10318"></a><a name="Hadoop+Startup"></a>
  508. <h2 class="h3">Hadoop Startup</h2>
  509. <div class="section">
  510. <p>To start a Hadoop cluster you will need to start both the HDFS and
  511. Map-Reduce cluster.</p>
  512. <p>
  513. Format a new distributed filesystem:<br>
  514. <span class="codefrag">$ bin/hadoop namenode -format</span>
  515. </p>
  516. <p>
  517. Start the HDFS with the following command, run on the designated
  518. <span class="codefrag">NameNode</span>:<br>
  519. <span class="codefrag">$ bin/start-dfs.sh</span>
  520. </p>
  521. <p>The <span class="codefrag">bin/start-dfs.sh</span> script also consults the
  522. <span class="codefrag">${HADOOP_CONF_DIR}/slaves</span> file on the <span class="codefrag">NameNode</span>
  523. and starts the <span class="codefrag">DataNode</span> daemon on all the listed slaves.</p>
  524. <p>
  525. Start Map-Reduce with the following command, run on the designated
  526. <span class="codefrag">JobTracker</span>:<br>
  527. <span class="codefrag">$ bin/start-mapred.sh</span>
  528. </p>
  529. <p>The <span class="codefrag">bin/start-mapred.sh</span> script also consults the
  530. <span class="codefrag">${HADOOP_CONF_DIR}/slaves</span> file on the <span class="codefrag">JobTracker</span>
  531. and starts the <span class="codefrag">TaskTracker</span> daemon on all the listed slaves.
  532. </p>
  533. </div>
  534. <a name="N1035E"></a><a name="Hadoop+Shutdown"></a>
  535. <h2 class="h3">Hadoop Shutdown</h2>
  536. <div class="section">
  537. <p>
  538. Stop HDFS with the following command, run on the designated
  539. <span class="codefrag">NameNode</span>:<br>
  540. <span class="codefrag">$ bin/stop-dfs.sh</span>
  541. </p>
  542. <p>The <span class="codefrag">bin/stop-dfs.sh</span> script also consults the
  543. <span class="codefrag">${HADOOP_CONF_DIR}/slaves</span> file on the <span class="codefrag">NameNode</span>
  544. and stops the <span class="codefrag">DataNode</span> daemon on all the listed slaves.</p>
  545. <p>
  546. Stop Map-Reduce with the following command, run on the designated
  547. the designated <span class="codefrag">JobTracker</span>:<br>
  548. <span class="codefrag">$ bin/stop-mapred.sh</span>
  549. <br>
  550. </p>
  551. <p>The <span class="codefrag">bin/stop-mapred.sh</span> script also consults the
  552. <span class="codefrag">${HADOOP_CONF_DIR}/slaves</span> file on the <span class="codefrag">JobTracker</span>
  553. and stops the <span class="codefrag">TaskTracker</span> daemon on all the listed slaves.</p>
  554. </div>
  555. </div>
  556. <!--+
  557. |end content
  558. +-->
  559. <div class="clearboth">&nbsp;</div>
  560. </div>
  561. <div id="footer">
  562. <!--+
  563. |start bottomstrip
  564. +-->
  565. <div class="lastmodified">
  566. <script type="text/javascript"><!--
  567. document.write("Last Published: " + document.lastModified);
  568. // --></script>
  569. </div>
  570. <div class="copyright">
  571. Copyright &copy;
  572. 2007 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  573. </div>
  574. <!--+
  575. |end bottomstrip
  576. +-->
  577. </div>
  578. </body>
  579. </html>