Hadoop基础教程-第5章 YARN:资源调度平台(5.3 YARN集群配置)(草稿)

第5章 YARN:资源调度平台

5.3 YARN集群配置

5.3.1 简单配置

(1) yarn-site.xml



<configuration>
    <property>
        <name>yarn.resourcemanager.hostnamename>
        <value>node1value>
        <description>ResourceManager所在的节点/description>
    property>
    <property>
        <name>yarn.nodemanager.aux-servicesname>
        <value>mapreduce_shufflevalue>
        <description>排序服务description>
    property>
configuration>

(2) mapred-site.xml



configuration>
    <property>
         <name>mapreduce.framework.namename>
         <value>yarnvalue>
         <description>启用yarn作为资源管理框架description>
    property>
configuration>

(3) slave

node1
node2
node3

这个文件在《3.4 HDFS集群模式》http://blog.csdn.net/chengyuqiang/article/details/72058013中已经配置过了,这里不再重复配置。
需要注意:这个文件是指定子节点的位置,同时也是帮助Yarn指定NodeManager启动的位置。即如果HDFS没有指定slaves的话,将没有DataNode;如果Yarn没有指定slaves的话,将没有NodeManager。

5.3.2 优化配置

YARN参数调优

(1) yarn-site.xml



<configuration>
    <property>
        <name>yarn.resourcemanager.scheduler.classname>
        <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulervalue>
    property>
    <property>
        <name>yarn.nodemanager.aux-servicesname>
        <value>mapreduce_shufflevalue>
        <description>排序服务description>
    property>
    <property>
        <name>yarn.resourcemanager.addressname>
        <value>node1:8032value>
        <description>客户端提交任务的ResourceManager的URI/description>
    property>
    <property>
        <name>yarn.nodemanager.resource.cpu-vcoresname>
        <value>10value>
    property>
    <property>
        <name>yarn.nodemanager.local-dirsname>
        <value>/hadoop/yarn/localvalue>
    property>
    <property>
        <name>yarn.application.classpathname>
        <value>$HADOOP_CONF_DIR,$HADOOP_COMMON_HOME/*,$HADOOP_COMMON_HOME/lib/*,$HADOOP_HDFS_HOME/*,$HADOOP_HDFS_HOME/lib/*,$HADOOP_MAPRED_HOME/*,$HADOOP_MAPRED_HOME/lib/*,$YARN_HOME/*,$YARN_HOME/lib/*value>
    property>
    <property>
        <name>yarn.nodemanager.pmem-check-enabledname>
        <value>falsevalue>
    property>
    <property>
        <name>yarn.resourcemanager.admin.addressname>
        <value>node1:8033value>
        <description>管理命令的URIdescription>
    property>
    <property>
        <name>yarn.nodemanager.remote-app-log-dirname>
        <value>/yarn1/var/log/hadoop-yarn/appsvalue>
    property>
    <property>
        <name>yarn.resourcemanager.resource-tracker.addressname>
        <value>node1:8031value>
    property>
    <property>
        <name>yarn.scheduler.maximum-allocation-mbname>
        <value>27648value>
    property>
    <property>
        <name>yarn.nodemanager.vmem-check-enabledname>
        <value>falsevalue>
    property>
    <property>
        <name>yarn.resourcemanager.webapp.addressname>
        <value>node1:8088value>
        <description>ResourceManager的web服务URIdescription>
    property>
    <property>
        <name>yarn.nodemanager.resource.memory-mbname>
        <value>27640value>
    property>
    <property>
        <name>yarn.nodemanager.aux-services.mapreduce_shuffle.classname>
        <value>org.apache.hadoop.mapred.ShuffleHandlervalue>
    property>
    <property>
        <name>yarn.log-aggregation-enablename>
        <value>truevalue>
    property>
    <property>
        <name>yarn.scheduler.maximum-allocation-vcoresname>
        <value>96value>
    property>
    <property>
        <name>yarn.resourcemanager.scheduler.addressname>
        <value>node1:8030value>
    property>
    <property>
        <name>yarn.scheduler.minimum-allocation-mbname>
        <value>9216value>
    property>
    <property>
        <name>yarn.nodemanager.log-dirsname>
        <value>/hadoop/yarn/logsvalue>
    property>
configuration>

(2) mapred-site.xml


<configuration>
  <property>
      <name>mapreduce.map.memory.mbname>
      <value>2048value>
      <description>map的最大可使用内存description>
  property>
  <property>
    <name>mapreduce.map.java.optsname>
    <value>-Xmx1228mvalue>
    <description>map的堆内存description>
  property>
  <property>
    <name>mapreduce.reduce.memory.mbname>
    <value>3072value>
    <description>reduce的最大可使用内存description>
  property>
  <property>
    <name>mapreduce.reduce.java.optsname>
    <value>-Xmx2457mvalue>
    <description>reduce堆内存description>
  property>

  <property>
    <name>yarn.app.mapreduce.am.command-optsname>
    <value>-Xmx2457mvalue>
    <description>mapreduce的参数description>
  property>
  <property>
    <name>mapreduce.task.io.sort.mbname>
    <value>614value>
    <description>数据排序时的内存大小description>
  property>
  <property>
    <name>mapreduce.framework.namename>
    <value>yarnvalue>
    <description>启用yarn作为资源管理框架description>
  property>
configuration>

(3) slave
同上。

你可能感兴趣的:(Hadoop基础教程,Hadoop基础教程)