Hadoop3.2.0使用详解

1.概述

Hadoop3已经发布很久了,迭代集成的一些新特性也是很有用的。截止本篇博客书写为止,Hadoop发布了3.2.0。接下来,笔者就为大家分享一下在使用Hadoop3中遇到到一些问题,以及解决方法。

2.内容

2.1 基础软件包

在使用这些组件时,我们需要做一些准备工作,内容如下:

  • Hadoop-3.2.0安装包(建议Hadoop-3.2.0源代码也一起下载,后面步骤需要用到)
  • Maven-3.6.1(编译Hadoop-3.2.0源代码)
  • ProtoBuf-2.5.0(编译Hadoop-3.2.0源代码)

2.2 部署环境

SSH,用户创建,免密登录等这些操作这里就不介绍了,大家可以参考这篇博客【配置高可用的Hadoop平台】。在部署用户下配置好Hadoop的环境变量,例如HADOOP_HOME、HADOOP_CONF_DIR等。

2.2.1 配置环境变量

具体内容如下:

vi ~/.bash_profile

# 编辑如下变量
export MAVEN_OPTS="-Xms256m -Xmx512m"
export JAVA_HOME=/data/soft/new/jdk
export HADOOP_HOME=/data/soft/new/hadoop
export HADOOP_CONF_DIR=/data/soft/new/hadoop-config
export HADOOP_YARN_HOME=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME

export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$MAVEN_OPTS:$HBASE_HOME/bin

2.2.2 编译Hadoop-3.2.0源代码

为什么需要编译Hadoop-3.2.0源代码,因为在使用Hadoop-3.2.0时,提交任务到YARN时,可能会出现如下异常:

2019-04-21 22:47:45,307 ERROR [main] org.apache.hadoop.mapreduce.v2.app.MRAppMaster: Error starting MRAppMaste
r
org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.lang.NullPointerException
        at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:178)
        at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.serviceStart(RMCommunicator.java:122)
        at org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator.serviceStart(RMContainerAllocator.java:280)
        at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)
        at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$ContainerAllocatorRouter.serviceStart(MRAppMaster.java:979)
        at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)
        at org.apache.hadoop.service.CompositeService.serviceStart(CompositeService.java:121)
        at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.serviceStart(MRAppMaster.java:1293)
        at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)
        at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$6.run(MRAppMaster.java:1761)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
        at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.initAndStartAppMaster(MRAppMaster.java:1757)
        at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.main(MRAppMaster.java:1691)
Caused by: java.lang.NullPointerException
        at org.apache.hadoop.mapreduce.v2.app.client.MRClientService.getHttpPort(MRClientService.java:177)
        at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:159)
        ... 14 more

阅读源代码,会发现这是由于org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializer.java这个类中的一段代码引起的,涉及的代码如下:

if (rmIds != null) {
      List urls = new ArrayList<>();
      for (String rmId : rmIds) {
        String url = getUrlByRmId(yarnConf, rmId);
        // urls.add(url); // 注释掉这端代码,修改为下面的if语句判断是否为null
        if (url != null) {
          urls.add(url);
        }        
      }
      if (!urls.isEmpty()) {
        params.put(RM_HA_URLS, StringUtils.join(",", urls));
      }
    }

这与yarn-site.xml配置HA的兼容性有关,取决于 yarn.resourcemanager.webapp.address 和 yarn.resourcemanager.webapp.https.address 是否为空。

准备好Maven环境(建议使用最新的,因为在Hadoop-3.2.0中使用了Maven较新的Plugins插件),ProtoBuf的版本Hadoop还是使用的2.5.0,这里保持不变,在编译环境中配置好即可。然后,开始编译Hadoop-3.2.0源代码,执行命令如下:

# 为了加快编译速度,不编译单元测试和文档
mvn package -Pdist -DskipTests -Dtar -Dmaven.javadoc.skip=true

执行命令,等待编译结果,编译成功后,会出现如下所示的结果:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Hadoop Main 3.2.0:
[INFO]
[INFO] Apache Hadoop Main ................................. SUCCESS [  1.040 s]
[INFO] Apache Hadoop Build Tools .......................... SUCCESS [  1.054 s]
[INFO] Apache Hadoop Project POM .......................... SUCCESS [  0.845 s]
[INFO] Apache Hadoop Annotations .......................... SUCCESS [  0.546 s]
[INFO] Apache Hadoop Assemblies ........................... SUCCESS [  0.185 s]
[INFO] Apache Hadoop Project Dist POM ..................... SUCCESS [  1.460 s]
[INFO] Apache Hadoop Maven Plugins ........................ SUCCESS [  2.556 s]
[INFO] Apache Hadoop MiniKDC .............................. SUCCESS [  0.529 s]
[INFO] Apache Hadoop Auth ................................. SUCCESS [  2.412 s]
[INFO] Apache Hadoop Auth Examples ........................ SUCCESS [  0.977 s]
[INFO] Apache Hadoop Common ............................... SUCCESS [ 28.555 s]
[INFO] Apache Hadoop NFS .................................. SUCCESS [  1.319 s]
[INFO] Apache Hadoop KMS .................................. SUCCESS [ 11.622 s]
[INFO] Apache Hadoop Common Project ....................... SUCCESS [  0.049 s]
[INFO] Apache Hadoop HDFS Client .......................... SUCCESS [05:37 min]
[INFO] Apache Hadoop HDFS ................................. SUCCESS [ 28.582 s]
[INFO] Apache Hadoop HDFS Native Client ................... SUCCESS [  0.966 s]
[INFO] Apache Hadoop HttpFS ............................... SUCCESS [  6.328 s]
[INFO] Apache Hadoop HDFS-NFS ............................. SUCCESS [  0.859 s]
[INFO] Apache Hadoop HDFS-RBF ............................. SUCCESS [  3.071 s]
[INFO] Apache Hadoop HDFS Project ......................... SUCCESS [  0.035 s]
[INFO] Apache Hadoop YARN ................................. SUCCESS [  0.039 s]
[INFO] Apache Hadoop YARN API ............................. SUCCESS [  5.060 s]
[INFO] Apache Hadoop YARN Common .......................... SUCCESS [02:24 min]
[INFO] Apache Hadoop YARN Registry ........................ SUCCESS [  1.147 s]
[INFO] Apache Hadoop YARN Server .......................... SUCCESS [  0.041 s]
[INFO] Apache Hadoop YARN Server Common ................... SUCCESS [01:44 min]
[INFO] Apache Hadoop YARN NodeManager ..................... SUCCESS [  4.143 s]
[INFO] Apache Hadoop YARN Web Proxy ....................... SUCCESS [  0.921 s]
[INFO] Apache Hadoop YARN ApplicationHistoryService ....... SUCCESS [ 12.087 s]
[INFO] Apache Hadoop YARN Timeline Service ................ SUCCESS [  4.518 s]
[INFO] Apache Hadoop YARN ResourceManager ................. SUCCESS [  7.887 s]
[INFO] Apache Hadoop YARN Server Tests .................... SUCCESS [  0.982 s]
[INFO] Apache Hadoop YARN Client .......................... SUCCESS [  1.712 s]
[INFO] Apache Hadoop YARN SharedCacheManager .............. SUCCESS [  0.919 s]
[INFO] Apache Hadoop YARN Timeline Plugin Storage ......... SUCCESS [  1.269 s]
[INFO] Apache Hadoop YARN TimelineService HBase Backend ... SUCCESS [  0.062 s]
[INFO] Apache Hadoop YARN TimelineService HBase Common .... SUCCESS [ 26.109 s]
[INFO] Apache Hadoop YARN TimelineService HBase Client .... SUCCESS [ 33.811 s]
[INFO] Apache Hadoop YARN TimelineService HBase Servers ... SUCCESS [  0.041 s]
[INFO] Apache Hadoop YARN TimelineService HBase Server 1.2  SUCCESS [  1.659 s]
[INFO] Apache Hadoop YARN TimelineService HBase tests ..... SUCCESS [ 44.305 s]
[INFO] Apache Hadoop YARN Router .......................... SUCCESS [  1.186 s]
[INFO] Apache Hadoop YARN Applications .................... SUCCESS [  0.049 s]
[INFO] Apache Hadoop YARN DistributedShell ................ SUCCESS [  0.843 s]
[INFO] Apache Hadoop YARN Unmanaged Am Launcher ........... SUCCESS [  0.571 s]
[INFO] Apache Hadoop MapReduce Client ..................... SUCCESS [  0.136 s]
[INFO] Apache Hadoop MapReduce Core ....................... SUCCESS [  3.399 s]
[INFO] Apache Hadoop MapReduce Common ..................... SUCCESS [  1.819 s]
[INFO] Apache Hadoop MapReduce Shuffle .................... SUCCESS [  1.289 s]
[INFO] Apache Hadoop MapReduce App ........................ SUCCESS [  2.320 s]
[INFO] Apache Hadoop MapReduce HistoryServer .............. SUCCESS [  1.450 s]
[INFO] Apache Hadoop MapReduce JobClient .................. SUCCESS [  2.856 s]
[INFO] Apache Hadoop Mini-Cluster ......................... SUCCESS [  0.969 s]
[INFO] Apache Hadoop YARN Services ........................ SUCCESS [  0.041 s]
[INFO] Apache Hadoop YARN Services Core ................... SUCCESS [ 13.856 s]
[INFO] Apache Hadoop YARN Services API .................... SUCCESS [  1.034 s]
[INFO] Apache Hadoop Image Generation Tool ................ SUCCESS [  0.715 s]
[INFO] Yet Another Learning Platform ...................... SUCCESS [  0.946 s]
[INFO] Apache Hadoop YARN Site ............................ SUCCESS [  0.065 s]
[INFO] Apache Hadoop YARN UI .............................. SUCCESS [  0.048 s]
[INFO] Apache Hadoop YARN Project ......................... SUCCESS [  8.150 s]
[INFO] Apache Hadoop MapReduce HistoryServer Plugins ...... SUCCESS [  0.525 s]
[INFO] Apache Hadoop MapReduce NativeTask ................. SUCCESS [  0.931 s]
[INFO] Apache Hadoop MapReduce Uploader ................... SUCCESS [  0.575 s]
[INFO] Apache Hadoop MapReduce Examples ................... SUCCESS [  0.829 s]
[INFO] Apache Hadoop MapReduce ............................ SUCCESS [  3.370 s]
[INFO] Apache Hadoop MapReduce Streaming .................. SUCCESS [  6.949 s]
[INFO] Apache Hadoop Distributed Copy ..................... SUCCESS [  1.523 s]
[INFO] Apache Hadoop Archives ............................. SUCCESS [  0.392 s]
[INFO] Apache Hadoop Archive Logs ......................... SUCCESS [  0.515 s]
[INFO] Apache Hadoop Rumen ................................ SUCCESS [  0.807 s]
[INFO] Apache Hadoop Gridmix .............................. SUCCESS [  0.774 s]
[INFO] Apache Hadoop Data Join ............................ SUCCESS [  0.385 s]
[INFO] Apache Hadoop Extras ............................... SUCCESS [  0.425 s]
[INFO] Apache Hadoop Pipes ................................ SUCCESS [  0.055 s]
[INFO] Apache Hadoop OpenStack support .................... SUCCESS [  0.688 s]
[INFO] Apache Hadoop Amazon Web Services support .......... SUCCESS [ 54.379 s]
[INFO] Apache Hadoop Kafka Library support ................ SUCCESS [  3.304 s]
[INFO] Apache Hadoop Azure support ........................ SUCCESS [01:42 min]
[INFO] Apache Hadoop Aliyun OSS support ................... SUCCESS [  3.943 s]
[INFO] Apache Hadoop Client Aggregator .................... SUCCESS [  2.479 s]
[INFO] Apache Hadoop Scheduler Load Simulator ............. SUCCESS [  1.577 s]
[INFO] Apache Hadoop Resource Estimator Service ........... SUCCESS [  5.400 s]
[INFO] Apache Hadoop Azure Data Lake support .............. SUCCESS [02:40 min]
[INFO] Apache Hadoop Tools Dist ........................... SUCCESS [  7.984 s]
[INFO] Apache Hadoop Tools ................................ SUCCESS [  0.056 s]
[INFO] Apache Hadoop Client API ........................... SUCCESS [01:18 min]
[INFO] Apache Hadoop Client Runtime ....................... SUCCESS [ 51.046 s]
[INFO] Apache Hadoop Client Packaging Invariants .......... SUCCESS [  1.265 s]
[INFO] Apache Hadoop Client Test Minicluster .............. SUCCESS [01:41 min]
[INFO] Apache Hadoop Client Packaging Invariants for Test . SUCCESS [  0.172 s]
[INFO] Apache Hadoop Client Packaging Integration Tests ... SUCCESS [  0.146 s]
[INFO] Apache Hadoop Distribution ......................... SUCCESS [ 23.411 s]
[INFO] Apache Hadoop Client Modules ....................... SUCCESS [  0.045 s]
[INFO] Apache Hadoop Cloud Storage ........................ SUCCESS [  0.649 s]
[INFO] Apache Hadoop Cloud Storage Project ................ SUCCESS [  0.060 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24:49 min
[INFO] Finished at: 2019-04-22T03:21:56+08:00
[INFO] ------------------------------------------------------------------------

最后,在hadoop-dist/target目录中将编译后的/hadoop-dist/target/hadoop-3.2.0/share/hadoop/yarn/hadoop-yarn-server-web-proxy-3.2.0.jar包上传到Hadoop集群中,替换$HADOOP_HOME/share/hadoop/yarn中的jar包。

2.2.3 配置Hadoop文件

之前,介绍过Hadoop2的配置文件,这次为大家重新整理了一份Hadoop3的配置文件,具体内容如下:

1.hdfs-site.xml

xml version="1.0" encoding="UTF-8"?>
<configuration>
    <property>
        <name>dfs.nameservicesname>
        <value>cluster1value>
    property>
    <property>
        <name>dfs.ha.namenodes.cluster1name>
        <value>nna,nnsvalue>
    property>
    <property>
        <name>dfs.namenode.rpc-address.cluster1.nnaname>
        <value>nna:9820value>
    property>
    <property>
        <name>dfs.namenode.rpc-address.cluster1.nnsname>
        <value>nns:9820value>
    property>
    <property>
        <name>dfs.namenode.http-address.cluster1.nnaname>
        <value>nna:9870value>
    property>
    <property>
        <name>dfs.namenode.http-address.cluster1.nnsname>
        <value>nns:9870value>
    property>
    <property>
        <name>dfs.namenode.shared.edits.dirname>
        <value>qjournal://dn1:8485;dn2:8485;dn3:8485/cluster1value>
    property>
    <property>
        <name>dfs.client.failover.proxy.provider.cluster1name>
        <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvidervalue>
    property>
    <property>
        <name>dfs.ha.fencing.methodsname>
        <value>sshfencevalue>
    property>
    <property>
        <name>dfs.ha.fencing.ssh.private-key-filesname>
        <value>/home/hadoop/.ssh/id_rsavalue>
    property>
    
    <property>
        <name>dfs.journalnode.edits.dirname>
        <value>/data/soft/new/dfs/journalvalue>
    property>
    <property>
        <name>dfs.ha.automatic-failover.enabledname>
        <value>truevalue>
    property>
    
    <property>
        <name>dfs.namenode.name.dirname>
        <value>/data/soft/new/dfs/namevalue>
    property>
    
    <property>
        <name>dfs.datanode.data.dirname>
        <value>/data/soft/new/dfs/datavalue>
    property>
    
    <property>
        <name>dfs.replicationname>
        <value>2value>
    property>
    <property>
        <name>dfs.webhdfs.enabledname>
        <value>truevalue>
    property>
    <property>
        <name>dfs.journalnode.http-addressname>
        <value>0.0.0.0:8480value>
    property>
    <property>
        <name>dfs.journalnode.rpc-addressname>
        <value>0.0.0.0:8485value>
    property>
    <property>
        <name>ha.zookeeper.quorumname>
        <value>dn1:2181,dn2:2181,dn3:2181value>
    property>
configuration>

 

2.core-site.xml

xml version="1.0" encoding="UTF-8"?>
<configuration>
    <property>
        <name>fs.defaultFSname>
        <value>hdfs://cluster1value>
    property>
    <property>
        <name>io.file.buffer.sizename>
        <value>131072value>
    property>
    <property>
        <name>hadoop.tmp.dirname>
        <value>/data/soft/new/dfs/tmpvalue>
    property>
    <property>
        <name>hadoop.proxyuser.root.hostsname>
        <value>*value>
    property>
    <property>
        <name>hadoop.proxyuser.root.groupsname>
        <value>*value>
    property>
    <property>
        <name>ha.zookeeper.quorumname>
        <value>dn1:2181,dn2:2181,dn3:2181value>
    property>
configuration>

3.mapred-site.xml

xml version="1.0" encoding="UTF-8"?>
<configuration>
    <property>
        <name>mapreduce.framework.namename>
        <value>yarnvalue>
    property>
    <property>
        <name>mapreduce.jobhistory.addressname>
        <value>0.0.0.0:10020value>
    property>
    <property>
        <name>mapreduce.jobhistory.webapp.addressname>
        <value>nna:19888value>
    property>
    <property>
        <name>yarn.app.mapreduce.am.resource.mbname>
        <value>512value>
    property>
    <property>
        <name>mapreduce.map.memory.mbname>
        <value>512value>
    property>
    <property>
        <name>mapreduce.map.java.optsname>
        <value>-Xmx512Mvalue>
    property>
    <property>
        <name>mapreduce.reduce.memory.mbname>
        <value>512value>
    property>
    <property>
        <name>mapreduce.reduce.java.optsname>
        <value>-Xmx512Mvalue>
    property>
    <property>
        <name>mapred.child.java.optsname>
        <value>-Xmx512Mvalue>
    property>
    
   <property>
      <name>mapreduce.application.classpathname>
      <value>/data/soft/new/hadoop-config,/data/soft/new/hadoop/share/hadoop/common/*,/data/soft/new/hadoop/share/hadoop/common/lib/*,/data/soft/new/hadoop/share/hadoop/hdfs/*,/data/soft/new/hadoop/share/hadoop/hdfs/lib/*,/data/soft/new/hadoop/share/hadoop/yarn/*,/data/soft/new/hadoop/share/hadoop/yarn/lib/*,/data/soft/new/hadoop/share/hadoop/mapreduce/*,/data/soft/new/hadoop/share/hadoop/mapreduce/lib/*value>
    property>
configuration>

4.yarn-site.xml

xml version="1.0"?>
<configuration>
  <property>
    <description>Factory to create client IPC classes.description>
    <name>yarn.ipc.client.factory.classname>
  property>

  <property>
    <description>Factory to create server IPC classes.description>
    <name>yarn.ipc.server.factory.classname>
  property>

  <property>
    <description>Factory to create serializeable records.description>
    <name>yarn.ipc.record.factory.classname>
  property>
  <property>
    <description>RPC class implementationdescription>
    <name>yarn.ipc.rpc.classname>
    <value>org.apache.hadoop.yarn.ipc.HadoopYarnProtoRPCvalue>
  property>
  
  
  <property>
    <description>The hostname of the RM.description>
    <name>yarn.resourcemanager.hostname.hdp-rm01name>
    <value>nnavalue>
  property>    

  <property>
    <description>The hostname of the RM.description>
    <name>yarn.resourcemanager.hostname.hdp-rm02name>
    <value>nnsvalue>
  property>

  
  <property>
    <description>The address of the applications manager interface in the RM.description>
    <name>yarn.resourcemanager.addressname>
    <value>value>
  property>

  <property>
    <description>
      The actual address the server will bind to. If this optional address is
      set, the RPC and webapp servers will bind to this address and the port specified in
      yarn.resourcemanager.address and yarn.resourcemanager.webapp.address, respectively. This
      is most useful for making RM listen to all interfaces by setting to 0.0.0.0.
    description>
    <name>yarn.resourcemanager.bind-hostname>
    <value>value>
  property>

  <property>
    <description>The number of threads used to handle applications manager requests.description>
    <name>yarn.resourcemanager.client.thread-countname>
    <value>50value>
  property>

  <property>
    <description>The expiry interval for application master reporting.description>
    <name>yarn.am.liveness-monitor.expiry-interval-msname>
    <value>600000value>
  property>

  <property>
    <description>The Kerberos principal for the resource manager.description>
    <name>yarn.resourcemanager.principalname>
  property>

  <property>
    <description>The address of the scheduler interface.description>
    <name>yarn.resourcemanager.scheduler.addressname>
    <value>yarn01-sh:8030value>
  property>

  <property>
    <description>Number of threads to handle scheduler interface.description>
    <name>yarn.resourcemanager.scheduler.client.thread-countname>
    <value>50value>
  property>

  <property>
      <description>
        This configures the HTTP endpoint for Yarn Daemons.The following
        values are supported:
        - HTTP_ONLY : Service is provided only on http
        - HTTPS_ONLY : Service is provided only on https
      description>
      <name>yarn.http.policyname>
      <value>HTTP_ONLYvalue>
  property>

  <property>
    <description>The http address of the RM web application.description>
    <name>yarn.resourcemanager.webapp.addressname>
    <value>yarn01-sh:8088value>
  property>

  <property>
    <description>The https adddress of the RM web application.description>
    <name>yarn.resourcemanager.webapp.https.addressname>
    <value>yarn01-sh:8088value>
  property>

  <property>
    <name>yarn.resourcemanager.resource-tracker.addressname>
    <value>yarn01-sh:8031value>
  property>

  <property>
    <description>Are acls enabled.description>
    <name>yarn.acl.enablename>
    <value>falsevalue>
  property>

  <property>
    <description>ACL of who can be admin of the YARN cluster.description>
    <name>yarn.admin.aclname>
    <value>*value>
  property>

  <property>
    <description>The address of the RM admin interface.description>
    <name>yarn.resourcemanager.admin.addressname>
    <value>value>
  property>

  <property>
    <description>Number of threads used to handle RM admin interface.description>
    <name>yarn.resourcemanager.admin.client.thread-countname>
    <value>1value>
  property>

  <property>
    <description>Maximum time to wait to establish connection to
    ResourceManager.description>
    <name>yarn.resourcemanager.connect.max-wait.msname>
    <value>900000value>
  property>

  <property>
    <description>How often to try connecting to the
    ResourceManager.description>
    <name>yarn.resourcemanager.connect.retry-interval.msname>
    <value>30000value>
  property>

  <property>
    <description>The maximum number of application attempts. It's a global
    setting for all application masters. Each application master can specify
    its individual maximum number of application attempts via the API, but the
    individual number cannot be more than the global upper bound. If it is,
    the resourcemanager will override it. The default number is set to 2, to
    allow at least one retry for AM.description>
    <name>yarn.resourcemanager.am.max-attemptsname>
    <value>2value>
  property>

  <property>
    <description>How often to check that containers are still alive. description>
    <name>yarn.resourcemanager.container.liveness-monitor.interval-msname>
    <value>600000value>
  property>

  <property>
    <description>Flag to enable override of the default kerberos authentication
    filter with the RM authentication filter to allow authentication using
    delegation tokens(fallback to kerberos if the tokens are missing). Only
    applicable when the http authentication type is kerberos.description>
    <name>yarn.resourcemanager.webapp.delegation-token-auth-filter.enabledname>
    <value>falsevalue>
  property>

  <property>
    <description>How long to wait until a node manager is considered dead.description>
    <name>yarn.nm.liveness-monitor.expiry-interval-msname>
    <value>600000value>
  property>

  <property>
    <description>Path to file with nodes to include.description>
    <name>yarn.resourcemanager.nodes.include-pathname>
    <value>value>
  property>

  <property>
    <description>Path to file with nodes to exclude.description>
    <name>yarn.resourcemanager.nodes.exclude-pathname>
    <value>value>
  property>

  <property>
    <description>Number of threads to handle resource tracker calls.description>
    <name>yarn.resourcemanager.resource-tracker.client.thread-countname>
    <value>50value>
  property>

  <property>
    <description>The class to use as the resource scheduler.description>
    <name>yarn.resourcemanager.scheduler.classname>
    <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulervalue>
  property>

  <property>
    <description>The minimum allocation for every container request at the RM,
    in MBs. Memory requests lower than this won't take effect,
    and the specified value will get allocated at minimum.description>
    <name>yarn.scheduler.minimum-allocation-mbname>
    <value>1024value>
  property>

  <property>
    <description>The maximum allocation for every container request at the RM,
    in MBs. Memory requests higher than this won't take effect,
    and will get capped to this value.description>
    <name>yarn.scheduler.maximum-allocation-mbname>
    <value>2048value>
  property>

  <property>
    <description>The minimum allocation for every container request at the RM,
    in terms of virtual CPU cores. Requests lower than this won't take effect,
    and the specified value will get allocated the minimum.description>
    <name>yarn.scheduler.minimum-allocation-vcoresname>
    <value>1value>
  property>

  <property>
    <description>The maximum allocation for every container request at the RM,
    in terms of virtual CPU cores. Requests higher than this won't take effect,
    and will get capped to this value.description>
    <name>yarn.scheduler.maximum-allocation-vcoresname>
    <value>2value>
  property>

  <property>
    <description>Enable RM to recover state after starting. If true, then 
      yarn.resourcemanager.store.class must be specified. description>
    <name>yarn.resourcemanager.recovery.enabledname>
    <value>truevalue>
  property>

  <property>
    <description>Enable RM work preserving recovery. This configuration is private
    to YARN for experimenting the feature.
    description>
    <name>yarn.resourcemanager.work-preserving-recovery.enabledname>
    <value>falsevalue>
  property>

  <property>
    <description>Set the amount of time RM waits before allocating new
    containers on work-preserving-recovery. Such wait period gives RM a chance
    to settle down resyncing with NMs in the cluster on recovery, before assigning
    new containers to applications.
    description>
    <name>yarn.resourcemanager.work-preserving-recovery.scheduling-wait-msname>
    <value>10000value>
  property>

  <property>
    <description>The class to use as the persistent store.

      If org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore
      is used, the store is implicitly fenced; meaning a single ResourceManager
      is able to use the store at any point in time. More details on this
      implicit fencing, along with setting up appropriate ACLs is discussed
      under yarn.resourcemanager.zk-state-store.root-node.acl.
    description>
    <name>yarn.resourcemanager.store.classname>
    <value>org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStorevalue>
  property>

  <property>
    <description>The maximum number of completed applications RM state
    store keeps, less than or equals to ${yarn.resourcemanager.max-completed-applications}.
    By default, it equals to ${yarn.resourcemanager.max-completed-applications}.
    This ensures that the applications kept in the state store are consistent with
    the applications remembered in RM memory.
    Any values larger than ${yarn.resourcemanager.max-completed-applications} will
    be reset to ${yarn.resourcemanager.max-completed-applications}.
    Note that this value impacts the RM recovery performance.Typically,
    a smaller value indicates better performance on RM recovery.
    description>
    <name>yarn.resourcemanager.state-store.max-completed-applicationsname>
    <value>${yarn.resourcemanager.max-completed-applications}value>
  property>

  <property>
    <description>Host:Port of the ZooKeeper server to be used by the RM. This
      must be supplied when using the ZooKeeper based implementation of the
      RM state store and/or embedded automatic failover in a HA setting.
    description>
    <name>yarn.resourcemanager.zk-addressname>
     <value>dn1:2181,dn2:2181,dn3:2181value>
  property>

  <property>
    <description>Number of times RM tries to connect to ZooKeeper.description>
    <name>yarn.resourcemanager.zk-num-retriesname>
    <value>1000value>
  property>

  <property>
    <description>Retry interval in milliseconds when connecting to ZooKeeper.
      When HA is enabled, the value here is NOT used. It is generated
      automatically from yarn.resourcemanager.zk-timeout-ms and
      yarn.resourcemanager.zk-num-retries.
    description>
    <name>yarn.resourcemanager.zk-retry-interval-msname>
    <value>1000value>
  property>

  <property>
    <description>Full path of the ZooKeeper znode where RM state will be
    stored. This must be supplied when using
    org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore
    as the value for yarn.resourcemanager.store.classdescription>
    <name>yarn.resourcemanager.zk-state-store.parent-pathname>
    <value>/rmstorevalue>
  property>

  <property>
    <description>ZooKeeper session timeout in milliseconds. Session expiration
    is managed by the ZooKeeper cluster itself, not by the client. This value is
    used by the cluster to determine when the client's session expires.
    Expirations happens when the cluster does not hear from the client within
    the specified session timeout period (i.e. no heartbeat).description>
    <name>yarn.resourcemanager.zk-timeout-msname>
    <value>10000value>
  property>

  <property>
    <description>ACL's to be used for ZooKeeper znodes.description>
    <name>yarn.resourcemanager.zk-aclname>
    <value>world:anyone:rwcdavalue>
  property>

  <property>
    <description>
      ACLs to be used for the root znode when using ZKRMStateStore in a HA
      scenario for fencing.

      ZKRMStateStore supports implicit fencing to allow a single
      ResourceManager write-access to the store. For fencing, the
      ResourceManagers in the cluster share read-write-admin privileges on the
      root node, but the Active ResourceManager claims exclusive create-delete
      permissions.

      By default, when this property is not set, we use the ACLs from
      yarn.resourcemanager.zk-acl for shared admin access and
      rm-address:random-number for username-based exclusive create-delete
      access.

      This property allows users to set ACLs of their choice instead of using
      the default mechanism. For fencing to work, the ACLs should be
      carefully set differently on each ResourceManger such that all the
      ResourceManagers have shared admin access and the Active ResourceManger
      takes over (exclusively) the create-delete access.
    description>
    <name>yarn.resourcemanager.zk-state-store.root-node.aclname>
  property>

  <property>
    <description>
        Specify the auths to be used for the ACL's specified in both the
        yarn.resourcemanager.zk-acl and
        yarn.resourcemanager.zk-state-store.root-node.acl properties.  This
        takes a comma-separated list of authentication mechanisms, each of the
        form 'scheme:auth' (the same syntax used for the 'addAuth' command in
        the ZK CLI).
    description>
    <name>yarn.resourcemanager.zk-authname>
  property>

  <property>
    <description>URI pointing to the location of the FileSystem path where
    RM state will be stored. This must be supplied when using
    org.apache.hadoop.yarn.server.resourcemanager.recovery.FileSystemRMStateStore
    as the value for yarn.resourcemanager.store.classdescription>
    <name>yarn.resourcemanager.fs.state-store.uriname>
    <value>${hadoop.tmp.dir}/yarn/system/rmstorevalue>
    
  property>

  <property>
    <description>hdfs client retry policy specification. hdfs client retry
    is always enabled. Specified in pairs of sleep-time and number-of-retries
    and (t0, n0), (t1, n1), ..., the first n0 retries sleep t0 milliseconds on
    average, the following n1 retries sleep t1 milliseconds on average, and so on.
    description>
    <name>yarn.resourcemanager.fs.state-store.retry-policy-specname>
    <value>2000, 500value>
  property>

  <property>
    <description>Enable RM high-availability. When enabled,
      (1) The RM starts in the Standby mode by default, and transitions to
      the Active mode when prompted to.
      (2) The nodes in the RM ensemble are listed in
      yarn.resourcemanager.ha.rm-ids
      (3) The id of each RM either comes from yarn.resourcemanager.ha.id
      if yarn.resourcemanager.ha.id is explicitly specified or can be
      figured out by matching yarn.resourcemanager.address.{id} with local address
      (4) The actual physical addresses come from the configs of the pattern
      - {rpc-config}.{id}description>
    <name>yarn.resourcemanager.ha.enabledname>
    <value>truevalue>
  property>

  <property>
    <description>Enable automatic failover.
      By default, it is enabled only when HA is enableddescription>
    <name>yarn.resourcemanager.ha.automatic-failover.enabledname>
    <value>truevalue>
  property>

  <property>
    <description>Enable embedded automatic failover.
      By default, it is enabled only when HA is enabled.
      The embedded elector relies on the RM state store to handle fencing,
      and is primarily intended to be used in conjunction with ZKRMStateStore.
    description>
    <name>yarn.resourcemanager.ha.automatic-failover.embeddedname>
    <value>truevalue>
  property>

  <property>
    <description>The base znode path to use for storing leader information,
      when using ZooKeeper based leader election.description>
    <name>yarn.resourcemanager.ha.automatic-failover.zk-base-pathname>
    <value>/yarn-leader-electionvalue>
  property>

  <property>
    <description>Name of the cluster. In a HA setting,
      this is used to ensure the RM participates in leader
      election for this cluster and ensures it does not affect
      other clustersdescription>
    <name>yarn.resourcemanager.cluster-idname>
    <value>yarn01-shvalue>
  property>

  <property>
    <description>The list of RM nodes in the cluster when HA is
      enabled. See description of yarn.resourcemanager.ha
      .enabled for full details on how this is used.description>
    <name>yarn.resourcemanager.ha.rm-idsname>
    <value>hdp-rm01,hdp-rm02value>
  property>

  <property>
    <description>The id (string) of the current RM. When HA is enabled, this
      is an optional config. The id of current RM can be set by explicitly
      specifying yarn.resourcemanager.ha.id or figured out by matching
      yarn.resourcemanager.address.{id} with local address
      See description of yarn.resourcemanager.ha.enabled
      for full details on how this is used.description>
    <name>yarn.resourcemanager.ha.idname>
    
  property>

  <property>
    <description>When HA is enabled, the class to be used by Clients, AMs and
      NMs to failover to the Active RM. It should extend
      org.apache.hadoop.yarn.client.RMFailoverProxyProviderdescription>
    <name>yarn.client.failover-proxy-providername>
    <value>org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvidervalue>
  property>

  <property>
    <description>When HA is enabled, the max number of times
      FailoverProxyProvider should attempt failover. When set,
      this overrides the yarn.resourcemanager.connect.max-wait.ms. When
      not set, this is inferred from
      yarn.resourcemanager.connect.max-wait.ms.description>
    <name>yarn.client.failover-max-attemptsname>
    
  property>

  <property>
    <description>When HA is enabled, the sleep base (in milliseconds) to be
      used for calculating the exponential delay between failovers. When set,
      this overrides the yarn.resourcemanager.connect.* settings. When
      not set, yarn.resourcemanager.connect.retry-interval.ms is used instead.
    description>
    <name>yarn.client.failover-sleep-base-msname>
    
  property>

  <property>
    <description>When HA is enabled, the maximum sleep time (in milliseconds)
      between failovers. When set, this overrides the
      yarn.resourcemanager.connect.* settings. When not set,
      yarn.resourcemanager.connect.retry-interval.ms is used instead.description>
    <name>yarn.client.failover-sleep-max-msname>
    
  property>

  <property>
    <description>When HA is enabled, the number of retries per
      attempt to connect to a ResourceManager. In other words,
      it is the ipc.client.connect.max.retries to be used during
      failover attemptsdescription>
    <name>yarn.client.failover-retriesname>
    <value>0value>
  property>

  <property>
    <description>When HA is enabled, the number of retries per
      attempt to connect to a ResourceManager on socket timeouts. In other
      words, it is the ipc.client.connect.max.retries.on.timeouts to be used
      during failover attemptsdescription>
    <name>yarn.client.failover-retries-on-socket-timeoutsname>
    <value>60value>
  property>

  <property>
    <description>The maximum number of completed applications RM keeps. description>
    <name>yarn.resourcemanager.max-completed-applicationsname>
    <value>10000value>
  property>

  <property>
    <description>Interval at which the delayed token removal thread runsdescription>
    <name>yarn.resourcemanager.delayed.delegation-token.removal-interval-msname>
    <value>30000value>
  property>

  <property>
  <description>If true, ResourceManager will have proxy-user privileges.
    Use case: In a secure cluster, YARN requires the user hdfs delegation-tokens to
    do localization and log-aggregation on behalf of the user. If this is set to true,
    ResourceManager is able to request new hdfs delegation tokens on behalf of
    the user. This is needed by long-running-service, because the hdfs tokens
    will eventually expire and YARN requires new valid tokens to do localization
    and log-aggregation. Note that to enable this use case, the corresponding
    HDFS NameNode has to configure ResourceManager as the proxy-user so that
    ResourceManager can itself ask for new tokens on behalf of the user when
    tokens are past their max-life-time.description>
    <name>yarn.resourcemanager.proxy-user-privileges.enabledname>
    <value>falsevalue>
  property>

  <property>
    <description>Interval for the roll over for the master key used to generate
        application tokens
    description>
    <name>yarn.resourcemanager.am-rm-tokens.master-key-rolling-interval-secsname>
    <value>86400value>
  property>

  <property>
    <description>Interval for the roll over for the master key used to generate
        container tokens. It is expected to be much greater than
        yarn.nm.liveness-monitor.expiry-interval-ms and
        yarn.rm.container-allocation.expiry-interval-ms. Otherwise the
        behavior is undefined.
    description>
    <name>yarn.resourcemanager.container-tokens.master-key-rolling-interval-secsname>
    <value>86400value>
  property>

  <property>
    <description>The heart-beat interval in milliseconds for every NodeManager in the cluster.description>
    <name>yarn.resourcemanager.nodemanagers.heartbeat-interval-msname>
    <value>1000value>
  property>

  <property>
    <description>The minimum allowed version of a connecting nodemanager.  The valid values are
      NONE (no version checking), EqualToRM (the nodemanager's version is equal to
      or greater than the RM version), or a Version String.description>
    <name>yarn.resourcemanager.nodemanager.minimum.versionname>
    <value>NONEvalue>
  property>

  <property>
    <description>Enable a set of periodic monitors (specified in
        yarn.resourcemanager.scheduler.monitor.policies) that affect the
        scheduler.description>
    <name>yarn.resourcemanager.scheduler.monitor.enablename>
    <value>falsevalue>
  property>

  <property>
    <description>The list of SchedulingEditPolicy classes that interact with
        the scheduler. A particular module may be incompatible with the
        scheduler, other policies, or a configuration of either.description>
    <name>yarn.resourcemanager.scheduler.monitor.policiesname>
    <value>org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicyvalue>
  property>

  <property>
    <description>The class to use as the configuration provider.
    If org.apache.hadoop.yarn.LocalConfigurationProvider is used,
    the local configuration will be loaded.
    If org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider is used,
    the configuration which will be loaded should be uploaded to remote File system first.
    description>
    <name>yarn.resourcemanager.configuration.provider-classname>
    <value>org.apache.hadoop.yarn.LocalConfigurationProvidervalue>
    
  property>

  <property>
    <description>The setting that controls whether yarn system metrics is
    published on the timeline server or not by RM.description>
    <name>yarn.resourcemanager.system-metrics-publisher.enabledname>
    <value>falsevalue>
  property>

  <property>
    <description>Number of worker threads that send the yarn system metrics
    data.description>
    <name>yarn.resourcemanager.system-metrics-publisher.dispatcher.pool-sizename>
    <value>10value>
  property>

  
  <property>
    <description>The hostname of the NM.description>
    <name>yarn.nodemanager.hostnamename>
    <value>0.0.0.0value>
  property>
  
  <property>
    <description>The address of the container manager in the NM.description>
    <name>yarn.nodemanager.addressname>
    <value>${yarn.nodemanager.hostname}:0value>
  property>

  <property>
    <description>
      The actual address the server will bind to. If this optional address is
      set, the RPC and webapp servers will bind to this address and the port specified in
      yarn.nodemanager.address and yarn.nodemanager.webapp.address, respectively. This is
      most useful for making NM listen to all interfaces by setting to 0.0.0.0.
    description>
    <name>yarn.nodemanager.bind-hostname>
    <value>value>
  property>

  <property>
    <description>Environment variables that should be forwarded from the NodeManager's environment to the container's.description>
    <name>yarn.nodemanager.admin-envname>
    <value>MALLOC_ARENA_MAX=$MALLOC_ARENA_MAXvalue>
  property>

  <property>
    <description>Environment variables that containers may override rather than use NodeManager's default.description>
    <name>yarn.nodemanager.env-whitelistname>
    <value>JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CONF_DIR,HADOOP_YARN_HOMEvalue>
  property>

  <property>
    <description>who will execute(launch) the containers.description>
    <name>yarn.nodemanager.container-executor.classname>
    <value>org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutorvalue>

  property>

  <property>
    <description>Number of threads container manager uses.description>
    <name>yarn.nodemanager.container-manager.thread-countname>
    <value>20value>
  property>

  <property>
    <description>Number of threads used in cleanup.description>
    <name>yarn.nodemanager.delete.thread-countname>
    <value>4value>
  property>

  <property>
    <description>
      Number of seconds after an application finishes before the nodemanager's 
      DeletionService will delete the application's localized file directory
      and log directory.
      
      To diagnose Yarn application problems, set this property's value large
      enough (for example, to 600 = 10 minutes) to permit examination of these
      directories. After changing the property's value, you must restart the 
      nodemanager in order for it to have an effect.

      The roots of Yarn applications' work directories is configurable with
      the yarn.nodemanager.local-dirs property (see below), and the roots
      of the Yarn applications' log directories is configurable with the 
      yarn.nodemanager.log-dirs property (see also below).
    description>
    <name>yarn.nodemanager.delete.debug-delay-secname>
    <value>0value>
  property>

  <property>
    <description>List of directories to store localized files in. An 
      application's localized file directory will be found in:
      ${yarn.nodemanager.local-dirs}/usercache/${user}/appcache/application_${appid}.
      Individual containers' work directories, called container_${contid}, will
      be subdirectories of this.
   description>
    <name>yarn.nodemanager.local-dirsname>
    <value>/data/soft/new/dfs/nm-local-dirvalue>
  property>

  <property>
    <description>It limits the maximum number of files which will be localized
      in a single local directory. If the limit is reached then sub-directories
      will be created and new files will be localized in them. If it is set to
      a value less than or equal to 36 [which are sub-directories (0-9 and then
      a-z)] then NodeManager will fail to start. For example; [for public
      cache] if this is configured with a value of 40 ( 4 files +
      36 sub-directories) and the local-dir is "/tmp/local-dir1" then it will
      allow 4 files to be created directly inside "/tmp/local-dir1/filecache".
      For files that are localized further it will create a sub-directory "0"
      inside "/tmp/local-dir1/filecache" and will localize files inside it
      until it becomes full. If a file is removed from a sub-directory that
      is marked full, then that sub-directory will be used back again to
      localize files.
   description>
    <name>yarn.nodemanager.local-cache.max-files-per-directoryname>
    <value>8192value>
  property>

  <property>
    <description>Address where the localizer IPC is.description>
    <name>yarn.nodemanager.localizer.addressname>
    <value>${yarn.nodemanager.hostname}:8040value>
  property>

  <property>
    <description>Interval in between cache cleanups.description>
    <name>yarn.nodemanager.localizer.cache.cleanup.interval-msname>
    <value>600000value>
  property>

  <property>
    <description>Target size of localizer cache in MB, per nodemanager. It is
      a target retention size that only includes resources with PUBLIC and 
      PRIVATE visibility and excludes resources with APPLICATION visibility
    description>
    <name>yarn.nodemanager.localizer.cache.target-size-mbname>
    <value>11010048value>
  property>

  <property>
    <description>Number of threads to handle localization requests.description>
    <name>yarn.nodemanager.localizer.client.thread-countname>
    <value>5value>
  property>

  <property>
    <description>Number of threads to use for localization fetching.description>
    <name>yarn.nodemanager.localizer.fetch.thread-countname>
    <value>4value>
  property>

  <property>
    <description>
      Where to store container logs. An application's localized log directory 
      will be found in ${yarn.nodemanager.log-dirs}/application_${appid}.
      Individual containers' log directories will be below this, in directories 
      named container_{$contid}. Each container directory will contain the files
      stderr, stdin, and syslog generated by that container.
    description>
    <name>yarn.nodemanager.log-dirsname>
    <value>/data/soft/new/dfs/userlogsvalue>
  property>

  <property>
    <description>Whether to enable log aggregation. Log aggregation collects
      each container's logs and moves these logs onto a file-system, for e.g.
      HDFS, after the application completes. Users can configure the
      "yarn.nodemanager.remote-app-log-dir" and
      "yarn.nodemanager.remote-app-log-dir-suffix" properties to determine
      where these logs are moved to. Users can access the logs via the
      Application Timeline Server.
    description>
    <name>yarn.log-aggregation-enablename>
    <value>truevalue>
  property>

  <property>
    <description>How long to keep aggregation logs before deleting them.  -1 disables. 
    Be careful set this too small and you will spam the name node.description>
    <name>yarn.log-aggregation.retain-secondsname>
    <value>-1value>
  property> 
  
  <property>
    <description>How long to wait between aggregated log retention checks.
    If set to 0 or a negative value then the value is computed as one-tenth
    of the aggregated log retention time. Be careful set this too small and
    you will spam the name node.description>
    <name>yarn.log-aggregation.retain-check-interval-secondsname>
    <value>-1value>
  property>

  <property>
    <description>Time in seconds to retain user logs. Only applicable if
    log aggregation is disabled
    description>
    <name>yarn.nodemanager.log.retain-secondsname>
    <value>10800value>
  property>

  <property>
    <description>Where to aggregate logs to.description>
    <name>yarn.nodemanager.remote-app-log-dirname>
    <value>/tmp/logsvalue>
  property>
  <property>
    <description>The remote log dir will be created at 
      {yarn.nodemanager.remote-app-log-dir}/${user}/{thisParam}
    description>
    <name>yarn.nodemanager.remote-app-log-dir-suffixname>
    <value>logsvalue>
  property>
 
  <property>
    <description>Amount of physical memory, in MB, that can be allocated 
    for containers.description>
    <name>yarn.nodemanager.resource.memory-mbname>
    <value>2048value>
  property>

  <property>
    <description>Whether physical memory limits will be enforced for
    containers.description>
    <name>yarn.nodemanager.pmem-check-enabledname>
    <value>truevalue>
  property>

  <property>
    <description>Whether virtual memory limits will be enforced for
    containers.description>
    <name>yarn.nodemanager.vmem-check-enabledname>
    <value>falsevalue>
  property>

  <property>
    <description>Ratio between virtual memory to physical memory when
    setting memory limits for containers. Container allocations are
    expressed in terms of physical memory, and virtual memory usage
    is allowed to exceed this allocation by this ratio.
    description>
    <name>yarn.nodemanager.vmem-pmem-rationame>
    <value>2.1value>
  property>
 
  <property>
    <description>Number of vcores that can be allocated
    for containers. This is used by the RM scheduler when allocating
    resources for containers. This is not used to limit the number of
    physical cores used by YARN containers.description>
    <name>yarn.nodemanager.resource.cpu-vcoresname>
    <value>2value>
  property>

  <property>
    <description>Percentage of CPU that can be allocated
    for containers. This setting allows users to limit the amount of
    CPU that YARN containers use. Currently functional only
    on Linux using cgroups. The default is to use 100% of CPU.
    description>
    <name>yarn.nodemanager.resource.percentage-physical-cpu-limitname>
    <value>100value>
  property>

  <property>
    <description>NM Webapp address.description>
    <name>yarn.nodemanager.webapp.addressname>
    <value>${yarn.nodemanager.hostname}:8042value>
  property>

  <property>
    <description>How often to monitor containers.description>
    <name>yarn.nodemanager.container-monitor.interval-msname>
    <value>3000value>
  property>

  <property>
    <description>Class that calculates containers current resource utilization.description>
    <name>yarn.nodemanager.container-monitor.resource-calculator.classname>
  property>

  <property>
    <description>Frequency of running node health script.description>
    <name>yarn.nodemanager.health-checker.interval-msname>
    <value>600000value>
  property>

  <property>
    <description>Script time out period.description>
    <name>yarn.nodemanager.health-checker.script.timeout-msname>
    <value>1200000value>
  property>

  <property>
    <description>The health check script to run.description>
    <name>yarn.nodemanager.health-checker.script.pathname>
    <value>value>
  property>

  <property>
    <description>The arguments to pass to the health check script.description>
    <name>yarn.nodemanager.health-checker.script.optsname>
    <value>value>
  property>

  <property>
    <description>Frequency of running disk health checker code.description>
    <name>yarn.nodemanager.disk-health-checker.interval-msname>
    <value>120000value>
  property>
  
  <property>
    <description>Frequency of running disk health checker code.description>
    <name>yarn.nodemanager.disk-health-checker.enablename>
    <value>falsevalue>
  property>


  <property>
    <description>The minimum fraction of number of disks to be healthy for the
    nodemanager to launch new containers. This correspond to both
    yarn-nodemanager.local-dirs and yarn.nodemanager.log-dirs. i.e. If there
    are less number of healthy local-dirs (or log-dirs) available, then
    new containers will not be launched on this node.description>
    <name>yarn.nodemanager.disk-health-checker.min-healthy-disksname>
    <value>0.25value>
  property>

  <property>
    <description>The maximum percentage of disk space utilization allowed after 
    which a disk is marked as bad. Values can range from 0.0 to 100.0. 
    If the value is greater than or equal to 100, the nodemanager will check 
    for full disk. This applies to yarn-nodemanager.local-dirs and 
    yarn.nodemanager.log-dirs.description>
    <name>yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentagename>
    <value>96.0value>
  property>

  <property>
    <description>The minimum space that must be available on a disk for
    it to be used. This applies to yarn-nodemanager.local-dirs and 
    yarn.nodemanager.log-dirs.description>
    <name>yarn.nodemanager.disk-health-checker.min-free-space-per-disk-mbname>
    <value>0value>
  property>

  <property>
    <description>The path to the Linux container executor.description>
    <name>yarn.nodemanager.linux-container-executor.pathname>
  property>

  <property>
    <description>The class which should help the LCE handle resources.description>
    <name>yarn.nodemanager.linux-container-executor.resources-handler.classname>
    <value>org.apache.hadoop.yarn.server.nodemanager.util.DefaultLCEResourcesHandlervalue>
    
  property>

  <property>
    <description>The cgroups hierarchy under which to place YARN proccesses (cannot contain commas).
    If yarn.nodemanager.linux-container-executor.cgroups.mount is false (that is, if cgroups have
    been pre-configured), then this cgroups hierarchy must already exist and be writable by the
    NodeManager user, otherwise the NodeManager may fail.
    Only used when the LCE resources handler is set to the CgroupsLCEResourcesHandler.description>
    <name>yarn.nodemanager.linux-container-executor.cgroups.hierarchyname>
    <value>/hadoop-yarnvalue>
  property>

  <property>
    <description>Whether the LCE should attempt to mount cgroups if not found.
    Only used when the LCE resources handler is set to the CgroupsLCEResourcesHandler.description>
    <name>yarn.nodemanager.linux-container-executor.cgroups.mountname>
    <value>falsevalue>
  property>

  <property>
    <description>Where the LCE should attempt to mount cgroups if not found. Common locations
    include /sys/fs/cgroup and /cgroup; the default location can vary depending on the Linux
    distribution in use. This path must exist before the NodeManager is launched.
    Only used when the LCE resources handler is set to the CgroupsLCEResourcesHandler, and
    yarn.nodemanager.linux-container-executor.cgroups.mount is true.description>
    <name>yarn.nodemanager.linux-container-executor.cgroups.mount-pathname>
  property>

  <property>
    <description>This determines which of the two modes that LCE should use on a non-secure
    cluster.  If this value is set to true, then all containers will be launched as the user 
    specified in yarn.nodemanager.linux-container-executor.nonsecure-mode.local-user.  If 
    this value is set to false, then containers will run as the user who submitted the 
    application.
    description>
    <name>yarn.nodemanager.linux-container-executor.nonsecure-mode.limit-usersname>
    <value>truevalue>
  property>

  <property>
    <description>The UNIX user that containers will run as when Linux-container-executor
    is used in nonsecure mode (a use case for this is using cgroups) if the
    yarn.nodemanager.linux-container-executor.nonsecure-mode.limit-users is set 
    to true.description>
    <name>yarn.nodemanager.linux-container-executor.nonsecure-mode.local-username>
    <value>nobodyvalue>
  property>

  <property>
    <description>The allowed pattern for UNIX user names enforced by
    Linux-container-executor when used in nonsecure mode (use case for this
    is using cgroups). The default value is taken from /usr/sbin/adduserdescription>
    <name>yarn.nodemanager.linux-container-executor.nonsecure-mode.user-patternname>
    <value>^[_.A-Za-z0-9][-@_.A-Za-z0-9]{0,255}?[$]?$value>
  property>

  <property>
    <description>This flag determines whether apps should run with strict resource limits
    or be allowed to consume spare resources if they need them. For example, turning the
    flag on will restrict apps to use only their share of CPU, even if the node has spare
    CPU cycles. The default value is false i.e. use available resources. Please note that
    turning this flag on may reduce job throughput on the cluster.description>
    <name>yarn.nodemanager.linux-container-executor.cgroups.strict-resource-usagename>
    <value>falsevalue>
  property>

  <property>
    <description>T-file compression types used to compress aggregated logs.description>
    <name>yarn.nodemanager.log-aggregation.compression-typename>
    <value>nonevalue>
  property>

  <property>
    <description>The kerberos principal for the node manager.description>
    <name>yarn.nodemanager.principalname>
    <value>value>
  property>

  <property>
    <description>the valid service name should only contain a-zA-Z0-9_ and can not start with numbersdescription>
    <name>yarn.nodemanager.aux-servicesname>
    
    <value>mapreduce_shufflevalue>
  property>
  
  <property>
    <name>yarn.nodemanager.aux-services.spark_shuffle.classname>
    <value>org.apache.spark.network.yarn.YarnShuffleServicevalue>
  property>

  <property>
    <description>No. of ms to wait between sending a SIGTERM and SIGKILL to a containerdescription>
    <name>yarn.nodemanager.sleep-delay-before-sigkill.msname>
    <value>250value>
  property>

  <property>
    <description>Max time to wait for a process to come up when trying to cleanup a containerdescription>
    <name>yarn.nodemanager.process-kill-wait.msname>
    <value>2000value>
  property>

  <property>
    <description>The minimum allowed version of a resourcemanager that a nodemanager will connect to.  
      The valid values are NONE (no version checking), EqualToNM (the resourcemanager's version is 
      equal to or greater than the NM version), or a Version String.description>
    <name>yarn.nodemanager.resourcemanager.minimum.versionname>
    <value>NONEvalue>
  property>

  <property>
    <description>Max number of threads in NMClientAsync to process container
    management eventsdescription>
    <name>yarn.client.nodemanager-client-async.thread-pool-max-sizename>
    <value>500value>
  property>

  <property>
    <description>Max time to wait to establish a connection to NMdescription>
    <name>yarn.client.nodemanager-connect.max-wait-msname>
    <value>900000value>
  property>

  <property>
    <description>Time interval between each attempt to connect to NMdescription>
    <name>yarn.client.nodemanager-connect.retry-interval-msname>
    <value>10000value>
  property>

  <property>
    <description>
      Maximum number of proxy connections to cache for node managers. If set
      to a value greater than zero then the cache is enabled and the NMClient
      and MRAppMaster will cache the specified number of node manager proxies.
      There will be at max one proxy per node manager. Ex. configuring it to a
      value of 5 will make sure that client will at max have 5 proxies cached
      with 5 different node managers. These connections for these proxies will
      be timed out if idle for more than the system wide idle timeout period.
      Note that this could cause issues on large clusters as many connections
      could linger simultaneously and lead to a large number of connection
      threads. The token used for authentication will be used only at
      connection creation time. If a new token is received then the earlier
      connection should be closed in order to use the new token. This and
      (yarn.client.nodemanager-client-async.thread-pool-max-size) are related
      and should be in sync (no need for them to be equal).
      If the value of this property is zero then the connection cache is
      disabled and connections will use a zero idle timeout to prevent too
      many connection threads on large clusters.
    description>
    <name>yarn.client.max-cached-nodemanagers-proxiesname>
    <value>0value>
  property>
  
  <property>
    <description>Enable the node manager to recover after startingdescription>
    <name>yarn.nodemanager.recovery.enabledname>
    <value>falsevalue>
  property>

  <property>
    <description>The local filesystem directory in which the node manager will
    store state when recovery is enabled.description>
    <name>yarn.nodemanager.recovery.dirname>
    <value>${hadoop.tmp.dir}/yarn-nm-recoveryvalue>
  property>

  
  <property>
    <name>yarn.nodemanager.aux-services.mapreduce_shuffle.classname>
    <value>org.apache.hadoop.mapred.ShuffleHandlervalue>
  property>

  <property>
    <name>mapreduce.job.jarname>
    <value/>
  property>

  <property>
    <name>mapreduce.job.hdfs-serversname>
    <value>${fs.defaultFS}value>
  property>

  
  
  <property>
    <description>The kerberos principal for the proxy, if the proxy is not
    running as part of the RM.description>
    <name>yarn.web-proxy.principalname>
    <value/>
  property>
  
  <property>
    <description>Keytab for WebAppProxy, if the proxy is not running as part of 
    the RM.description>
    <name>yarn.web-proxy.keytabname>
  property>
  
  <property>
    <description>The address for the web proxy as HOST:PORT, if this is not
     given then the proxy will run as part of the RMdescription>
     <name>yarn.web-proxy.addressname>
     <value>nna:8090value>
  property>

  
  
  <property>
    <description>
      CLASSPATH for YARN applications. A comma-separated list
      of CLASSPATH entries. When this value is empty, the following default
      CLASSPATH for YARN applications would be used. 
      For Linux:
      $HADOOP_CONF_DIR,
      $HADOOP_COMMON_HOME/share/hadoop/common/*,
      $HADOOP_COMMON_HOME/share/hadoop/common/lib/*,
      $HADOOP_HDFS_HOME/share/hadoop/hdfs/*,
      $HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*,
      $HADOOP_YARN_HOME/share/hadoop/yarn/*,
      $HADOOP_YARN_HOME/share/hadoop/yarn/lib/*
      For Windows:
      %HADOOP_CONF_DIR%,
      %HADOOP_COMMON_HOME%/share/hadoop/common/*,
      %HADOOP_COMMON_HOME%/share/hadoop/common/lib/*,
      %HADOOP_HDFS_HOME%/share/hadoop/hdfs/*,
      %HADOOP_HDFS_HOME%/share/hadoop/hdfs/lib/*,
      %HADOOP_YARN_HOME%/share/hadoop/yarn/*,
      %HADOOP_YARN_HOME%/share/hadoop/yarn/lib/*
    description>
    <name>yarn.application.classpathname>
    <value>/data/soft/new/hadoop-config,/data/soft/new/hadoop/share/hadoop/common/*,/data/soft/new/hadoop/share/hadoop/common/lib/*,/data/soft/new/hadoop/share/hadoop/hdfs/*,/data/soft/new/hadoop/share/hadoop/hdfs/lib/*,/data/soft/new/hadoop/share/hadoop/yarn/*,/data/soft/new/hadoop/share/hadoop/yarn/lib/*,/data/soft/new/hadoop/share/hadoop/mapreduce/*,/data/soft/new/hadoop/share/hadoop/mapreduce/lib/*value>
  property>

  

  <property>
    <description>Indicate to clients whether timeline service is enabled or not.
    If enabled, clients will put entities and events to the timeline server.
    description>
    <name>yarn.timeline-service.enabledname>
    <value>falsevalue>
  property>

  <property>
    <description>The hostname of the timeline service web application.description>
    <name>yarn.timeline-service.hostnamename>
    <value>0.0.0.0value>
  property>

  <property>
    <description>This is default address for the timeline server to start the
    RPC server.description>
    <name>yarn.timeline-service.addressname>
    <value>${yarn.timeline-service.hostname}:10200value>
  property>

  <property>
    <description>The http address of the timeline service web application.description>
    <name>yarn.timeline-service.webapp.addressname>
    <value>${yarn.timeline-service.hostname}:8188value>
  property>

  <property>
    <description>The https address of the timeline service web application.description>
    <name>yarn.timeline-service.webapp.https.addressname>
    <value>${yarn.timeline-service.hostname}:8190value>
  property>

  <property>
    <description>
      The actual address the server will bind to. If this optional address is
      set, the RPC and webapp servers will bind to this address and the port specified in
      yarn.timeline-service.address and yarn.timeline-service.webapp.address, respectively.
      This is most useful for making the service listen to all interfaces by setting to
      0.0.0.0.
    description>
    <name>yarn.timeline-service.bind-hostname>
    <value>value>
  property>

  <property>
    <description>Store class name for timeline store.description>
    <name>yarn.timeline-service.store-classname>
    <value>org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStorevalue>
  property>

  <property>
    <description>Enable age off of timeline store data.description>
    <name>yarn.timeline-service.ttl-enablename>
    <value>truevalue>
  property>

  <property>
    <description>Time to live for timeline store data in milliseconds.description>
    <name>yarn.timeline-service.ttl-msname>
    <value>604800000value>
  property>

  <property>
    <description>Store file name for leveldb timeline store.description>
    <name>yarn.timeline-service.leveldb-timeline-store.pathname>
    <value>${hadoop.tmp.dir}/yarn/timelinevalue>
  property>

  <property>
    <description>Length of time to wait between deletion cycles of leveldb timeline store in milliseconds.description>
    <name>yarn.timeline-service.leveldb-timeline-store.ttl-interval-msname>
    <value>300000value>
  property>

  <property>
    <description>Size of read cache for uncompressed blocks for leveldb timeline store in bytes.description>
    <name>yarn.timeline-service.leveldb-timeline-store.read-cache-sizename>
    <value>104857600value>
  property>

  <property>
    <description>Size of cache for recently read entity start times for leveldb timeline store in number of entities.description>
    <name>yarn.timeline-service.leveldb-timeline-store.start-time-read-cache-sizename>
    <value>10000value>
  property>

  <property>
    <description>Size of cache for recently written entity start times for leveldb timeline store in number of entities.description>
    <name>yarn.timeline-service.leveldb-timeline-store.start-time-write-cache-sizename>
    <value>10000value>
  property>

  <property>
    <description>Handler thread count to serve the client RPC requests.description>
    <name>yarn.timeline-service.handler-thread-countname>
    <value>40value>
  property>

  <property>
    <name>yarn.timeline-service.http-authentication.typename>
    <value>simplevalue>
    <description>
      Defines authentication used for the timeline server HTTP endpoint.
      Supported values are: simple | kerberos | #AUTHENTICATION_HANDLER_CLASSNAME#
    description>
  property>

  <property>
    <name>yarn.timeline-service.http-authentication.simple.anonymous.allowedname>
    <value>truevalue>
    <description>
      Indicates if anonymous requests are allowed by the timeline server when using
      'simple' authentication.
    description>
  property>

  <property>
    <description>The Kerberos principal for the timeline server.description>
    <name>yarn.timeline-service.principalname>
    <value>value>
  property>

  <property>
    <description>
    Default maximum number of retires for timeline servive client.
    description>
    <name>yarn.timeline-service.client.max-retriesname>
    <value>30value>
  property>

  <property>
    <description>
    Default retry time interval for timeline servive client.
    description>
    <name>yarn.timeline-service.client.retry-interval-msname>
    <value>1000value>
  property>

  
  <property>
    <description>The interval that the yarn client library uses to poll the
    completion status of the asynchronous API of application client protocol.
    description>
    <name>yarn.client.application-client-protocol.poll-interval-msname>
    <value>200value>
  property>

  <property>
    <description>RSS usage of a process computed via 
    /proc/pid/stat is not very accurate as it includes shared pages of a
    process. /proc/pid/smaps provides useful information like
    Private_Dirty, Private_Clean, Shared_Dirty, Shared_Clean which can be used
    for computing more accurate RSS. When this flag is enabled, RSS is computed
    as Min(Shared_Dirty, Pss) + Private_Clean + Private_Dirty. It excludes
    read-only shared mappings in RSS computation.  
    description>
    <name>yarn.nodemanager.container-monitor.procfs-tree.smaps-based-rss.enabledname>
    <value>falsevalue>
  property>

  

  <property>
    <description>
      Is the registry enabled: does the RM start it up,
      create the user and system paths, and purge
      service records when containers, application attempts
      and applications complete
    description>
    <name>hadoop.registry.rm.enabledname>
    <value>falsevalue>
  property>

  <property>
    <description>
    description>
    <name>hadoop.registry.zk.rootname>
    <value>/registryvalue>
  property>

  <property>
    <description>
      Zookeeper session timeout in milliseconds
    description>
    <name>hadoop.registry.zk.session.timeout.msname>
    <value>60000value>
  property>

  <property>
    <description>
      Zookeeper session timeout in milliseconds
    description>
    <name>hadoop.registry.zk.connection.timeout.msname>
    <value>15000value>
  property>

  <property>
    <description>
      Zookeeper connection retry count before failing
    description>
    <name>hadoop.registry.zk.retry.timesname>
    <value>5value>
  property>

  <property>
    <description>
    description>
    <name>hadoop.registry.zk.retry.interval.msname>
    <value>1000value>
  property>

  <property>
    <description>
      Zookeeper retry limit in milliseconds, during
      exponential backoff: {@value}

      This places a limit even
      if the retry times and interval limit, combined
      with the backoff policy, result in a long retry
      period
    description>
    <name>hadoop.registry.zk.retry.ceiling.msname>
    <value>60000value>
  property>

  <property>
    <description>
      List of hostname:port pairs defining the
      zookeeper quorum binding for the registry
    description>
    <name>hadoop.registry.zk.quorumname>
    <value>dn1:2181,dn2:2181,dn3:2181value>
  property>

  <property>
    <description>
      Key to set if the registry is secure. Turning it on
      changes the permissions policy from "open access"
      to restrictions on kerberos with the option of
      a user adding one or more auth key pairs down their
      own tree.
    description>
    <name>hadoop.registry.securename>
    <value>falsevalue>
  property>

  <property>
    <description>
      A comma separated list of Zookeeper ACL identifiers with
      system access to the registry in a secure cluster.

      These are given full access to all entries.

      If there is an "@" at the end of a SASL entry it
      instructs the registry client to append the default kerberos domain.
    description>
    <name>hadoop.registry.system.aclsname>
    <value>sasl:yarn@, sasl:mapred@, sasl:mapred@hdfs@value>
  property>

  <property>
    <description>
      The kerberos realm: used to set the realm of
      system principals which do not declare their realm,
      and any other accounts that need the value.

      If empty, the default realm of the running process
      is used.

      If neither are known and the realm is needed, then the registry
      service/client will fail.
    description>
    <name>hadoop.registry.kerberos.realmname>
    <value>value>
  property>

  <property>
    <description>
      Key to define the JAAS context. Used in secure
      mode
    description>
    <name>hadoop.registry.jaas.contextname>
    <value>Clientvalue>
  property>

  <property>
    <description>Defines how often NMs wake up to upload log files.
    The default value is -1. By default, the logs will be uploaded when
    the application is finished. By setting this configure, logs can be uploaded
    periodically when the application is running. The minimum rolling-interval-seconds
    can be set is 3600.
    description>
    <name>yarn.nodemanager.log-aggregation.roll-monitoring-interval-secondsname>
    <value>-1value>
  property>


<property>
        <name>yarn.scheduler.fair.allocation.filename>
        <value>/data/soft/new/hadoop-config/fair-scheduler.xmlvalue>
property>

<property>
        <name>yarn.scheduler.increment-allocation-mbname>
        <value>256value>
property>

<property>
        <name>yarn.scheduler.fair.preemptionname>
        <value>truevalue>
property>

<property>
        <name>yarn.scheduler.fair.allow-undeclared-poolsname>
        <value>falsevalue>
property>
<property>
        <name>yarn.scheduler.fair.user-al-default-queuename>
        <value>falsevalue>
property>
configuration>
View Code

5.fair-scheduler.xml

xml version="1.0"?>
<allocations>
    <queue name="root">
        <aclSubmitApps>hadoopaclSubmitApps>
        <aclAdministerApps>hadoopaclAdministerApps>
        
        <queue name="default">
            <maxRunningApps>10maxRunningApps>
            <minResources>1024mb,1vcoresminResources>
            <maxResources>6144mb,6vcoresmaxResources>
            <schedulingPolicy>fairschedulingPolicy>
            <weight>1.0weight>
            <aclSubmitApps>hadoopaclSubmitApps>
            <aclAdministerApps>hadoopaclAdministerApps>
        queue>
        
        <queue name="queue_1024_01">
            <maxRunningApps>10maxRunningApps>
            <minResources>1024mb,1vcoresminResources>
            <maxResources>4096mb,3vcoresmaxResources>
            <schedulingPolicy>fairschedulingPolicy>
            <weight>1.0weight>
            <aclSubmitApps>hadoopaclSubmitApps>
            <aclAdministerApps>hadoopaclAdministerApps>
        queue>
    queue>
    
    <fairSharePreemptionTimeout>600000fairSharePreemptionTimeout>
    <defaultMinSharePreemptionTimeout>600000defaultMinSharePreemptionTimeout>
allocations>

这里需要注意是,在Hadoop2中存储DataNode节点地址的是slaves文件,在Hadoop3中替换为workers文件了。

3.启动Hadoop3

首次启动Hadoop3时,需要注册ZK和格式化NameNode,具体操作如下:

# 1.启动JournalNode进程(QJM使用)
hadoop-daemon.sh start journalnode

# 2.注册ZK
hdfs zkfc -formatZK

# 3.格式化NameNode
hdfs namenode -format

# 4.启动NameNode
hadoop-daemon.sh start namenode

# 5.在Standby节点同步元数据
hdfs namenode -bootstrapStandby

# 6.启动HDFS和YARN
start-dfs.sh
start-yarn.sh

# 7.启动historyserver(在Hadoop3中proxyserver已集成到YARN的启动脚本中了)
mr-jobhistory-daemon.sh  start historyserver

4.提交测试用例

在$HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.2.0.jar中,提供了示例程序,验证WordCount算法,操作如下:

# 1.准备数据源
vi /tmp/wc

a a
c s

# 2.上传到HDFS
hdfs dfs -put /tmp/wc /tmp

# 3.提交WordCount任务
hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.2.0.jar wordcount /tmp/wc /tmp/res

# 4.查看统计结果
hdfs dfs -cat /tmp/res/part-r-00000

5.预览

5.1 HDFS页面结果

Hadoop3.2.0使用详解_第1张图片

5.2 YARN页面结果

Hadoop3.2.0使用详解_第2张图片

5.3 队列页面结果

Hadoop3.2.0使用详解_第3张图片

 

6.总结

在编译Hadoop-3.2.0源代码的时候,需要注意Maven远程仓库地址的配置,通常会由于Maven远程仓库地址不可用,导致依赖JAR下载失败,从而无法正常编译。在Maven的settings.xml文件中配置可用的Maven远程地址即可。

7.结束语

这篇博客就和大家分享到这里,如果大家在研究学习的过程当中有什么问题,可以加群进行讨论或发送邮件给我,我会尽我所能为您解答,与君共勉!

另外,博主出书了《Kafka并不难学》和《Hadoop大数据挖掘从入门到进阶实战》,喜欢的朋友或同学, 可以在公告栏那里点击购买链接购买博主的书进行学习,在此感谢大家的支持。关注下面公众号,根据提示,可免费获取书籍的教学视频。

你可能感兴趣的:(Hadoop3.2.0使用详解)