首先,hadoop2.x 分为三种任务执行方式
FIFO (默认) 不管你任务大小,一个队列,一次只会一个。其他的会暂停等待释放。
FAIR 公平调度,多队列。
capacity 容量调度,多队列。
上面两个具体的内容 我后期再修改吧。
启动多队列方式:
yarn-site.xml
<property>
<name>yarn.resourcemanager.scheduler.class</name>
<value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>
</property>
添加这个。
重启。。
准备点wordcount 的数字。放入hdfs 的/test_data 目录
hadoop fs -mkdir /test_data
hadoop fs -put wordcount.txt /test_data
打开两个控制台:同时执行。。
hadoop jar hadoop-mapreduce-examples-2.7.3.jar wordcount /test_data /output5
hadoop jar hadoop-mapreduce-examples-2.7.3.jar wordcount /test_data /output6
就可以同时跑啦!神不神奇!