- 1 <?xml version="1.0"?>
- 2 <!--
- 3 Licensed under the Apache License, Version 2.0 (the "License");
- 4 you may not use this file except in compliance with the License.
- 5 You may obtain a copy of the License at
- 6
- 7 http://www.apache.org/licenses/LICENSE-2.0
- 8
- 9 Unless required by applicable law or agreed to in writing, software
- 10 distributed under the License is distributed on an "AS IS" BASIS,
- 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- 12 See the License for the specific language governing permissions and
- 13 limitations under the License. See accompanying LICENSE file.
- 14 -->
- 15 <configuration>
- 16
- 17 <property><!-- 启用YARN HA -->
- 18 <name>yarn.resourcemanager.ha.enabled</name>
- 19 <value>true</value>
- 20 </property>
- 21 <property><!-- 指定YARN cluster id -->
- 22 <name>yarn.resourcemanager.cluster-id</name>
- 23 <value>yrmc1</value>
- 24 </property>
- 25 <property><!-- 指定ResourceManager的名字 -->
- 26 <name>yarn.resourcemanager.ha.rm-ids</name>
- 27 <value>rm1,rm2</value>
- 28 </property>
- 29 <property><!-- 分别指定ResourceManager的地址 -->
- 30 <name>yarn.resourcemanager.hostname.rm1</name>
- 31 <value>master</value>
- 32 </property>
- 33 <property>
- 34 <name>yarn.resourcemanager.hostname.rm2</name>
- 35 <value>master2</value>
- 36 </property>
- 37 <property>
- 38 <name>yarn.resourcemanager.zk-address</name>
- 39 <value>master:2181,master2:2181,slave1:2181</value>
- 40 </property>
- 41 <property>
- 42 <name>yarn.nodemanager.aux-services</name>
- 43 <value>mapreduce_shuffle</value>
- 44 </property>
- 45 <property>
- 46 <name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
- 47 <value>org.apache.hadoop.mapred.ShuffleHandler</value>
- 48 </property>
- 49
- 50 <property>
- 51 <name>yarn.resourcemanager.recovery.enabled</name>
- 52 <value>true</value>
- 53 </property>
- 54
- 55 <!--指定resourcemanager的状态信息存储在zookeeper集群,默认是存放在FileSystem里面。-->
- 56 <property>
- 57 <name>yarn.resourcemanager.store.class</name>
- 58 <value>org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore</value>
- 59 </property>
- 60
- 61 </configuration>