hadoop Yarn distributedshell 相当于MapReduce的wordcount,可以见证Yarn的威力,各位也尝试一下吧
[root@HDP02 hadoop-yarn]# hadoop org.apache.hadoop.yarn.applications.distributedshell.Client -help
14/05/05 18:52:21 INFO distributedshell.Client: Initializing Client
usage: Client
-appname <arg> Application Name. Default
value - DistributedShell
-container_memory <arg> Amount of memory in MB to
be requested to run the
shell command
-container_vcores <arg> Amount of virtual cores to
be requested to run the
shell command
-debug Dump out debug information
-help Print usage
-jar <arg> Jar file containing the
application master
-keep_containers_across_application_attempts Flag to indicate whether
to keep containers across
application attempts. If
the flag is true, running
containers will not be
killed when application
attempt fails and these
containers will be
retrieved by the new
application attempt
-log_properties <arg> log4j.properties file
-master_memory <arg> Amount of memory in MB to
be requested to run the
application master
-master_vcores <arg> Amount of virtual cores to
be requested to run the
application master
-num_containers <arg> No. of containers on which
the shell command needs to
be executed
-priority <arg> Application Priority.
Default 0
-queue <arg> RM Queue in which this
application is to be
submitted
-shell_args <arg> Command line args for the
shell script.Multiple args
can be separated by empty
space.
-shell_cmd_priority <arg> Priority for the shell
command containers
-shell_command <arg> Shell command to be
executed by the
Application Master. Can
only specify either
--shell_command or
--shell_script
-shell_env <arg> Environment for shell
script. Specified as
env_key=env_val pairs
-shell_script <arg> Location of the shell
script to be executed. Can
only specify either
--shell_command or
--shell_script
-timeout <arg> Application timeout in
milliseconds
root@HDP02 hadoop-yarn]# hadoop org.apache.hadoop.yarn.applications.distributedshell.Client -jar hadoop-yarn-applications-distributedshell-2.4.0.2.1.1.0-385.jar -shell_script ./distributedshell.sh -num_containers 10000
14/05/05 18:54:15 INFO distributedshell.Client: Initializing Client
14/05/05 18:54:15 INFO distributedshell.Client: Running Client
14/05/05 18:54:16 INFO client.RMProxy: Connecting to ResourceManager at HDP02.unis.com/192.168.15.147:8050
14/05/05 18:54:17 INFO distributedshell.Client: Got Cluster metric info from ASM, numNodeManagers=3
14/05/05 18:54:17 INFO distributedshell.Client: Got Cluster node info from ASM
14/05/05 18:54:17 INFO distributedshell.Client: Got node report from ASM for, nodeId=HDP03.unis.com:45454, nodeAddressHDP03.unis.com:8042, nodeRackName/default-rack, nodeNumContainers4
14/05/05 18:54:17 INFO distributedshell.Client: Got node report from ASM for, nodeId=HDP04.unis.com:45454, nodeAddressHDP04.unis.com:8042, nodeRackName/default-rack, nodeNumContainers2
14/05/05 18:54:17 INFO distributedshell.Client: Got node report from ASM for, nodeId=HDP05.unis.com:45454, nodeAddressHDP05.unis.com:8042, nodeRackName/default-rack, nodeNumContainers2
14/05/05 18:54:17 INFO distributedshell.Client: Queue info, queueName=default, queueCurrentCapacity=0.6666667, queueMaxCapacity=1.0, queueApplicationCount=1, queueChildQueueCount=0
14/05/05 18:54:17 INFO distributedshell.Client: User ACL Info for Queue, queueName=root, userAcl=SUBMIT_APPLICATIONS
14/05/05 18:54:17 INFO distributedshell.Client: User ACL Info for Queue, queueName=root, userAcl=ADMINISTER_QUEUE
14/05/05 18:54:17 INFO distributedshell.Client: User ACL Info for Queue, queueName=default, userAcl=SUBMIT_APPLICATIONS
14/05/05 18:54:17 INFO distributedshell.Client: User ACL Info for Queue, queueName=default, userAcl=ADMINISTER_QUEUE
14/05/05 18:54:17 INFO distributedshell.Client: Max mem capabililty of resources in this cluster 3072
14/05/05 18:54:17 INFO distributedshell.Client: Max virtual cores capabililty of resources in this cluster 32
14/05/05 18:54:17 INFO distributedshell.Client: Copy App Master jar from local filesystem and add to local environment
14/05/05 18:54:19 INFO distributedshell.Client: Set the environment for the application master
14/05/05 18:54:19 INFO distributedshell.Client: Setting up app master command
14/05/05 18:54:19 INFO distributedshell.Client: Completed setting up app master command {{JAVA_HOME}}/bin/java -Xmx10m org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster --container_memory 10 --container_vcores 1 --num_containers 10000 --priority 0 1><LOG_DIR>/AppMaster.stdout 2><LOG_DIR>/AppMaster.stderr
14/05/05 18:54:19 INFO distributedshell.Client: Submitting application to ASM
14/05/05 18:54:19 INFO impl.YarnClientImpl: Submitted application application_1399278642808_0013
14/05/05 18:54:20 INFO distributedshell.Client: Got application report from ASM for, appId=13, clientToAMToken=null, appDiagnostics=, appMasterHost=N/A, appQueue=default, appMasterRpcPort=-1, appStartTime=1399287259322, yarnAppState=ACCEPTED, distributedFinalState=UNDEFINED, appTrackingUrl=http://HDP02.unis.com:8088/proxy/application_1399278642808_0013/, appUser=root