1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta content="Apache Forrest" name="Generator">
- <meta name="Forrest-version" content="0.8">
- <meta name="Forrest-skin-name" content="pelt">
- <title>Hadoop Command Guide</title>
- <link type="text/css" href="skin/basic.css" rel="stylesheet">
- <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
- <link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
- <link type="text/css" href="skin/profile.css" rel="stylesheet">
- <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>
- <link rel="shortcut icon" href="images/favicon.ico">
- </head>
- <body onload="init()">
- <script type="text/javascript">ndeSetTextSize();</script>
- <div id="top">
- <!--+
- |breadtrail
- +-->
- <div class="breadtrail">
- <a href="http://www.apache.org/">Apache</a> > <a href="http://hadoop.apache.org/">Hadoop</a> > <a href="http://hadoop.apache.org/core/">Core</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
- </div>
- <!--+
- |header
- +-->
- <div class="header">
- <!--+
- |start group logo
- +-->
- <div class="grouplogo">
- <a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
- </div>
- <!--+
- |end group logo
- +-->
- <!--+
- |start Project Logo
- +-->
- <div class="projectlogo">
- <a href="http://hadoop.apache.org/core/"><img class="logoImage" alt="Hadoop" src="images/core-logo.gif" title="Scalable Computing Platform"></a>
- </div>
- <!--+
- |end Project Logo
- +-->
- <!--+
- |start Search
- +-->
- <div class="searchbox">
- <form action="http://www.google.com/search" method="get" class="roundtopsmall">
- <input value="hadoop.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">
- <input name="Search" value="Search" type="submit">
- </form>
- </div>
- <!--+
- |end search
- +-->
- <!--+
- |start Tabs
- +-->
- <ul id="tabs">
- <li>
- <a class="unselected" href="http://hadoop.apache.org/core/">Project</a>
- </li>
- <li>
- <a class="unselected" href="http://wiki.apache.org/hadoop">Wiki</a>
- </li>
- <li class="current">
- <a class="selected" href="index.html">Hadoop 0.19 Documentation</a>
- </li>
- </ul>
- <!--+
- |end Tabs
- +-->
- </div>
- </div>
- <div id="main">
- <div id="publishedStrip">
- <!--+
- |start Subtabs
- +-->
- <div id="level2tabs"></div>
- <!--+
- |end Endtabs
- +-->
- <script type="text/javascript"><!--
- document.write("Last Published: " + document.lastModified);
- // --></script>
- </div>
- <!--+
- |breadtrail
- +-->
- <div class="breadtrail">
-
- </div>
- <!--+
- |start Menu, mainarea
- +-->
- <!--+
- |start Menu
- +-->
- <div id="menu">
- <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>
- <div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
- <div class="menuitem">
- <a href="index.html">Overview</a>
- </div>
- <div class="menuitem">
- <a href="quickstart.html">Hadoop Quick Start</a>
- </div>
- <div class="menuitem">
- <a href="cluster_setup.html">Hadoop Cluster Setup</a>
- </div>
- <div class="menuitem">
- <a href="mapred_tutorial.html">Hadoop Map/Reduce Tutorial</a>
- </div>
- <div class="menupage">
- <div class="menupagetitle">Hadoop Command Guide</div>
- </div>
- <div class="menuitem">
- <a href="hdfs_shell.html">Hadoop FS Shell Guide</a>
- </div>
- <div class="menuitem">
- <a href="distcp.html">Hadoop DistCp Guide</a>
- </div>
- <div class="menuitem">
- <a href="native_libraries.html">Hadoop Native Libraries</a>
- </div>
- <div class="menuitem">
- <a href="streaming.html">Hadoop Streaming</a>
- </div>
- <div class="menuitem">
- <a href="hadoop_archives.html">Hadoop Archives</a>
- </div>
- <div class="menuitem">
- <a href="hdfs_user_guide.html">HDFS User Guide</a>
- </div>
- <div class="menuitem">
- <a href="hdfs_design.html">HDFS Architecture</a>
- </div>
- <div class="menuitem">
- <a href="hdfs_permissions_guide.html">HDFS Admin Guide: Permissions</a>
- </div>
- <div class="menuitem">
- <a href="hdfs_quota_admin_guide.html">HDFS Admin Guide: Quotas</a>
- </div>
- <div class="menuitem">
- <a href="SLG_user_guide.html">HDFS Utilities</a>
- </div>
- <div class="menuitem">
- <a href="libhdfs.html">HDFS C API</a>
- </div>
- <div class="menuitem">
- <a href="hod_user_guide.html">HOD User Guide</a>
- </div>
- <div class="menuitem">
- <a href="hod_admin_guide.html">HOD Admin Guide</a>
- </div>
- <div class="menuitem">
- <a href="hod_config_guide.html">HOD Config Guide</a>
- </div>
- <div class="menuitem">
- <a href="capacity_scheduler.html">Capacity Scheduler</a>
- </div>
- <div class="menuitem">
- <a href="api/index.html">API Docs</a>
- </div>
- <div class="menuitem">
- <a href="jdiff/changes.html">API Changes</a>
- </div>
- <div class="menuitem">
- <a href="http://wiki.apache.org/hadoop/">Wiki</a>
- </div>
- <div class="menuitem">
- <a href="http://wiki.apache.org/hadoop/FAQ">FAQ</a>
- </div>
- <div class="menuitem">
- <a href="releasenotes.html">Release Notes</a>
- </div>
- <div class="menuitem">
- <a href="changes.html">Change Log</a>
- </div>
- </div>
- <div id="credit"></div>
- <div id="roundbottom">
- <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
- <!--+
- |alternative credits
- +-->
- <div id="credit2"></div>
- </div>
- <!--+
- |end Menu
- +-->
- <!--+
- |start content
- +-->
- <div id="content">
- <div title="Portable Document Format" class="pdflink">
- <a class="dida" href="commands_manual.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
- PDF</a>
- </div>
- <h1>Hadoop Command Guide</h1>
- <div id="minitoc-area">
- <ul class="minitoc">
- <li>
- <a href="#Overview">Overview</a>
- <ul class="minitoc">
- <li>
- <a href="#Generic+Options">Generic Options</a>
- </li>
- </ul>
- </li>
- <li>
- <a href="#User+Commands"> User Commands </a>
- <ul class="minitoc">
- <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="#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>
- </ul>
- </li>
- <li>
- <a href="#Administration+Commands"> Administration Commands </a>
- <ul class="minitoc">
- <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="#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>
-
- <a name="N1000D"></a><a name="Overview"></a>
- <h2 class="h3">Overview</h2>
- <div class="section">
- <p>
- All the hadoop commands are invoked by the bin/hadoop script. Running hadoop
- script without any arguments prints the description for all commands.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop [--config confdir] [COMMAND] [GENERIC_OPTIONS] [COMMAND_OPTIONS]</span>
-
- </p>
- <p>
- Hadoop has an option parsing framework that employs parsing generic options as well as running classes.
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">--config confdir</span></td>
- <td colspan="1" rowspan="1">Overwrites the default Configuration directory. Default is ${HADOOP_HOME}/conf.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">GENERIC_OPTIONS</span></td>
- <td colspan="1" rowspan="1">The common set of options supported by multiple commands.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">COMMAND</span>
- <br>
- <span class="codefrag">COMMAND_OPTIONS</span></td>
- <td colspan="1" rowspan="1">Various commands with their options are described in the following sections. The commands
- have been grouped into <a href="commands_manual.html#User+Commands">User Commands</a>
- and <a href="commands_manual.html#Administration+Commands">Administration Commands</a>.</td>
-
- </tr>
-
- </table>
- <a name="N10061"></a><a name="Generic+Options"></a>
- <h3 class="h4">Generic Options</h3>
- <p>
- Following are supported by <a href="commands_manual.html#dfsadmin">dfsadmin</a>,
- <a href="commands_manual.html#fs">fs</a>, <a href="commands_manual.html#fsck">fsck</a> and
- <a href="commands_manual.html#job">job</a>.
- Applications should implement
- <a href="api/org/apache/hadoop/util/Tool.html">Tool</a> to support
- <a href="api/org/apache/hadoop/util/GenericOptionsParser.html">
- GenericOptions</a>.
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> GENERIC_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-conf <configuration file></span></td>
- <td colspan="1" rowspan="1">Specify an application configuration file.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-D <property=value></span></td>
- <td colspan="1" rowspan="1">Use value for given property.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-fs <local|namenode:port></span></td>
- <td colspan="1" rowspan="1">Specify a namenode.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-jt <local|jobtracker:port></span></td>
- <td colspan="1" rowspan="1">Specify a job tracker. Applies only to <a href="commands_manual.html#job">job</a>.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-files <comma separated list of files></span></td>
- <td colspan="1" rowspan="1">Specify comma separated files to be copied to the map reduce cluster.
- Applies only to <a href="commands_manual.html#job">job</a>.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-libjars <comma seperated list of jars></span></td>
- <td colspan="1" rowspan="1">Specify comma separated jar files to include in the classpath.
- Applies only to <a href="commands_manual.html#job">job</a>.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-archives <comma separated list of archives></span></td>
- <td colspan="1" rowspan="1">Specify comma separated archives to be unarchived on the compute machines.
- Applies only to <a href="commands_manual.html#job">job</a>.</td>
-
- </tr>
-
- </table>
- </div>
-
-
- <a name="N10103"></a><a name="User+Commands"></a>
- <h2 class="h3"> User Commands </h2>
- <div class="section">
- <p>Commands useful for users of a hadoop cluster.</p>
- <a name="N1010C"></a><a name="archive"></a>
- <h3 class="h4"> archive </h3>
- <p>
- Creates a hadoop archive. More information can be found at <a href="hadoop_archives.html">Hadoop Archives</a>.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop archive -archiveName NAME <src>* <dest></span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-archiveName NAME</span></td>
- <td colspan="1" rowspan="1">Name of the archive to be created.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">src</span></td>
- <td colspan="1" rowspan="1">Filesystem pathnames which work as usual with regular expressions.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">dest</span></td>
- <td colspan="1" rowspan="1">Destination directory which would contain the archive.</td>
-
- </tr>
-
- </table>
- <a name="N10157"></a><a name="distcp"></a>
- <h3 class="h4"> distcp </h3>
- <p>
- Copy file or directories recursively. More information can be found at <a href="distcp.html">Hadoop DistCp Guide</a>.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop distcp <srcurl> <desturl></span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">srcurl</span></td>
- <td colspan="1" rowspan="1">Source Url</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">desturl</span></td>
- <td colspan="1" rowspan="1">Destination Url</td>
-
- </tr>
-
- </table>
- <a name="N10194"></a><a name="fs"></a>
- <h3 class="h4"> fs </h3>
- <p>
-
- <span class="codefrag">Usage: hadoop fs [</span><a href="commands_manual.html#Generic+Options">GENERIC_OPTIONS</a><span class="codefrag">]
- [COMMAND_OPTIONS]</span>
-
- </p>
- <p>
- Runs a generic filesystem user client.
- </p>
- <p>
- The various COMMAND_OPTIONS can be found at <a href="hdfs_shell.html">Hadoop FS Shell Guide</a>.
- </p>
- <a name="N101B0"></a><a name="fsck"></a>
- <h3 class="h4"> fsck </h3>
- <p>
- Runs a HDFS filesystem checking utility. See <a href="hdfs_user_guide.html#Fsck">Fsck</a> for more info.
- </p>
- <p>
- <span class="codefrag">Usage: hadoop fsck [</span><a href="commands_manual.html#Generic+Options">GENERIC_OPTIONS</a><span class="codefrag">]
- <path> [-move | -delete | -openforwrite] [-files [-blocks
- [-locations | -racks]]]</span>
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag"><path></span></td>
- <td colspan="1" rowspan="1">Start checking from this path.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-move</span></td>
- <td colspan="1" rowspan="1">Move corrupted files to /lost+found</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-delete</span></td>
- <td colspan="1" rowspan="1">Delete corrupted files.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-openforwrite</span></td>
- <td colspan="1" rowspan="1">Print out files opened for write.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-files</span></td>
- <td colspan="1" rowspan="1">Print out files being checked.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-blocks</span></td>
- <td colspan="1" rowspan="1">Print out block report.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-locations</span></td>
- <td colspan="1" rowspan="1">Print out locations for every block.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-racks</span></td>
- <td colspan="1" rowspan="1">Print out network topology for data-node locations.</td>
-
- </tr>
-
- </table>
- <a name="N10244"></a><a name="jar"></a>
- <h3 class="h4"> jar </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>
-
- <span class="codefrag">Usage: hadoop jar <jar> [mainClass] args...</span>
-
- </p>
- <p>
- The streaming jobs are run via this command. Examples can be referred from
- <a href="streaming.html#More+usage+examples">Streaming examples</a>
-
- </p>
- <p>
- Word count example is also run using jar command. It can be referred from
- <a href="mapred_tutorial.html#Usage">Wordcount example</a>
-
- </p>
- <a name="N10262"></a><a name="job"></a>
- <h3 class="h4"> job </h3>
- <p>
- Command to interact with Map Reduce Jobs.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop job [</span><a href="commands_manual.html#Generic+Options">GENERIC_OPTIONS</a><span class="codefrag">]
- [-submit <job-file>] | [-status <job-id>] |
- [-counter <job-id> <group-name> <counter-name>] | [-kill <job-id>] |
- [-events <job-id> <from-event-#> <#-of-events>] | [-history [all] <jobOutputDir>] |
- [-list [all]] | [-kill-task <task-id>] | [-fail-task <task-id>] |
- [-set-priority <job-id> <priority>]</span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-submit <job-file></span></td>
- <td colspan="1" rowspan="1">Submits the job.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-status <job-id></span></td>
- <td colspan="1" rowspan="1">Prints the map and reduce completion percentage and all job counters.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-counter <job-id> <group-name> <counter-name></span></td>
- <td colspan="1" rowspan="1">Prints the counter value.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-kill <job-id></span></td>
- <td colspan="1" rowspan="1">Kills the job.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-events <job-id> <from-event-#> <#-of-events></span></td>
- <td colspan="1" rowspan="1">Prints the events' details received by jobtracker for the given range.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-history [all] <jobOutputDir></span></td>
- <td colspan="1" rowspan="1">-history <jobOutputDir> 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>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-list [all]</span></td>
- <td colspan="1" rowspan="1">-list all displays all jobs. -list displays only jobs which are yet to complete.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-kill-task <task-id></span></td>
- <td colspan="1" rowspan="1">Kills the task. Killed tasks are NOT counted against failed attempts.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-fail-task <task-id></span></td>
- <td colspan="1" rowspan="1">Fails the task. Failed tasks are counted against failed attempts.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-set-priority <job-id> <priority></span></td>
- <td colspan="1" rowspan="1">Changes the priority of the job.
- Allowed priority values are VERY_HIGH, HIGH, NORMAL, LOW, VERY_LOW</td>
-
- </tr>
-
- </table>
- <a name="N10310"></a><a name="pipes"></a>
- <h3 class="h4"> pipes </h3>
- <p>
- Runs a pipes job.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop pipes [-conf <path>] [-jobconf <key=value>, <key=value>, ...]
- [-input <path>] [-output <path>] [-jar <jar file>] [-inputformat <class>]
- [-map <class>] [-partitioner <class>] [-reduce <class>] [-writer <class>]
- [-program <executable>] [-reduces <num>] </span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-conf <path></span></td>
- <td colspan="1" rowspan="1">Configuration for job</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-jobconf <key=value>, <key=value>, ...</span></td>
- <td colspan="1" rowspan="1">Add/override configuration for job</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-input <path></span></td>
- <td colspan="1" rowspan="1">Input directory</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-output <path></span></td>
- <td colspan="1" rowspan="1">Output directory</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-jar <jar file></span></td>
- <td colspan="1" rowspan="1">Jar filename</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-inputformat <class></span></td>
- <td colspan="1" rowspan="1">InputFormat class</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-map <class></span></td>
- <td colspan="1" rowspan="1">Java Map class</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-partitioner <class></span></td>
- <td colspan="1" rowspan="1">Java Partitioner</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-reduce <class></span></td>
- <td colspan="1" rowspan="1">Java Reduce class</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-writer <class></span></td>
- <td colspan="1" rowspan="1">Java RecordWriter</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-program <executable></span></td>
- <td colspan="1" rowspan="1">Executable URI</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-reduces <num></span></td>
- <td colspan="1" rowspan="1">Number of reduces</td>
-
- </tr>
-
- </table>
- <a name="N103D5"></a><a name="queue"></a>
- <h3 class="h4"> queue </h3>
- <p>
- command to interact and view Job Queue information
- </p>
- <p>
-
- <span class="codefrag">Usage : hadoop queue [-list] | [-info <job-queue-name> [-showJobs]]</span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
-
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-list</span> </td>
- <td colspan="1" rowspan="1">Gets list of Job Queues configured in the system. Along with scheduling information
- associated with the job queues.
- </td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-info <job-queue-name> [-showJobs]</span></td>
- <td colspan="1" rowspan="1">
- Displays the job queue information and associated scheduling information of particular
- job queue. If -showJobs options is present a list of jobs submitted to the particular job
- queue is displayed.
- </td>
-
- </tr>
-
- </table>
- <a name="N10411"></a><a name="version"></a>
- <h3 class="h4"> version </h3>
- <p>
- Prints the version.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop version</span>
-
- </p>
- <a name="N10421"></a><a name="CLASSNAME"></a>
- <h3 class="h4"> CLASSNAME </h3>
- <p>
- hadoop script can be used to invoke any class.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop CLASSNAME</span>
-
- </p>
- <p>
- Runs the class named CLASSNAME.
- </p>
- </div>
-
- <a name="N10435"></a><a name="Administration+Commands"></a>
- <h2 class="h3"> Administration Commands </h2>
- <div class="section">
- <p>Commands useful for administrators of a hadoop cluster.</p>
- <a name="N1043E"></a><a name="balancer"></a>
- <h3 class="h4"> balancer </h3>
- <p>
- Runs a cluster balancing utility. An administrator can simply press Ctrl-C to stop the
- rebalancing process. See <a href="hdfs_user_guide.html#Rebalancer">Rebalancer</a> for more details.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop balancer [-threshold <threshold>]</span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-threshold <threshold></span></td>
- <td colspan="1" rowspan="1">Percentage of disk capacity. This overwrites the default threshold.</td>
-
- </tr>
-
- </table>
- <a name="N1046D"></a><a name="daemonlog"></a>
- <h3 class="h4"> daemonlog </h3>
- <p>
- Get/Set the log level for each daemon.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop daemonlog -getlevel <host:port> <name></span>
- <br>
-
- <span class="codefrag">Usage: hadoop daemonlog -setlevel <host:port> <name> <level></span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-getlevel <host:port> <name></span></td>
- <td colspan="1" rowspan="1">Prints the log level of the daemon running at <host:port>.
- This command internally connects to http://<host:port>/logLevel?log=<name></td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-setlevel <host:port> <name> <level></span></td>
- <td colspan="1" rowspan="1">Sets the log level of the daemon running at <host:port>.
- This command internally connects to http://<host:port>/logLevel?log=<name></td>
-
- </tr>
-
- </table>
- <a name="N104AA"></a><a name="datanode"></a>
- <h3 class="h4"> datanode</h3>
- <p>
- Runs a HDFS datanode.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop datanode [-rollback]</span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-rollback</span></td>
- <td colspan="1" rowspan="1">Rollsback the datanode to the previous version. This should be used after stopping the datanode
- and distributing the old hadoop version.</td>
-
- </tr>
-
- </table>
- <a name="N104D5"></a><a name="dfsadmin"></a>
- <h3 class="h4"> dfsadmin </h3>
- <p>
- Runs a HDFS dfsadmin client.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop dfsadmin [</span><a href="commands_manual.html#Generic+Options">GENERIC_OPTIONS</a><span class="codefrag">] [-report] [-safemode enter | leave | get | wait] [-refreshNodes]
- [-finalizeUpgrade] [-upgradeProgress status | details | force] [-metasave filename]
- [-setQuota <quota> <dirname>...<dirname>] [-clrQuota <dirname>...<dirname>]
- [-help [cmd]]</span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-report</span></td>
- <td colspan="1" rowspan="1">Reports basic filesystem information and statistics.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-safemode enter | leave | get | wait</span></td>
- <td colspan="1" rowspan="1">Safe mode maintenance command.
- Safe mode is a Namenode state in which it <br>
- 1. does not accept changes to the name space (read-only) <br>
- 2. does not replicate or delete blocks. <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>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-refreshNodes</span></td>
- <td colspan="1" rowspan="1">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>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-finalizeUpgrade</span></td>
- <td colspan="1" rowspan="1">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>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-upgradeProgress status | details | force</span></td>
- <td colspan="1" rowspan="1">Request current distributed upgrade status,
- a detailed status or force the upgrade to proceed.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-metasave filename</span></td>
- <td colspan="1" rowspan="1">Save Namenode's primary data structures
- to <filename> in the directory specified by hadoop.log.dir property.
- <filename> will contain one line for each of the following <br>
- 1. Datanodes heart beating with Namenode<br>
- 2. Blocks waiting to be replicated<br>
- 3. Blocks currrently being replicated<br>
- 4. Blocks waiting to be deleted</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-setQuota <quota> <dirname>...<dirname></span></td>
- <td colspan="1" rowspan="1">Set the quota <quota> for each directory <dirname>.
- The directory quota is a long integer that puts a hard limit on the number of names in the directory tree.<br>
- Best effort for the directory, with faults reported if<br>
- 1. N is not a positive integer, or<br>
- 2. user is not an administrator, or<br>
- 3. the directory does not exist or is a file, or<br>
- 4. the directory would immediately exceed the new quota.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-clrQuota <dirname>...<dirname></span></td>
- <td colspan="1" rowspan="1">Clear the quota for each directory <dirname>.<br>
- Best effort for the directory. with fault reported if<br>
- 1. the directory does not exist or is a file, or<br>
- 2. user is not an administrator.<br>
- It does not fault if the directory has no quota.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-help [cmd]</span></td>
- <td colspan="1" rowspan="1"> Displays help for the given command or all commands if none
- is specified.</td>
-
- </tr>
-
- </table>
- <a name="N10595"></a><a name="jobtracker"></a>
- <h3 class="h4"> jobtracker </h3>
- <p>
- Runs the MapReduce job Tracker node.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop jobtracker</span>
-
- </p>
- <a name="N105A5"></a><a name="namenode"></a>
- <h3 class="h4"> namenode </h3>
- <p>
- Runs the namenode. More info about the upgrade, rollback and finalize is at
- <a href="hdfs_user_guide.html#Upgrade+and+Rollback">Upgrade Rollback</a>
-
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop namenode [-format] | [-upgrade] | [-rollback] | [-finalize] | [-importCheckpoint]</span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-format</span></td>
- <td colspan="1" rowspan="1">Formats the namenode. It starts the namenode, formats it and then shut it down.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-upgrade</span></td>
- <td colspan="1" rowspan="1">Namenode should be started with upgrade option after the distribution of new hadoop version.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-rollback</span></td>
- <td colspan="1" rowspan="1">Rollsback the namenode to the previous version. This should be used after stopping the cluster
- and distributing the old hadoop version.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-finalize</span></td>
- <td colspan="1" rowspan="1">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>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-importCheckpoint</span></td>
- <td colspan="1" rowspan="1">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>
- <a name="N1060C"></a><a name="secondarynamenode"></a>
- <h3 class="h4"> secondarynamenode </h3>
- <p>
- Runs the HDFS secondary namenode. See <a href="hdfs_user_guide.html#Secondary+Namenode">Secondary Namenode</a>
- for more info.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop secondarynamenode [-checkpoint [force]] | [-geteditsize]</span>
-
- </p>
- <table class="ForrestTable" cellspacing="1" cellpadding="4">
-
- <tr>
- <th colspan="1" rowspan="1"> COMMAND_OPTION </th><th colspan="1" rowspan="1"> Description </th>
- </tr>
-
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-checkpoint [force]</span></td>
- <td colspan="1" rowspan="1">Checkpoints the Secondary namenode if EditLog size >= fs.checkpoint.size.
- If -force is used, checkpoint irrespective of EditLog size.</td>
-
- </tr>
-
- <tr>
-
- <td colspan="1" rowspan="1"><span class="codefrag">-geteditsize</span></td>
- <td colspan="1" rowspan="1">Prints the EditLog size.</td>
-
- </tr>
-
- </table>
- <a name="N10649"></a><a name="tasktracker"></a>
- <h3 class="h4"> tasktracker </h3>
- <p>
- Runs a MapReduce task Tracker node.
- </p>
- <p>
-
- <span class="codefrag">Usage: hadoop tasktracker</span>
-
- </p>
- </div>
-
-
-
-
- </div>
- <!--+
- |end content
- +-->
- <div class="clearboth"> </div>
- </div>
- <div id="footer">
- <!--+
- |start bottomstrip
- +-->
- <div class="lastmodified">
- <script type="text/javascript"><!--
- document.write("Last Published: " + document.lastModified);
- // --></script>
- </div>
- <div class="copyright">
- Copyright ©
- 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
- </div>
- <!--+
- |end bottomstrip
- +-->
- </div>
- </body>
- </html>
|