Page MenuHomec4science

ClusterSetup.html
No OneTemporary

File Metadata

Created
Wed, Feb 26, 00:50

ClusterSetup.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at 2014-02-11 -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache Hadoop 2.3.0 - Hadoop Map Reduce Next Generation-2.3.0 - Cluster Setup</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20140211" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="composite">
<div id="banner">
<a href="http://hadoop.apache.org/" id="bannerLeft">
<img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/" class="externalLink">Apache</a>
&gt;
<a href="http://hadoop.apache.org/" class="externalLink">Hadoop</a>
&gt;
<a href="../">Apache Hadoop Project Dist POM</a>
&gt;
Apache Hadoop 2.3.0
</div>
<div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
|
<a href="https://svn.apache.org/repos/asf/hadoop/" class="externalLink">SVN</a>
|
<a href="http://hadoop.apache.org/" class="externalLink">Apache Hadoop</a>
&nbsp;| Last Published: 2014-02-11
&nbsp;| Version: 2.3.0
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>General</h5>
<ul>
<li class="none">
<a href="../../index.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CommandsManual.html">Hadoop Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/FileSystemShell.html">File System Shell</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Compatibility.html">Hadoop Compatibility</a>
</li>
</ul>
<h5>Common</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Superusers.html">Superusers</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
</li>
</ul>
<h5>HDFS</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">HDFS User Guide</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/HDFSHighAvailabilityWithQJM.html">High Availability With QJM</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/HDFSHighAvailabilityWithNFS.html">High Availability With NFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">HDFS Snapshots</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">HDFS Architecture</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/Hftp.html">HFTP</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">C API libhdfs</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS REST API</a>
</li>
<li class="none">
<a href="../../hadoop-hdfs-httpfs/index.html">HttpFS Gateway</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">HDFS NFS Gateway</a>
</li>
</ul>
<h5>MapReduce</h5>
<ul>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibilty between Hadoop 1.x and Hadoop 2.x</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
</li>
</ul>
<h5>YARN</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YARN.html">YARN Architecture</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">YARN Commands</a>
</li>
<li class="none">
<a href="../../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
</li>
</ul>
<h5>YARN REST APIs</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/MapredAppMasterRest.html">MR Application Master</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/HistoryServerRest.html">History Server</a>
</li>
</ul>
<h5>Auth</h5>
<ul>
<li class="none">
<a href="../../hadoop-auth/index.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-auth/Examples.html">Examples</a>
</li>
<li class="none">
<a href="../../hadoop-auth/Configuration.html">Configuration</a>
</li>
<li class="none">
<a href="../../hadoop-auth/BuildingIt.html">Building</a>
</li>
</ul>
<h5>Reference</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/releasenotes.html">Release Notes</a>
</li>
<li class="none">
<a href="../../api/index.html">API docs</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CHANGES.txt">Common CHANGES.txt</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/CHANGES.txt">HDFS CHANGES.txt</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-mapreduce/CHANGES.txt">MapReduce CHANGES.txt</a>
</li>
</ul>
<h5>Configuration</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed under the Apache License, Version 2.0 (the "License"); --><!-- you may not use this file except in compliance with the License. --><!-- You may obtain a copy of the License at --><!-- --><!-- http://www.apache.org/licenses/LICENSE-2.0 --><!-- --><!-- Unless required by applicable law or agreed to in writing, software --><!-- distributed under the License is distributed on an "AS IS" BASIS, --><!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --><!-- See the License for the specific language governing permissions and --><!-- limitations under the License. See accompanying LICENSE file. --><ul>
<li><a href="#Hadoop_MapReduce_Next_Generation_-_Cluster_Setup">Hadoop MapReduce Next Generation - Cluster Setup</a>
<ul>
<li><a href="#Purpose">Purpose</a></li>
<li><a href="#Prerequisites">Prerequisites</a></li>
<li><a href="#Installation">Installation</a></li>
<li><a href="#Running_Hadoop_in_Non-Secure_Mode">Running Hadoop in Non-Secure Mode</a>
<ul>
<li><a href="#Configuring_Environment_of_Hadoop_Daemons">Configuring Environment of Hadoop Daemons</a></li>
<li><a href="#Configuring_the_Hadoop_Daemons_in_Non-Secure_Mode">Configuring the Hadoop Daemons in Non-Secure Mode</a></li></ul></li>
<li><a href="#Hadoop_Rack_Awareness">Hadoop Rack Awareness</a></li>
<li><a href="#Monitoring_Health_of_NodeManagers">Monitoring Health of NodeManagers</a></li>
<li><a href="#Slaves_file">Slaves file</a></li>
<li><a href="#Logging">Logging</a></li>
<li><a href="#Operating_the_Hadoop_Cluster">Operating the Hadoop Cluster</a>
<ul>
<li><a href="#Hadoop_Startup">Hadoop Startup</a></li>
<li><a href="#Hadoop_Shutdown">Hadoop Shutdown</a></li></ul></li>
<li><a href="#Operating_the_Hadoop_Cluster">Operating the Hadoop Cluster</a>
<ul>
<li><a href="#Hadoop_Startup">Hadoop Startup</a></li>
<li><a href="#Hadoop_Shutdown">Hadoop Shutdown</a></li></ul></li>
<li><a href="#Web_Interfaces">Web Interfaces</a></li></ul></li></ul>
<div class="section">
<h2>Hadoop MapReduce Next Generation - Cluster Setup<a name="Hadoop_MapReduce_Next_Generation_-_Cluster_Setup"></a></h2>
<div class="section">
<h3><a name="Purpose">Purpose</a></h3>
<p>This document describes how to install, configure and manage non-trivial Hadoop clusters ranging from a few nodes to extremely large clusters with thousands of nodes.</p>
<p>To play with Hadoop, you may first want to install it on a single machine (see <a href="./SingleCluster.html">Single Node Setup</a>).</p></div>
<div class="section">
<h3><a name="Prerequisites">Prerequisites</a></h3>
<p>Download a stable version of Hadoop from Apache mirrors.</p></div>
<div class="section">
<h3><a name="Installation">Installation</a></h3>
<p>Installing a Hadoop cluster typically involves unpacking the software on all the machines in the cluster or installing RPMs.</p>
<p>Typically one machine in the cluster is designated as the NameNode and another machine the as ResourceManager, exclusively. These are the masters.</p>
<p>The rest of the machines in the cluster act as both DataNode and NodeManager. These are the slaves.</p></div>
<div class="section">
<h3><a name="Running_Hadoop_in_Non-Secure_Mode">Running Hadoop in Non-Secure Mode</a></h3>
<p>The following sections describe how to configure a Hadoop cluster.</p>
<p><a name="Configuration_Files">Configuration Files</a></p>
<p>Hadoop configuration is driven by two types of important configuration files:</p>
<ul>
<li>Read-only default configuration - <tt>core-default.xml</tt>, <tt>hdfs-default.xml</tt>, <tt>yarn-default.xml</tt> and <tt>mapred-default.xml</tt>.</li>
<li>Site-specific configuration - <b>conf/core-site.xml</b>, <b>conf/hdfs-site.xml</b>, <b>conf/yarn-site.xml</b> and <b>conf/mapred-site.xml</b>.</li></ul>
<p>Additionally, you can control the Hadoop scripts found in the bin/ directory of the distribution, by setting site-specific values via the <b>conf/hadoop-env.sh</b> and <b>yarn-env.sh</b>.</p>
<p><a name="Site_Configuration">Site Configuration</a></p>
<p>To configure the Hadoop cluster you will need to configure the <tt>environment</tt> in which the Hadoop daemons execute as well as the <tt>configuration parameters</tt> for the Hadoop daemons.</p>
<p>The Hadoop daemons are NameNode/DataNode and ResourceManager/NodeManager.</p>
<div class="section">
<h4><a name="Configuring_Environment_of_Hadoop_Daemons">Configuring Environment of Hadoop Daemons</a></h4>
<p>Administrators should use the <b>conf/hadoop-env.sh</b> and <b>conf/yarn-env.sh</b> script to do site-specific customization of the Hadoop daemons' process environment.</p>
<p>At the very least you should specify the <tt>JAVA_HOME</tt> so that it is correctly defined on each remote node.</p>
<p>In most cases you should also specify <tt>HADOOP_PID_DIR</tt> and <tt>HADOOP_SECURE_DN_PID_DIR</tt> to point to directories that can only be written to by the users that are going to run the hadoop daemons. Otherwise there is the potential for a symlink attack.</p>
<p>Administrators can configure individual daemons using the configuration options shown below in the table:</p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Daemon</th>
<th align="left">Environment Variable</th></tr>
<tr class="b">
<td align="left">NameNode</td>
<td align="left">HADOOP_NAMENODE_OPTS</td></tr>
<tr class="a">
<td align="left">DataNode</td>
<td align="left">HADOOP_DATANODE_OPTS</td></tr>
<tr class="b">
<td align="left">Secondary NameNode</td>
<td align="left">HADOOP_SECONDARYNAMENODE_OPTS</td></tr>
<tr class="a">
<td align="left">ResourceManager</td>
<td align="left">YARN_RESOURCEMANAGER_OPTS</td></tr>
<tr class="b">
<td align="left">NodeManager</td>
<td align="left">YARN_NODEMANAGER_OPTS</td></tr>
<tr class="a">
<td align="left">WebAppProxy</td>
<td align="left">YARN_PROXYSERVER_OPTS</td></tr>
<tr class="b">
<td align="left">Map Reduce Job History Server</td>
<td align="left">HADOOP_JOB_HISTORYSERVER_OPTS</td></tr></table>
<p>For example, To configure Namenode to use parallelGC, the following statement should be added in hadoop-env.sh :</p>
<div>
<pre> export HADOOP_NAMENODE_OPTS=&quot;-XX:+UseParallelGC ${HADOOP_NAMENODE_OPTS}&quot;</pre></div>
<p>Other useful configuration parameters that you can customize include:</p>
<ul>
<li><tt>HADOOP_LOG_DIR</tt> / <tt>YARN_LOG_DIR</tt> - The directory where the daemons' log files are stored. They are automatically created if they don't exist.</li>
<li><tt>HADOOP_HEAPSIZE</tt> / <tt>YARN_HEAPSIZE</tt> - The maximum amount of heapsize to use, in MB e.g. if the varibale is set to 1000 the heap will be set to 1000MB. This is used to configure the heap size for the daemon. By default, the value is 1000. If you want to configure the values separately for each deamon you can use.
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Daemon</th>
<th align="left">Environment Variable</th></tr>
<tr class="b">
<td align="left">ResourceManager</td>
<td align="left">YARN_RESOURCEMANAGER_HEAPSIZE</td></tr>
<tr class="a">
<td align="left">NodeManager</td>
<td align="left">YARN_NODEMANAGER_HEAPSIZE</td></tr>
<tr class="b">
<td align="left">WebAppProxy</td>
<td align="left">YARN_PROXYSERVER_HEAPSIZE</td></tr>
<tr class="a">
<td align="left">Map Reduce Job History Server</td>
<td align="left">HADOOP_JOB_HISTORYSERVER_HEAPSIZE</td></tr></table></li></ul></div>
<div class="section">
<h4><a name="Configuring_the_Hadoop_Daemons_in_Non-Secure_Mode">Configuring the Hadoop Daemons in Non-Secure Mode</a></h4>
<p>This section deals with important parameters to be specified in the given configuration files:</p>
<ul>
<li><tt>conf/core-site.xml</tt>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>fs.defaultFS</tt></td>
<td align="left">NameNode URI</td>
<td align="left"><i>hdfs://host:port/</i></td></tr>
<tr class="a">
<td align="left"><tt>io.file.buffer.size</tt></td>
<td align="left">131072</td>
<td align="left">Size of read/write buffer used in SequenceFiles.</td></tr></table></li>
<li><tt>conf/hdfs-site.xml</tt>
<ul>
<li>Configurations for NameNode:
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>dfs.namenode.name.dir</tt></td>
<td align="left">Path on the local filesystem where the NameNode stores the namespace and transactions logs persistently.</td>
<td align="left">If this is a comma-delimited list of directories then the name table is replicated in all of the directories, for redundancy.</td></tr>
<tr class="a">
<td align="left"><tt>dfs.namenode.hosts</tt> / <tt>dfs.namenode.hosts.exclude</tt></td>
<td align="left">List of permitted/excluded DataNodes.</td>
<td align="left">If necessary, use these files to control the list of allowable datanodes.</td></tr>
<tr class="b">
<td align="left"><tt>dfs.blocksize</tt></td>
<td align="left">268435456</td>
<td align="left">HDFS blocksize of 256MB for large file-systems.</td></tr>
<tr class="a">
<td align="left"><tt>dfs.namenode.handler.count</tt></td>
<td align="left">100</td>
<td align="left">More NameNode server threads to handle RPCs from large number of DataNodes.</td></tr></table></li>
<li>Configurations for DataNode:
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>dfs.datanode.data.dir</tt></td>
<td align="left">Comma separated list of paths on the local filesystem of a <tt>DataNode</tt> where it should store its blocks.</td>
<td align="left">If this is a comma-delimited list of directories, then data will be stored in all named directories, typically on different devices.</td></tr></table></li></ul></li>
<li><tt>conf/yarn-site.xml</tt>
<ul>
<li>Configurations for ResourceManager and NodeManager:
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>yarn.acl.enable</tt></td>
<td align="left"><tt>true</tt> / <tt>false</tt></td>
<td align="left">Enable ACLs? Defaults to <i>false</i>.</td></tr>
<tr class="a">
<td align="left"><tt>yarn.admin.acl</tt></td>
<td align="left">Admin ACL</td>
<td align="left">ACL to set admins on the cluster. ACLs are of for <i>comma-separated-users</i><i>space</i><i>comma-separated-groups</i>. Defaults to special value of <b>*</b> which means <i>anyone</i>. Special value of just <i>space</i> means no one has access.</td></tr>
<tr class="b">
<td align="left"><tt>yarn.log-aggregation-enable</tt></td>
<td align="left"><i>false</i></td>
<td align="left">Configuration to enable or disable log aggregation</td></tr></table></li>
<li>Configurations for ResourceManager:
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>yarn.resourcemanager.address</tt></td>
<td align="left"><tt>ResourceManager</tt> host:port for clients to submit jobs.</td>
<td align="left"><i>host:port</i></td></tr>
<tr class="a">
<td align="left"><tt>yarn.resourcemanager.scheduler.address</tt></td>
<td align="left"><tt>ResourceManager</tt> host:port for ApplicationMasters to talk to Scheduler to obtain resources.</td>
<td align="left"><i>host:port</i></td></tr>
<tr class="b">
<td align="left"><tt>yarn.resourcemanager.resource-tracker.address</tt></td>
<td align="left"><tt>ResourceManager</tt> host:port for NodeManagers.</td>
<td align="left"><i>host:port</i></td></tr>
<tr class="a">
<td align="left"><tt>yarn.resourcemanager.admin.address</tt></td>
<td align="left"><tt>ResourceManager</tt> host:port for administrative commands.</td>
<td align="left"><i>host:port</i></td></tr>
<tr class="b">
<td align="left"><tt>yarn.resourcemanager.webapp.address</tt></td>
<td align="left"><tt>ResourceManager</tt> web-ui host:port.</td>
<td align="left"><i>host:port</i></td></tr>
<tr class="a">
<td align="left"><tt>yarn.resourcemanager.scheduler.class</tt></td>
<td align="left"><tt>ResourceManager</tt> Scheduler class.</td>
<td align="left"><tt>CapacityScheduler</tt> (recommended), <tt>FairScheduler</tt> (also recommended), or <tt>FifoScheduler</tt></td></tr>
<tr class="b">
<td align="left"><tt>yarn.scheduler.minimum-allocation-mb</tt></td>
<td align="left">Minimum limit of memory to allocate to each container request at the <tt>Resource Manager</tt>.</td>
<td align="left">In MBs</td></tr>
<tr class="a">
<td align="left"><tt>yarn.scheduler.maximum-allocation-mb</tt></td>
<td align="left">Maximum limit of memory to allocate to each container request at the <tt>Resource Manager</tt>.</td>
<td align="left">In MBs</td></tr>
<tr class="b">
<td align="left"><tt>yarn.resourcemanager.nodes.include-path</tt> / <tt>yarn.resourcemanager.nodes.exclude-path</tt></td>
<td align="left">List of permitted/excluded NodeManagers.</td>
<td align="left">If necessary, use these files to control the list of allowable NodeManagers.</td></tr></table></li>
<li>Configurations for NodeManager:
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>yarn.nodemanager.resource.memory-mb</tt></td>
<td align="left">Resource i.e. available physical memory, in MB, for given <tt>NodeManager</tt></td>
<td align="left">Defines total available resources on the <tt>NodeManager</tt> to be made available to running containers</td></tr>
<tr class="a">
<td align="left"><tt>yarn.nodemanager.vmem-pmem-ratio</tt></td>
<td align="left">Maximum ratio by which virtual memory usage of tasks may exceed physical memory</td>
<td align="left">The virtual memory usage of each task may exceed its physical memory limit by this ratio. The total amount of virtual memory used by tasks on the NodeManager may exceed its physical memory usage by this ratio.</td></tr>
<tr class="b">
<td align="left"><tt>yarn.nodemanager.local-dirs</tt></td>
<td align="left">Comma-separated list of paths on the local filesystem where intermediate data is written.</td>
<td align="left">Multiple paths help spread disk i/o.</td></tr>
<tr class="a">
<td align="left"><tt>yarn.nodemanager.log-dirs</tt></td>
<td align="left">Comma-separated list of paths on the local filesystem where logs are written.</td>
<td align="left">Multiple paths help spread disk i/o.</td></tr>
<tr class="b">
<td align="left"><tt>yarn.nodemanager.log.retain-seconds</tt></td>
<td align="left"><i>10800</i></td>
<td align="left">Default time (in seconds) to retain log files on the NodeManager Only applicable if log-aggregation is disabled.</td></tr>
<tr class="a">
<td align="left"><tt>yarn.nodemanager.remote-app-log-dir</tt></td>
<td align="left"><i>/logs</i></td>
<td align="left">HDFS directory where the application logs are moved on application completion. Need to set appropriate permissions. Only applicable if log-aggregation is enabled.</td></tr>
<tr class="b">
<td align="left"><tt>yarn.nodemanager.remote-app-log-dir-suffix</tt></td>
<td align="left"><i>logs</i></td>
<td align="left">Suffix appended to the remote log dir. Logs will be aggregated to ${yarn.nodemanager.remote-app-log-dir}/${user}/${thisParam} Only applicable if log-aggregation is enabled.</td></tr>
<tr class="a">
<td align="left"><tt>yarn.nodemanager.aux-services</tt></td>
<td align="left">mapreduce_shuffle</td>
<td align="left">Shuffle service that needs to be set for Map Reduce applications.</td></tr></table></li>
<li>Configurations for History Server (Needs to be moved elsewhere):
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>yarn.log-aggregation.retain-seconds</tt></td>
<td align="left"><i>-1</i></td>
<td align="left">How long to keep aggregation logs before deleting them. -1 disables. Be careful, set this too small and you will spam the name node.</td></tr>
<tr class="a">
<td align="left"><tt>yarn.log-aggregation.retain-check-interval-seconds</tt></td>
<td align="left"><i>-1</i></td>
<td align="left">Time between checks for aggregated log retention. If set to 0 or a negative value then the value is computed as one-tenth of the aggregated log retention time. Be careful, set this too small and you will spam the name node.</td></tr></table></li></ul></li>
<li><tt>conf/mapred-site.xml</tt>
<ul>
<li>Configurations for MapReduce Applications:
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>mapreduce.framework.name</tt></td>
<td align="left">yarn</td>
<td align="left">Execution framework set to Hadoop YARN.</td></tr>
<tr class="a">
<td align="left"><tt>mapreduce.map.memory.mb</tt></td>
<td align="left">1536</td>
<td align="left">Larger resource limit for maps.</td></tr>
<tr class="b">
<td align="left"><tt>mapreduce.map.java.opts</tt></td>
<td align="left">-Xmx1024M</td>
<td align="left">Larger heap-size for child jvms of maps.</td></tr>
<tr class="a">
<td align="left"><tt>mapreduce.reduce.memory.mb</tt></td>
<td align="left">3072</td>
<td align="left">Larger resource limit for reduces.</td></tr>
<tr class="b">
<td align="left"><tt>mapreduce.reduce.java.opts</tt></td>
<td align="left">-Xmx2560M</td>
<td align="left">Larger heap-size for child jvms of reduces.</td></tr>
<tr class="a">
<td align="left"><tt>mapreduce.task.io.sort.mb</tt></td>
<td align="left">512</td>
<td align="left">Higher memory-limit while sorting data for efficiency.</td></tr>
<tr class="b">
<td align="left"><tt>mapreduce.task.io.sort.factor</tt></td>
<td align="left">100</td>
<td align="left">More streams merged at once while sorting files.</td></tr>
<tr class="a">
<td align="left"><tt>mapreduce.reduce.shuffle.parallelcopies</tt></td>
<td align="left">50</td>
<td align="left">Higher number of parallel copies run by reduces to fetch outputs from very large number of maps.</td></tr></table></li>
<li>Configurations for MapReduce JobHistory Server:
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>mapreduce.jobhistory.address</tt></td>
<td align="left">MapReduce JobHistory Server <i>host:port</i></td>
<td align="left">Default port is 10020.</td></tr>
<tr class="a">
<td align="left"><tt>mapreduce.jobhistory.webapp.address</tt></td>
<td align="left">MapReduce JobHistory Server Web UI <i>host:port</i></td>
<td align="left">Default port is 19888.</td></tr>
<tr class="b">
<td align="left"><tt>mapreduce.jobhistory.intermediate-done-dir</tt></td>
<td align="left">/mr-history/tmp</td>
<td align="left">Directory where history files are written by MapReduce jobs.</td></tr>
<tr class="a">
<td align="left"><tt>mapreduce.jobhistory.done-dir</tt></td>
<td align="left">/mr-history/done</td>
<td align="left">Directory where history files are managed by the MR JobHistory Server.</td></tr></table></li></ul></li></ul></div></div>
<div class="section">
<h3><a name="Hadoop_Rack_Awareness">Hadoop Rack Awareness</a></h3>
<p>The HDFS and the YARN components are rack-aware.</p>
<p>The NameNode and the ResourceManager obtains the rack information of the slaves in the cluster by invoking an API <i>resolve</i> in an administrator configured module.</p>
<p>The API resolves the DNS name (also IP address) to a rack id.</p>
<p>The site-specific module to use can be configured using the configuration item <tt>topology.node.switch.mapping.impl</tt>. The default implementation of the same runs a script/command configured using <tt>topology.script.file.name</tt>. If <tt>topology.script.file.name</tt> is not set, the rack id <i>/default-rack</i> is returned for any passed IP address.</p></div>
<div class="section">
<h3><a name="Monitoring_Health_of_NodeManagers">Monitoring Health of NodeManagers</a></h3>
<p>Hadoop provides a mechanism by which administrators can configure the NodeManager to run an administrator supplied script periodically to determine if a node is healthy or not.</p>
<p>Administrators can determine if the node is in a healthy state by performing any checks of their choice in the script. If the script detects the node to be in an unhealthy state, it must print a line to standard output beginning with the string ERROR. The NodeManager spawns the script periodically and checks its output. If the script's output contains the string ERROR, as described above, the node's status is reported as <tt>unhealthy</tt> and the node is black-listed by the ResourceManager. No further tasks will be assigned to this node. However, the NodeManager continues to run the script, so that if the node becomes healthy again, it will be removed from the blacklisted nodes on the ResourceManager automatically. The node's health along with the output of the script, if it is unhealthy, is available to the administrator in the ResourceManager web interface. The time since the node was healthy is also displayed on the web interface.</p>
<p>The following parameters can be used to control the node health monitoring script in <tt>conf/yarn-site.xml</tt>.</p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Parameter</th>
<th align="left">Value</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left"><tt>yarn.nodemanager.health-checker.script.path</tt></td>
<td align="left">Node health script</td>
<td align="left">Script to check for node's health status.</td></tr>
<tr class="a">
<td align="left"><tt>yarn.nodemanager.health-checker.script.opts</tt></td>
<td align="left">Node health script options</td>
<td align="left">Options for script to check for node's health status.</td></tr>
<tr class="b">
<td align="left"><tt>yarn.nodemanager.health-checker.script.interval-ms</tt></td>
<td align="left">Node health script interval</td>
<td align="left">Time interval for running health script.</td></tr>
<tr class="a">
<td align="left"><tt>yarn.nodemanager.health-checker.script.timeout-ms</tt></td>
<td align="left">Node health script timeout interval</td>
<td align="left">Timeout for health script execution.</td></tr></table>
<p>The health checker script is not supposed to give ERROR if only some of the local disks become bad. NodeManager has the ability to periodically check the health of the local disks (specifically checks nodemanager-local-dirs and nodemanager-log-dirs) and after reaching the threshold of number of bad directories based on the value set for the config property yarn.nodemanager.disk-health-checker.min-healthy-disks, the whole node is marked unhealthy and this info is sent to resource manager also. The boot disk is either raided or a failure in the boot disk is identified by the health checker script.</p></div>
<div class="section">
<h3><a name="Slaves_file">Slaves file</a></h3>
<p>Typically you choose one machine in the cluster to act as the NameNode and one machine as to act as the ResourceManager, exclusively. The rest of the machines act as both a DataNode and NodeManager and are referred to as <i>slaves</i>.</p>
<p>List all slave hostnames or IP addresses in your <tt>conf/slaves</tt> file, one per line.</p></div>
<div class="section">
<h3><a name="Logging">Logging</a></h3>
<p>Hadoop uses the Apache log4j via the Apache Commons Logging framework for logging. Edit the <tt>conf/log4j.properties</tt> file to customize the Hadoop daemons' logging configuration (log-formats and so on).</p></div>
<div class="section">
<h3><a name="Operating_the_Hadoop_Cluster">Operating the Hadoop Cluster</a></h3>
<p>Once all the necessary configuration is complete, distribute the files to the <tt>HADOOP_CONF_DIR</tt> directory on all the machines.</p>
<div class="section">
<h4>Hadoop Startup<a name="Hadoop_Startup"></a></h4>
<p>To start a Hadoop cluster you will need to start both the HDFS and YARN cluster.</p>
<p>Format a new distributed filesystem:</p>
<div>
<pre>$ $HADOOP_PREFIX/bin/hdfs namenode -format &lt;cluster_name&gt;</pre></div>
<p>Start the HDFS with the following command, run on the designated NameNode:</p>
<div>
<pre>$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR --script hdfs start namenode</pre></div>
<p>Run a script to start DataNodes on all slaves:</p>
<div>
<pre>$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR --script hdfs start datanode</pre></div>
<p>Start the YARN with the following command, run on the designated ResourceManager:</p>
<div>
<pre>$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh --config $HADOOP_CONF_DIR start resourcemanager</pre></div>
<p>Run a script to start NodeManagers on all slaves:</p>
<div>
<pre>$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh --config $HADOOP_CONF_DIR start nodemanager</pre></div>
<p>Start a standalone WebAppProxy server. If multiple servers are used with load balancing it should be run on each of them:</p>
<div>
<pre>$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh start proxyserver --config $HADOOP_CONF_DIR</pre></div>
<p>Start the MapReduce JobHistory Server with the following command, run on the designated server:</p>
<div>
<pre>$ $HADOOP_PREFIX/sbin/mr-jobhistory-daemon.sh start historyserver --config $HADOOP_CONF_DIR</pre></div></div>
<div class="section">
<h4>Hadoop Shutdown<a name="Hadoop_Shutdown"></a></h4>
<p>Stop the NameNode with the following command, run on the designated NameNode:</p>
<div>
<pre>$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR --script hdfs stop namenode</pre></div>
<p>Run a script to stop DataNodes on all slaves:</p>
<div>
<pre>$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR --script hdfs stop datanode</pre></div>
<p>Stop the ResourceManager with the following command, run on the designated ResourceManager:</p>
<div>
<pre>$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh --config $HADOOP_CONF_DIR stop resourcemanager</pre></div>
<p>Run a script to stop NodeManagers on all slaves:</p>
<div>
<pre>$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh --config $HADOOP_CONF_DIR stop nodemanager</pre></div>
<p>Stop the WebAppProxy server. If multiple servers are used with load balancing it should be run on each of them:</p>
<div>
<pre>$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh stop proxyserver --config $HADOOP_CONF_DIR</pre></div>
<p>Stop the MapReduce JobHistory Server with the following command, run on the designated server:</p>
<div>
<pre>$ $HADOOP_PREFIX/sbin/mr-jobhistory-daemon.sh stop historyserver --config $HADOOP_CONF_DIR</pre></div></div></div>
<div class="section">
<h3><a name="Operating_the_Hadoop_Cluster">Operating the Hadoop Cluster</a></h3>
<p>Once all the necessary configuration is complete, distribute the files to the <tt>HADOOP_CONF_DIR</tt> directory on all the machines.</p>
<p>This section also describes the various Unix users who should be starting the various components and uses the same Unix accounts and groups used previously:</p>
<div class="section">
<h4>Hadoop Startup<a name="Hadoop_Startup"></a></h4>
<p>To start a Hadoop cluster you will need to start both the HDFS and YARN cluster.</p>
<p>Format a new distributed filesystem as <i>hdfs</i>:</p>
<div>
<pre>[hdfs]$ $HADOOP_PREFIX/bin/hdfs namenode -format &lt;cluster_name&gt;</pre></div>
<p>Start the HDFS with the following command, run on the designated NameNode as <i>hdfs</i>:</p>
<div>
<pre>[hdfs]$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR --script hdfs start namenode</pre></div>
<p>Run a script to start DataNodes on all slaves as <i>root</i> with a special environment variable <tt>HADOOP_SECURE_DN_USER</tt> set to <i>hdfs</i>:</p>
<div>
<pre>[root]$ HADOOP_SECURE_DN_USER=hdfs $HADOOP_PREFIX/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR --script hdfs start datanode</pre></div>
<p>Start the YARN with the following command, run on the designated ResourceManager as <i>yarn</i>:</p>
<div>
<pre>[yarn]$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh --config $HADOOP_CONF_DIR start resourcemanager</pre></div>
<p>Run a script to start NodeManagers on all slaves as <i>yarn</i>:</p>
<div>
<pre>[yarn]$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh --config $HADOOP_CONF_DIR start nodemanager</pre></div>
<p>Start a standalone WebAppProxy server. Run on the WebAppProxy server as <i>yarn</i>. If multiple servers are used with load balancing it should be run on each of them:</p>
<div>
<pre>[yarn]$ $HADOOP_YARN_HOME/bin/yarn start proxyserver --config $HADOOP_CONF_DIR</pre></div>
<p>Start the MapReduce JobHistory Server with the following command, run on the designated server as <i>mapred</i>:</p>
<div>
<pre>[mapred]$ $HADOOP_PREFIX/sbin/mr-jobhistory-daemon.sh start historyserver --config $HADOOP_CONF_DIR</pre></div></div>
<div class="section">
<h4>Hadoop Shutdown<a name="Hadoop_Shutdown"></a></h4>
<p>Stop the NameNode with the following command, run on the designated NameNode as <i>hdfs</i>:</p>
<div>
<pre>[hdfs]$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR --script hdfs stop namenode</pre></div>
<p>Run a script to stop DataNodes on all slaves as <i>root</i>:</p>
<div>
<pre>[root]$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR --script hdfs stop datanode</pre></div>
<p>Stop the ResourceManager with the following command, run on the designated ResourceManager as <i>yarn</i>:</p>
<div>
<pre>[yarn]$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh --config $HADOOP_CONF_DIR stop resourcemanager</pre></div>
<p>Run a script to stop NodeManagers on all slaves as <i>yarn</i>:</p>
<div>
<pre>[yarn]$ $HADOOP_YARN_HOME/sbin/yarn-daemon.sh --config $HADOOP_CONF_DIR stop nodemanager</pre></div>
<p>Stop the WebAppProxy server. Run on the WebAppProxy server as <i>yarn</i>. If multiple servers are used with load balancing it should be run on each of them:</p>
<div>
<pre>[yarn]$ $HADOOP_YARN_HOME/bin/yarn stop proxyserver --config $HADOOP_CONF_DIR</pre></div>
<p>Stop the MapReduce JobHistory Server with the following command, run on the designated server as <i>mapred</i>:</p>
<div>
<pre>[mapred]$ $HADOOP_PREFIX/sbin/mr-jobhistory-daemon.sh stop historyserver --config $HADOOP_CONF_DIR</pre></div></div></div>
<div class="section">
<h3><a name="Web_Interfaces">Web Interfaces</a></h3>
<p>Once the Hadoop cluster is up and running check the web-ui of the components as described below:</p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Daemon</th>
<th align="left">Web Interface</th>
<th align="left">Notes</th></tr>
<tr class="b">
<td align="left">NameNode</td>
<td align="left">http://<i>nn_host:port</i>/</td>
<td align="left">Default HTTP port is 50070.</td></tr>
<tr class="a">
<td align="left">ResourceManager</td>
<td align="left">http://<i>rm_host:port</i>/</td>
<td align="left">Default HTTP port is 8088.</td></tr>
<tr class="b">
<td align="left">MapReduce JobHistory Server</td>
<td align="left">http://<i>jhs_host:port</i>/</td>
<td align="left">Default HTTP port is 19888.</td></tr></table></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">&#169; 2014
Apache Software Foundation
- <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a></div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>

Event Timeline