概述
所有的Hadoop命令都通过bin/mapred脚本调用。在没有任何参数的情况下,运行mapred脚本将打印该命令描述。
使用:mapred [--config confdir] COMMAND
[hadoop@hadoopcluster78 bin]$ mapred
Usage: mapred [--config confdir] COMMAND
where COMMAND is one of:
pipes run a Pipes job
job manipulate MapReduce jobs
queue get information regarding JobQueues
classpath prints the class path needed for running
mapreduce subcommands
historyserver run job history servers as a standalone daemon
distcp <srcurl> <desturl> copy file or directories recursively
archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive
hsadmin job history server admin interface
Most commands print help when invoked w/o parameters.
用户命令
对于Hadoop集群用户很有用的命令:
archive
查看:Hadoop之命令指南
classpath
打印需要得到Hadoop的jar和所需要的lib包路径,hdfs,yarn脚本都有这个命令。
使用: mapred classpath
distcp
递归的拷贝文件或者目录,查看该篇中的示例:Hadoop之命令指南。
job
通过job命令和MapReduce任务交互。
使用:mapred job | [GENERIC_OPTIONS] | [-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>]
参数选项 | 描述 |
---|---|
-submit job-file | 提交一个job. |
-status job-id | 打印map任务和reduce任务完成百分比和所有JOB的计数器。 |
-counter jo |