Page MenuHomec4science

CommandsManual.html
No OneTemporary

File Metadata

Created
Tue, Feb 25, 21:49

CommandsManual.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 Commands Guide</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 to the Apache Software Foundation (ASF) under one or more --><!-- contributor license agreements. See the NOTICE file distributed with --><!-- this work for additional information regarding copyright ownership. --><!-- The ASF licenses this file to You 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. --><ul>
<li><a href="#Overview">Overview</a></li>
<li><a href="#Generic_Options">Generic Options</a></li>
<li><a href="#User_Commands">User Commands</a>
<ul>
<li><a href="#archive">archive</a></li>
<li><a href="#distcp">distcp</a></li>
<li><a href="#fs">fs</a></li>
<li><a href="#fsck">fsck</a></li>
<li><a href="#fetchdt">fetchdt</a></li>
<li><a href="#jar">jar</a></li>
<li><a href="#job">job</a></li>
<li><a href="#pipes">pipes</a></li>
<li><a href="#queue">queue</a></li>
<li><a href="#version">version</a></li>
<li><a href="#CLASSNAME">CLASSNAME</a></li>
<li><a href="#classpath">classpath</a></li></ul></li>
<li><a href="#Administration_Commands">Administration Commands</a>
<ul>
<li><a href="#balancer">balancer</a></li>
<li><a href="#daemonlog">daemonlog</a></li>
<li><a href="#datanode">datanode</a></li>
<li><a href="#dfsadmin">dfsadmin</a></li>
<li><a href="#mradmin">mradmin</a></li>
<li><a href="#jobtracker">jobtracker</a></li>
<li><a href="#namenode">namenode</a></li>
<li><a href="#secondarynamenode">secondarynamenode</a></li>
<li><a href="#tasktracker">tasktracker</a></li></ul></li></ul>
<div class="section">
<h2>Overview<a name="Overview"></a></h2>
<p>All hadoop commands are invoked by the <tt>bin/hadoop</tt> script. Running the hadoop script without any arguments prints the description for all commands.</p>
<p>Usage: <tt>hadoop [--config confdir] [COMMAND] [GENERIC_OPTIONS] [COMMAND_OPTIONS]</tt></p>
<p>Hadoop has an option parsing framework that employs parsing generic options as well as running classes.</p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left"><tt>--config confdir</tt></td>
<td align="left">Overwrites the default Configuration directory. Default is <tt>$<a name="HADOOP_HOME">HADOOP_HOME</a>/conf</tt>.</td></tr>
<tr class="a">
<td align="left">GENERIC_OPTIONS COMMAND_OPTIONS</td>
<td align="left">The common set of options supported by multiple commands. Various commands with their options are described in the following sections. The commands have been grouped into User Commands and Administration Commands.</td></tr></table></div>
<div class="section">
<h2>Generic Options<a name="Generic_Options"></a></h2>
<p>The following options are supported by <a href="#dfsadmin">dfsadmin</a>, <a href="#fs">fs</a>, <a href="#fsck">fsck</a>, <a href="#job">job</a> and <a href="#fetchdt">fetchdt</a>. Applications should implement <a href="../../api/org/apache/hadoop/util/Tool.html">Tool</a> to support GenericOptions.</p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">GENERIC_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left"><tt>-conf &lt;configuration file&gt; </tt></td>
<td align="left">Specify an application configuration file.</td></tr>
<tr class="a">
<td align="left"><tt>-D &lt;property&gt;=&lt;value&gt; </tt></td>
<td align="left">Use value for given property.</td></tr>
<tr class="b">
<td align="left"><tt>-jt &lt;local&gt; or &lt;jobtracker:port&gt; </tt></td>
<td align="left">Specify a job tracker. Applies only to job.</td></tr>
<tr class="a">
<td align="left"><tt>-files &lt;comma separated list of files&gt; </tt></td>
<td align="left">Specify comma separated files to be copied to the map reduce cluster. Applies only to job.</td></tr>
<tr class="b">
<td align="left"><tt>-libjars &lt;comma seperated list of jars&gt; </tt></td>
<td align="left">Specify comma separated jar files to include in the classpath. Applies only to job.</td></tr>
<tr class="a">
<td align="left"><tt>-archives &lt;comma separated list of archives&gt; </tt></td>
<td align="left">Specify comma separated archives to be unarchived on the compute machines. Applies only to job.</td></tr></table></div>
<div class="section">
<h2>User Commands<a name="User_Commands"></a></h2>
<p>Commands useful for users of a hadoop cluster.</p>
<div class="section">
<h3><tt>archive</tt><a name="archive"></a></h3>
<p>Creates a hadoop archive. More information can be found at Hadoop Archives.</p>
<p>Usage: <tt>hadoop archive -archiveName NAME &lt;src&gt;* &lt;dest&gt; </tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-archiveName NAME</td>
<td align="left">Name of the archive to be created.</td></tr>
<tr class="a">
<td align="left">src</td>
<td align="left">Filesystem pathnames which work as usual with regular expressions.</td></tr>
<tr class="b">
<td align="left">dest</td>
<td align="left">Destination directory which would contain the archive.</td></tr></table></div>
<div class="section">
<h3><tt>distcp</tt><a name="distcp"></a></h3>
<p>Copy file or directories recursively. More information can be found at Hadoop DistCp Guide.</p>
<p>Usage: <tt>hadoop distcp &lt;srcurl&gt; &lt;desturl&gt; </tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">srcurl</td>
<td align="left">Source Url</td></tr>
<tr class="a">
<td align="left">desturl</td>
<td align="left">Destination Url</td></tr></table></div>
<div class="section">
<h3><tt>fs</tt><a name="fs"></a></h3>
<p>Usage: <tt>hadoop fs [GENERIC_OPTIONS] [COMMAND_OPTIONS]</tt></p>
<p>Deprecated, use <tt>hdfs dfs</tt> instead.</p>
<p>Runs a generic filesystem user client.</p>
<p>The various COMMAND_OPTIONS can be found at File System Shell Guide.</p></div>
<div class="section">
<h3><tt>fsck</tt><a name="fsck"></a></h3>
<p>Runs a HDFS filesystem checking utility. See <a href="../hadoop-hdfs/HdfsUserGuide.html#fsck">fsck</a> for more info.</p>
<p>Usage: <tt>hadoop fsck [GENERIC_OPTIONS] &lt;path&gt; [-move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left"><i>path</i></td>
<td align="left">Start checking from this path.</td></tr>
<tr class="a">
<td align="left">-move</td>
<td align="left">Move corrupted files to /lost+found</td></tr>
<tr class="b">
<td align="left">-delete</td>
<td align="left">Delete corrupted files.</td></tr>
<tr class="a">
<td align="left">-openforwrite</td>
<td align="left">Print out files opened for write.</td></tr>
<tr class="b">
<td align="left">-files</td>
<td align="left">Print out files being checked.</td></tr>
<tr class="a">
<td align="left">-blocks</td>
<td align="left">Print out block report.</td></tr>
<tr class="b">
<td align="left">-locations</td>
<td align="left">Print out locations for every block.</td></tr>
<tr class="a">
<td align="left">-racks</td>
<td align="left">Print out network topology for data-node locations.</td></tr></table></div>
<div class="section">
<h3><tt>fetchdt</tt><a name="fetchdt"></a></h3>
<p>Gets Delegation Token from a NameNode. See <a href="../hadoop-hdfs/HdfsUserGuide.html#fetchdt">fetchdt</a> for more info.</p>
<p>Usage: <tt>hadoop fetchdt [GENERIC_OPTIONS] [--webservice &lt;namenode_http_addr&gt;] &lt;path&gt; </tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left"><i>fileName</i></td>
<td align="left">File name to store the token into.</td></tr>
<tr class="a">
<td align="left">--webservice <i>https_address</i></td>
<td align="left">use http protocol instead of RPC</td></tr></table></div>
<div class="section">
<h3><tt>jar</tt><a name="jar"></a></h3>
<p>Runs a jar file. Users can bundle their Map Reduce code in a jar file and execute it using this command.</p>
<p>Usage: <tt>hadoop jar &lt;jar&gt; [mainClass] args...</tt></p>
<p>The streaming jobs are run via this command. Examples can be referred from Streaming examples</p>
<p>Word count example is also run using jar command. It can be referred from Wordcount example</p></div>
<div class="section">
<h3><tt>job</tt><a name="job"></a></h3>
<p>Command to interact with Map Reduce Jobs.</p>
<p>Usage: <tt>hadoop job [GENERIC_OPTIONS] [-submit &lt;job-file&gt;] | [-status &lt;job-id&gt;] | [-counter &lt;job-id&gt; &lt;group-name&gt; &lt;counter-name&gt;] | [-kill &lt;job-id&gt;] | [-events &lt;job-id&gt; &lt;from-event-#&gt; &lt;#-of-events&gt;] | [-history [all] &lt;jobOutputDir&gt;] | [-list [all]] | [-kill-task &lt;task-id&gt;] | [-fail-task &lt;task-id&gt;] | [-set-priority &lt;job-id&gt; &lt;priority&gt;]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-submit <i>job-file</i></td>
<td align="left">Submits the job.</td></tr>
<tr class="a">
<td align="left">-status <i>job-id</i></td>
<td align="left">Prints the map and reduce completion percentage and all job counters.</td></tr>
<tr class="b">
<td align="left">-counter <i>job-id</i> <i>group-name</i> <i>counter-name</i></td>
<td align="left">Prints the counter value.</td></tr>
<tr class="a">
<td align="left">-kill <i>job-id</i></td>
<td align="left">Kills the job.</td></tr>
<tr class="b">
<td align="left">-events <i>job-id</i> <i>from-event-#</i> <i>#-of-events</i></td>
<td align="left">Prints the events' details received by jobtracker for the given range.</td></tr>
<tr class="a">
<td align="left">-history [all]<i>jobOutputDir</i></td>
<td align="left">Prints job details, failed and killed tip details. More details about the job such as successful tasks and task attempts made for each task can be viewed by specifying the [all] option.</td></tr>
<tr class="b">
<td align="left">-list [all]</td>
<td align="left">Displays jobs which are yet to complete. <tt>-list all</tt> displays all jobs.</td></tr>
<tr class="a">
<td align="left">-kill-task <i>task-id</i></td>
<td align="left">Kills the task. Killed tasks are NOT counted against failed attempts.</td></tr>
<tr class="b">
<td align="left">-fail-task <i>task-id</i></td>
<td align="left">Fails the task. Failed tasks are counted against failed attempts.</td></tr>
<tr class="a">
<td align="left">-set-priority <i>job-id</i> <i>priority</i></td>
<td align="left">Changes the priority of the job. Allowed priority values are VERY_HIGH, HIGH, NORMAL, LOW, VERY_LOW</td></tr></table></div>
<div class="section">
<h3><tt>pipes</tt><a name="pipes"></a></h3>
<p>Runs a pipes job.</p>
<p>Usage: <tt>hadoop pipes [-conf &lt;path&gt;] [-jobconf &lt;key=value&gt;, &lt;key=value&gt;, ...] [-input &lt;path&gt;] [-output &lt;path&gt;] [-jar &lt;jar file&gt;] [-inputformat &lt;class&gt;] [-map &lt;class&gt;] [-partitioner &lt;class&gt;] [-reduce &lt;class&gt;] [-writer &lt;class&gt;] [-program &lt;executable&gt;] [-reduces &lt;num&gt;]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-conf <i>path</i></td>
<td align="left">Configuration for job</td></tr>
<tr class="a">
<td align="left">-jobconf <i>key=value</i>, <i>key=value</i>, ...</td>
<td align="left">Add/override configuration for job</td></tr>
<tr class="b">
<td align="left">-input <i>path</i></td>
<td align="left">Input directory</td></tr>
<tr class="a">
<td align="left">-output <i>path</i></td>
<td align="left">Output directory</td></tr>
<tr class="b">
<td align="left">-jar <i>jar file</i></td>
<td align="left">Jar filename</td></tr>
<tr class="a">
<td align="left">-inputformat <i>class</i></td>
<td align="left">InputFormat class</td></tr>
<tr class="b">
<td align="left">-map <i>class</i></td>
<td align="left">Java Map class</td></tr>
<tr class="a">
<td align="left">-partitioner <i>class</i></td>
<td align="left">Java Partitioner</td></tr>
<tr class="b">
<td align="left">-reduce <i>class</i></td>
<td align="left">Java Reduce class</td></tr>
<tr class="a">
<td align="left">-writer <i>class</i></td>
<td align="left">Java RecordWriter</td></tr>
<tr class="b">
<td align="left">-program <i>executable</i></td>
<td align="left">Executable URI</td></tr>
<tr class="a">
<td align="left">-reduces <i>num</i></td>
<td align="left">Number of reduces</td></tr></table></div>
<div class="section">
<h3><tt>queue</tt><a name="queue"></a></h3>
<p>command to interact and view Job Queue information</p>
<p>Usage: <tt>hadoop queue [-list] | [-info &lt;job-queue-name&gt; [-showJobs]] | [-showacls]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-list</td>
<td align="left">Gets list of Job Queues configured in the system. Along with scheduling information associated with the job queues.</td></tr>
<tr class="a">
<td align="left">-info <i>job-queue-name</i> [-showJobs]</td>
<td align="left">Displays the job queue information and associated scheduling information of particular job queue. If <tt>-showJobs</tt> options is present a list of jobs submitted to the particular job queue is displayed.</td></tr>
<tr class="b">
<td align="left">-showacls</td>
<td align="left">Displays the queue name and associated queue operations allowed for the current user. The list consists of only those queues to which the user has access.</td></tr></table></div>
<div class="section">
<h3><tt>version</tt><a name="version"></a></h3>
<p>Prints the version.</p>
<p>Usage: <tt>hadoop version</tt></p></div>
<div class="section">
<h3><tt>CLASSNAME</tt><a name="CLASSNAME"></a></h3>
<p>hadoop script can be used to invoke any class.</p>
<p>Usage: <tt>hadoop CLASSNAME</tt></p>
<p>Runs the class named <tt>CLASSNAME</tt>.</p></div>
<div class="section">
<h3><tt>classpath</tt><a name="classpath"></a></h3>
<p>Prints the class path needed to get the Hadoop jar and the required libraries.</p>
<p>Usage: <tt>hadoop classpath</tt></p></div></div>
<div class="section">
<h2>Administration Commands<a name="Administration_Commands"></a></h2>
<p>Commands useful for administrators of a hadoop cluster.</p>
<div class="section">
<h3><tt>balancer</tt><a name="balancer"></a></h3>
<p>Runs a cluster balancing utility. An administrator can simply press Ctrl-C to stop the rebalancing process. See <a href="../hadoop-hdfs/HdfsUserGuide.html#Rebalancer">Rebalancer</a> for more details.</p>
<p>Usage: <tt>hadoop balancer [-threshold &lt;threshold&gt;]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<td align="left">Description</td></tr>
<tr class="b">
<td align="left">-threshold <i>threshold</i></td>
<td align="left">Percentage of disk capacity. This overwrites the default threshold.</td></tr></table></div>
<div class="section">
<h3><tt>daemonlog</tt><a name="daemonlog"></a></h3>
<p>Get/Set the log level for each daemon.</p>
<p>Usage: <tt>hadoop daemonlog -getlevel &lt;host:port&gt; &lt;name&gt; </tt> Usage: <tt>hadoop daemonlog -setlevel &lt;host:port&gt; &lt;name&gt; &lt;level&gt; </tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-getlevel <i>host:port</i> <i>name</i></td>
<td align="left">Prints the log level of the daemon running at <i>host:port</i>. This command internally connects to http://<i>host:port</i>/logLevel?log=<i>name</i></td></tr>
<tr class="a">
<td align="left">-setlevel <i>host:port</i> <i>name</i> <i>level</i></td>
<td align="left">Sets the log level of the daemon running at <i>host:port</i>. This command internally connects to http://<i>host:port</i>/logLevel?log=<i>name</i></td></tr></table></div>
<div class="section">
<h3><tt>datanode</tt><a name="datanode"></a></h3>
<p>Runs a HDFS datanode.</p>
<p>Usage: <tt>hadoop datanode [-rollback]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-rollback</td>
<td align="left">Rollsback the datanode to the previous version. This should be used after stopping the datanode and distributing the old hadoop version.</td></tr></table></div>
<div class="section">
<h3><tt>dfsadmin</tt><a name="dfsadmin"></a></h3>
<p>Runs a HDFS dfsadmin client.</p>
<p>Usage: <tt>hadoop dfsadmin [GENERIC_OPTIONS] [-report] [-safemode enter | leave | get | wait] [-refreshNodes] [-finalizeUpgrade] [-upgradeProgress status | details | force] [-metasave filename] [-setQuota &lt;quota&gt; &lt;dirname&gt;...&lt;dirname&gt;] [-clrQuota &lt;dirname&gt;...&lt;dirname&gt;] [-restoreFailedStorage true|false|check] [-help [cmd]]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-report</td>
<td align="left">Reports basic filesystem information and statistics.</td></tr>
<tr class="a">
<td align="left">-safemode enter / leave / get / wait</td>
<td align="left">Safe mode maintenance command. Safe mode is a Namenode state in which it &#xa0;<br />1. does not accept changes to the name space (read-only) &#xa0;<br />2. does not replicate or delete blocks. &#xa0;<br />Safe mode is entered automatically at Namenode startup, and leaves safe mode automatically when the configured minimum percentage of blocks satisfies the minimum replication condition. Safe mode can also be entered manually, but then it can only be turned off manually as well.</td></tr>
<tr class="b">
<td align="left">-refreshNodes</td>
<td align="left">Re-read the hosts and exclude files to update the set of Datanodes that are allowed to connect to the Namenode and those that should be decommissioned or recommissioned.</td></tr>
<tr class="a">
<td align="left">-finalizeUpgrade</td>
<td align="left">Finalize upgrade of HDFS. Datanodes delete their previous version working directories, followed by Namenode doing the same. This completes the upgrade process.</td></tr>
<tr class="b">
<td align="left">-upgradeProgress status / details / force</td>
<td align="left">Request current distributed upgrade status, a detailed status or force the upgrade to proceed.</td></tr>
<tr class="a">
<td align="left">-metasave filename</td>
<td align="left">Save Namenode's primary data structures to <i>filename</i> in the directory specified by hadoop.log.dir property. <i>filename</i> is overwritten if it exists. <i>filename</i> will contain one line for each of the following&#xa0;<br />1. Datanodes heart beating with Namenode&#xa0;<br />2. Blocks waiting to be replicated&#xa0;<br />3. Blocks currrently being replicated&#xa0;<br />4. Blocks waiting to be deleted&#xa0;</td></tr>
<tr class="b">
<td align="left">-setQuota <i>quota</i> <i>dirname</i>...<i>dirname</i></td>
<td align="left">Set the quota <i>quota</i> for each directory <i>dirname</i>. The directory quota is a long integer that puts a hard limit on the number of names in the directory tree. Best effort for the directory, with faults reported if &#xa0;<br />1. N is not a positive integer, or &#xa0;<br />2. user is not an administrator, or &#xa0;<br />3. the directory does not exist or is a file, or &#xa0;<br />4. the directory would immediately exceed the new quota. &#xa0;</td></tr>
<tr class="a">
<td align="left">-clrQuota <i>dirname</i>...<i>dirname</i></td>
<td align="left">Clear the quota for each directory <i>dirname</i>. Best effort for the directory. with fault reported if &#xa0;<br />1. the directory does not exist or is a file, or &#xa0;<br />2. user is not an administrator. It does not fault if the directory has no quota.</td></tr>
<tr class="b">
<td align="left">-restoreFailedStorage true / false / check</td>
<td align="left">This option will turn on/off automatic attempt to restore failed storage replicas. If a failed storage becomes available again the system will attempt to restore edits and/or fsimage during checkpoint. 'check' option will return current setting.</td></tr>
<tr class="a">
<td align="left">-help [cmd]</td>
<td align="left">Displays help for the given command or all commands if none is specified.</td></tr></table></div>
<div class="section">
<h3><tt>mradmin</tt><a name="mradmin"></a></h3>
<p>Runs MR admin client</p>
<p>Usage: <tt>hadoop mradmin [ GENERIC_OPTIONS ] [-refreshQueueAcls]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-refreshQueueAcls</td>
<td align="left">Refresh the queue acls used by hadoop, to check access during submissions and administration of the job by the user. The properties present in mapred-queue-acls.xml is reloaded by the queue manager.</td></tr></table></div>
<div class="section">
<h3><tt>jobtracker</tt><a name="jobtracker"></a></h3>
<p>Runs the MapReduce job Tracker node.</p>
<p>Usage: <tt>hadoop jobtracker [-dumpConfiguration]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-dumpConfiguration</td>
<td align="left">Dumps the configuration used by the JobTracker alongwith queue configuration in JSON format into Standard output used by the jobtracker and exits.</td></tr></table></div>
<div class="section">
<h3><tt>namenode</tt><a name="namenode"></a></h3>
<p>Runs the namenode. More info about the upgrade, rollback and finalize is at <a href="../hadoop-hdfs/HdfsUserGuide.html#Upgrade_and_Rollback">Upgrade Rollback</a>.</p>
<p>Usage: <tt>hadoop namenode [-format] | [-upgrade] | [-rollback] | [-finalize] | [-importCheckpoint]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-format</td>
<td align="left">Formats the namenode. It starts the namenode, formats it and then shut it down.</td></tr>
<tr class="a">
<td align="left">-upgrade</td>
<td align="left">Namenode should be started with upgrade option after the distribution of new hadoop version.</td></tr>
<tr class="b">
<td align="left">-rollback</td>
<td align="left">Rollsback the namenode to the previous version. This should be used after stopping the cluster and distributing the old hadoop version.</td></tr>
<tr class="a">
<td align="left">-finalize</td>
<td align="left">Finalize will remove the previous state of the files system. Recent upgrade will become permanent. Rollback option will not be available anymore. After finalization it shuts the namenode down.</td></tr>
<tr class="b">
<td align="left">-importCheckpoint</td>
<td align="left">Loads image from a checkpoint directory and save it into the current one. Checkpoint dir is read from property fs.checkpoint.dir</td></tr></table></div>
<div class="section">
<h3><tt>secondarynamenode</tt><a name="secondarynamenode"></a></h3>
<p>Runs the HDFS secondary namenode. See <a href="../hadoop-hdfs/HdfsUserGuide.html#Secondary_NameNode">Secondary Namenode</a> for more info.</p>
<p>Usage: <tt>hadoop secondarynamenode [-checkpoint [force]] | [-geteditsize]</tt></p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">COMMAND_OPTION</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">-checkpoint [-force]</td>
<td align="left">Checkpoints the Secondary namenode if EditLog size &gt;= fs.checkpoint.size. If <tt>-force</tt> is used, checkpoint irrespective of EditLog size.</td></tr>
<tr class="a">
<td align="left">-geteditsize</td>
<td align="left">Prints the EditLog size.</td></tr></table></div>
<div class="section">
<h3><tt>tasktracker</tt><a name="tasktracker"></a></h3>
<p>Runs a MapReduce task Tracker node.</p>
<p>Usage: <tt>hadoop tasktracker</tt></p></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