specify a job tracker
The general command line syntax is
bin/hadoop command [genericOptions] [commandOptions]
For every tool that inherits from ToolBase, generic options are
handled by ToolBase while command options are passed to the tool.
Generic options handling is implemented using Common CLI.
Tools that inherit from ToolBase in Hadoop are
DFSShell, DFSck, JobClient, and CopyFiles.
Examples using generic options are
bin/hadoop dfs -fs darwin:8020 -ls /data
list /data directory in dfs with namenode darwin:8020
bin/hadoop dfs -D fs.default.name=darwin:8020 -ls /data
list /data directory in dfs with namenode darwin:8020
bin/hadoop dfs -conf hadoop-site.xml -ls /data
list /data directory in dfs with conf specified in hadoop-site.xml
bin/hadoop job -D mapred.job.tracker=darwin:50020 -submit job.xml
submit a job to job tracker darwin:50020
bin/hadoop job -jt darwin:50020 -submit job.xml
submit a job to job tracker darwin:50020
bin/hadoop job -jt local -submit job.xml
submit a job to local runner
- Author:
- hairong
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.util.Tool |
run |
conf
public Configuration conf
ToolBase
public ToolBase()
setConf
public void setConf(Configuration conf)
- Description copied from interface:
Configurable
- Set the configuration to be used by this object.
- Specified by:
setConf
in interface Configurable
getConf
public Configuration getConf()
- Description copied from interface:
Configurable
- Return the configuration used by this object.
- Specified by:
getConf
in interface Configurable
doMain
public final int doMain(Configuration conf,
String[] args)
throws Exception
- Work as a main program: execute a command and handle exception if any
- Parameters:
conf
- Application default configurationargs
- User-specified arguments
- Returns:
- exit code to be passed to a caller. General contract is that code
equal zero signifies a normal return, negative values signify errors, and
positive non-zero values can be used to return application-specific codes.
- Throws:
Exception
Copyright © 2006 The Apache Software Foundation