YARN:资源调度平台
YARN参数解读与调优
yarn-site.xml文件默认参数:
http://hadoop.apache.org/docs/r2.7.3/hadoop-yarn/hadoop-yarn-common/yarn-default.xml
参数 | 默认值 | 说明 |
yarn.resourcemanager.address | ${yarn.resourcemanager.hostname}:8032 | ResourceManager 对客户端暴露的地址 |
yarn.resourcemanager.scheduler.address | ${yarn.resourcemanager.hostname}:8030 | ResourceManager 对ApplicationMaster暴露的访问地址2 |
yarn.resourcemanager.resource-tracker.address | ${yarn.resourcemanager.hostname}:8031 | ResourceManager 对NodeManager暴露的地址 |
yarn.resourcemanager.admin.address | ${yarn.resourcemanager.hostname}:8033 | ResourceManager 对管理员暴露的访问地址 |
yarn.resourcemanager.webapp.address | ${yarn.resourcemanager.hostname}:8088 | ResourceManager对外WebUI地址 |
yarn.resourcemanager.scheduler.class | capacity.CapacityScheduler | 启用的资源调度器主类,目前可用的有FIFO、Capacity Scheduler和Fair Scheduler |
yarn.resourcemanager.resource-tracker.client.thread-count | 50 | 处理来自NodeManager的RPC请求的Handler数目 |
yarn.resourcemanager.scheduler.client.thread-count | 50 | 处理来自ApplicationMaster的RPC请求的Handler数目 |
yarn.scheduler.minimum-allocation-mb | 1024 | 单个可申请的最小内存资源量 |
yarn.scheduler.maximum-allocation-mb | 8192 | 单个可申请的最大内存资源量 |
yarn.scheduler.minimum-allocation-vcores | 1 | 单个可申请的最小虚拟CPU个数 |
yarn.scheduler.maximum-allocation-vcores | 32 | 单个可申请的最大虚拟CPU个数 |
yarn.resourcemanager.nodemanagers.heartbeat-interval-ms | 1000(毫秒) | NodeManager心跳间隔 |
capacity.CapacityScheduler的完整名称: org.apache.Hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler
NodeManager相关配置参数
mapred-site.xml
参数调优
参照
http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.0/index.html
单击“Command Line Installation”超链接后的PDF图标,即可打开HDP安装文档。
单击“1.10. Determining HDP Memory Configuration Settings”条目,跳转到对应页面
单击“Download Companion Files”连接,可以看到两条命令
wget http://public-repo-1.hortonworks.com/HDP/tools/2.6.0.3/ hdp_manual_install_rpm_helper_files-2.6.0.3.8.tar.gz tar zxvf hdp_manual_install_rpm_helper_files-2.6.0.3.8.tar.gz
[root@node1 ~]# wget http://public-repo-1.hortonworks.com/HDP/tools/2.6.0.3/hdp_manual_install_rpm_helper_files-2.6.0.3.8.tar.gz--2018-11-26 22:11:09-- http://public-repo-1.hortonworks.com/HDP/tools/2.6.0.3/hdp_manual_install_rpm_helper_files-2.6.0.3.8.tar.gz Resolving public-repo-1.hortonworks.com (public-repo-1.hortonworks.com)... 13.33.231.53, 13.33.231.93, 13.33.231.120, ... Connecting to public-repo-1.hortonworks.com (public-repo-1.hortonworks.com)|13.33.231.53|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 85173 (83K) [application/x-tar] Saving to: ‘hdp_manual_install_rpm_helper_files-2.6.0.3.8.tar.gz’ 100%[======================================================================================>] 85,173 313KB/s in 0.3s 2018-11-26 22:11:10 (313 KB/s) - ‘hdp_manual_install_rpm_helper_files-2.6.0.3.8.tar.gz’ saved [85173/85173] [root@node1 ~]#
[root@node1 ~]# tar -zxvf hdp_manual_install_rpm_helper_files-2.6.0.3.8.tar.gz hdp_manual_install_rpm_helper_files-2.6.0.3.8/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hive/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hive/hive-log4j.properties.template hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hive/hive-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hive/hive-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hive/hive-exec-log4j.properties.template hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/objects/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/objects/nagios.cfg-centos hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/objects/hadoop-hosts.cfg hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/objects/hadoop-commands.cfg hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/objects/hadoop-hostgroups.cfg hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/objects/hadoop-servicegroups.cfg hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/objects/hadoop-services.cfg hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/objects/nagios.cfg-suse hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_resourcemanager_nodes_percentage.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_name_dir_status.php hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_datanode_storage.php hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_mapred_local_dir_used.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_aggregate.php hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_hdfs_blocks.php hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_rpcq_latency.php hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_webui.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_oozie_status.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_webhcat_status.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_hdfs_capacity.php hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_cpu.pl hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_hive_metastore_status.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/nagios/plugins/check_nodemanager_health.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/hadoop-metrics2.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/capacity-scheduler.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/hadoop-policy.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/hadoop-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/core-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/yarn-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/mapred-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/container-executor.cfg hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/yarn-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/health_check hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/mapred-queue-acls.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/commons-logging.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/hadoop-metrics2.properties-GANGLIA hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/log4j.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/core_hadoop/hdfs-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/sqoop/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/sqoop/sqoop-site-template.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/sqoop/sqoop-env-template.cmd hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/sqoop/sqoop-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/sqoop/sqoop-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/sqoop/sqoop-env-template.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/scripts/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/scripts/hdp-gmetad hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/scripts/hdp-gmond hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/checkGmetad.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/startRrdcached.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/checkGmond.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/gmond.init hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/rrdcachedLib.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/gmetad.init hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/startGmond.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/gangliaEnv.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/startGmetad.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/rrd.py hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/gmondLib.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/setupGanglia.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/gangliaClusters.conf hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/stopGmetad.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/teardownGanglia.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/gangliaLib.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/stopGmond.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/stopRrdcached.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/checkRrdcached.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/ganglia/objects/gmetadLib.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/zookeeper/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/zookeeper/zookeeper-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/zookeeper/configuration.xsl hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/zookeeper/log4j.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/zookeeper/zoo.cfg hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/pig/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/pig/pig-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/pig/pig.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/pig/log4j.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/oozie/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/oozie/oozie-log4j.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/oozie/oozie-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/oozie/oozie-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/oozie/adminusers.txt hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/oozie/hadoop-config.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/oozie/oozie-default.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/hbase-policy.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/regionservers hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/hadoop-metrics.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/hbase-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/hadoop-metrics.properties.master-GANGLIA hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/hadoop-metrics.properties.regionservers-GANGLIA hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/hbase-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/hbase/log4j.properties hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/webhcat/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/webhcat/webhcat-env.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/configuration_files/webhcat/webhcat-site.xml hdp_manual_install_rpm_helper_files-2.6.0.3.8/scripts/ hdp_manual_install_rpm_helper_files-2.6.0.3.8/scripts/directories.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/scripts/yarn-utils.py hdp_manual_install_rpm_helper_files-2.6.0.3.8/scripts/usersAndGroups.sh hdp_manual_install_rpm_helper_files-2.6.0.3.8/readme.txt hdp_manual_install_rpm_helper_files-2.6.0.3.8/HDP-CHANGES.txt
如果节点有4核8G内存1块硬盘,该节点同时安装HBase,通过下面命令即可获得优化参数
[root@nb0 scripts]# python yarn-utils.py -c 4 -m 8 -d 1 -k True
Using cores=4 memory=8GB disks=1 hbase=True
Profile: cores=4 memory=5120MB reserved=3GB usableMem=5GB disks=1
Num Container=3
Container Ram=1536MB
Used Ram=4GB
Unused Ram=3GB
yarn.scheduler.minimum-allocation-mb=1536
yarn.scheduler.maximum-allocation-mb=4608
yarn.nodemanager.resource.memory-mb=4608
mapreduce.map.memory.mb=1536
mapreduce.map.java.opts=-Xmx1228m
mapreduce.reduce.memory.mb=3072
mapreduce.reduce.java.opts=-Xmx2457m
yarn.app.mapreduce.am.resource.mb=3072
yarn.app.mapreduce.am.command-opts=-Xmx2457m
mapreduce.task.io.sort.mb=614
选项说明
选项 | 描述 |
---|---|
-c | 每一个客户机的核数目 |
-m | 每一个客户机拥有的内存总数 |
-d | 每一个客户机拥有的磁盘数目 |
-k | 如果Hbase安装了为”True”,否则为”False” |