Yarn【label-based scheduling】實戰總結(二)
洋哥實踐大作。
1.1 Label-based scheduling實戰問題彙總
1.1.1 ClassNotFoundException
問題現象,執行yarnrmadmin –refreshQueues命令時報以下錯誤:
java.lang.ClassNotFoundException:Class org.apache.hadoop.yarn.server.resourcemanager.scheduler.apacity.sharingpolicy.ConfigurablePartitionsExtentionPolicynot found
報該類問題一般是因為需要的類不存在或者類路徑配置錯誤,經定位是因為類路徑弄出了:
org.apache.hadoop.yarn.server.resourcemanager.scheduler.apacity.sharingpolicy.ConfigurablePartitionsExtentionPolicy
修改為:
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.sharingpolicy.ConfigurablePartitionsExtentionPolicy
1.1.2 IllegalArgumentException:Illegal capacity
問題詳細描述:
java.lang.IllegalArgumentException:Illegal capacity of 0.0 for children of queue root for label=part_B
是因為配置檔案capacity-scheduler.xml缺少以下配置項:
<property> <name>yarn.scheduler.capacity.root.part_B.accessible-node-labels.part_B.capacity</name> <value>100</value> </property>
1.1.3 刪除label partition報錯
先檢視一下Yarn叢集的label partition資訊:
[root@slave2 hadoop]# yarn cluster--list-node-labels
16/02/25 12:09:21 INFO client.RMProxy:Connecting to ResourceManager at slave2/169.10.35.57:8032
Node Labels:<part_B:exclusivity=true>
[root@slave2 hadoop]#
然後通過yarn rmadmin -removeFromClusterNodeLabelspart_B
命令將label partition(part_B)
刪除,刪除時報以下異常:
java.io.IOException:Cannot remove label=part_B, because queue=part_B is using this label. Pleaseremove label on queue before remove the label
異常提示需要先刪除佇列與labelpartition的對應關係,之後才能刪除labelpartition。
解決方案如下:
修改配置檔案capacity-scheduler.xml
,將該檔案中的以下配置項:
<property>
<name>yarn.scheduler.capacity.root.part_B.accessible-node-labels</name>
<value>part_B</value>
</property>
此時如果把一個Mapreduce程式提交到佇列part_B執行,則會直接卡死,如下所示:
出現以上現象的原因是在capacity-scheduler.xml
檔案中缺少以下配置:
<property>
<name>yarn.scheduler.capacity.root.accessible-node-labels.part_B.capacity</name>
<value>100</value>
</property>
1.1.5 refreshQueues Exception
執行yarn rmadmin–refreshQueues命令時報以下錯誤:
java.io.IOException:part_B cannot be found during refresh!
導致報這個錯的原因是:我將目前已經配置好了佇列的capacity-scheduler.xml配置檔案替換成hadoop原始預設的capacity-scheduler.xml配置檔案,並執行yarn rmadmin –refreshQueues命令;之前一直不清楚為什麼會報這個錯誤,無意間在Yarn的官網看到以下描述:
即在Yarn中,佇列不能被刪除。
相關閱讀: