yarn.resourcemanager.ha.enabled true yarn.resourcemanager.cluster-id zz yarn.resourcemanager.ha.rm-ids rm1,rm2 yarn.resourcemanager.hostname.rm1 host1 yarn.resourcemanager.hostname.rm2 host2 yarn.resourcemanager.webapp.address.rm1 host1:8088 yarn.resourcemanager.webapp.address.rm2 host2:8088 ha.zookeeper.quorum host1:2181,host2:2181,host3:2181 yarn.resourcemanager.zk-state-store.address host1:2181,host2:2181,host3:2181 yarn.resourcemanager.store.class org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore yarn.resourcemanager.zk-address host1:2181,host2:2181,host3:2181 yarn.resourcemanager.ha.automatic-failover.enabled true yarn.resourcemanager.connect.retry-interval.ms 2000 yarn.resourcemanager.recovery.enabled true yarn.app.mapreduce.am.scheduler.connection.wait.interval-ms 5000 yarn.client.failover-proxy-provider org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider yarn.resourcemanager.ha.automatic-failover.zk-base-path /yarn-leader-election yarn.nodemanager.aux-services mapreduce_shuffle,spark_shuffle yarn.nodemanager.aux-services.mapreduce.shuffle.class org.apache.hadoop.mapred.ShuffleHandler yarn.nodemanager.aux-services.spark_shuffle.class org.apache.spark.network.yarn.YarnShuffleService spark.shuffle.service.port 7337 yarn.nodemanager.local-dirs /home/cloudz/install/hadoop-2.9.0/tmp yarn.nodemanager.log-dirs /home/cloudz/install/hadoop-2.9.0/logs yarn.scheduler.minimum-allocation-mb 512 yarn.scheduler.maximum-allocation-mb 4096 yarn.nodemanager.resource.memory-mb 16384 yarn.nodemanager.vmem-pmem-ratio 4.2 允许的虚拟内存倍数 yarn.nodemanager.resource.cpu-vcores 8 mapreduce.map.output.compress true mapreduce.map.output.compress.codec org.apache.hadoop.io.compress.SnappyCodec mapreduce.output.fileoutputformat.compress true mapreduce.output.fileoutputformat.compress.codec org.apache.hadoop.io.compress.SnappyCodec 数据的压缩类型,这里使用Snappy压缩 mapreduce.output.fileoutputformat.compress.type BLOCK 数据的压缩级别,这里设置按数据块压缩 yarn.log-aggregation-enable true 开启application 日志聚合功能 yarn.log-aggregation.retain-seconds 259200 设置聚合日志保存时间3天 yarn.log-aggregation.retain-check-interval-seconds 86400 清理过期聚合日志程序的执行间隔时间 yarn.nodemanager.remote-app-log-dir /tmp/logs 聚合日志在hdfs上的目录 yarn.log.server.url http://host1.bjcq.zybang.com:19888/jobhistory/logs 历史日志对应路径 yarn.resourcemanager.scheduler.class org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler 配置yarn启用容量调度模式(默认即是容量调度),配置文件为capacity-scheduler.xml