Linux Control Groups(cgroups):在操作系统级别进行资源分配,可通过Cloudera Static Service Pools配置。
YARN调度器配置:对运行在YARN上的应用进行资源配置,比如M/R,implala。可通过Cloudera 动态资源池进行配置。
以下资源可以通过cgroups配置进行限制:
Memory Hard Limit
– If a process exceeds this limit, the kernel swaps out some of the process’s memory; if it cannot do so, the process will be killed
Memory Soft Limit
– When memory contenFon exists on the host, the OS targets the process to not exceed this limit
CPU Shares
– When CPU contenFon exists on the host, processes with higher CPU shares will be given more CPU time
I/O Weight
– Specify the proportion of I/O access available to the read requests performed by a process
通过YARN进行资源配置:
YARN scheduler决定何时何处给应用分配Containers,Containers被赋予memory,CPU等资源。
YARN支持的scheduler类型:
1.FIFO Scheduler:先进先出调度器,基于时间顺序分配资源。
2.Capacity Scheduler:资源分配到资源池,各资源池中采用FIFO分配资源。
3.Fair Scheduler(default,recommend):公平调度器。资源分配到带有权重的资源池。各资源池之间按权重分配资源。
YARN调度器属性配置:yarn.resourcemanager.scheduler.class。
YARN Container资源分配:
mapreduce.map.memory.mb :Map task内存分配,CM default 1G。
Calculate the resources needed for other processes:
– Reserve 3GB or 20% of total memory for the OS
– Reserve resources for any non-Hadoop applicaFons
– Reserve resources for other any Hadoop components
– HDFS caching (if configured), NodeManager, DataNode
– Impalad, HBase RegionServer, Solr, etc.
Configure the YARN scheduler and application framework settings
– Based on the worker node profile determined above
– Determine the number of containers needed to best support YARN applicaFons based on the type of workload
– Monitor usage and tune estimated values to find optimal settings