{"id":1232,"date":"2016-10-08T12:35:08","date_gmt":"2016-10-08T20:35:08","guid":{"rendered":"http:\/\/www.developerscloset.com\/?page_id=1232"},"modified":"2019-10-10T08:08:21","modified_gmt":"2019-10-10T16:08:21","slug":"yarn","status":"publish","type":"page","link":"https:\/\/www.developerscloset.com\/?page_id=1232","title":{"rendered":"Yarn"},"content":{"rendered":"<p><a href=\"http:\/\/www.developerscloset.com\/wp-content\/uploads\/2018\/06\/yarn.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1233 alignnone\" src=\"http:\/\/www.developerscloset.com\/wp-content\/uploads\/2018\/06\/yarn.png\" alt=\"\" width=\"250\" height=\"194\" \/><\/a><\/p>\n<p>YARN allows multiple access engines to use Hadoop as the common standard for batch, interactive and real-time engines that can simultaneously access the same data set. Many applications are available to YARN, like MapReduce for batch processing, Storm for real-time stream processing, or Spark for in-memory iterative processing.<\/p>\n<p>YARN comes bundled with MapReduce 2.0 (MRv2). MapReduce has undergone a complete overhaul in MRv2. The fundamental idea of MRv2&#8217;s YARN architecture is to split up the two primary responsibilities of the JobTracker \u2014 resource management and job scheduling\/monitoring \u2014 into separate daemons: a global ResourceManager (RM) and per-application ApplicationMasters (AM). With MRv2, the ResourceManager (RM) and per-node NodeManagers (NM), form the data-computation framework. The ResourceManager service effectively replaces the functions of the JobTracker, and NodeManagers run on slave nodes instead of TaskTracker daemons. The per-application ApplicationMaster is, in effect, a framework specific library and is tasked with negotiating resources from the ResourceManager and working with the NodeManager(s) to execute and monitor the tasks.<\/p>\n<h1 id=\"Yarn-ConfigureYARN\">Configure YARN<\/h1>\n<h2 id=\"Yarn-InstallYARN\">Install YARN<\/h2>\n<p>Yarn requires the following services:<\/p>\n<ul>\n<li><strong>ResourceManager<\/strong>\u00a0is the master that arbitrates all the available cluster resources and thus helps manage the distributed applications running on the YARN system. It works together with the per-node NodeManagers (NMs) and the per-application ApplicationMasters (AMs). This service should be run on a node that is not running YARN NodeManagers, HDFS NameNodes,\u00a0or HBase Masters. As an exception if you are short on nodes, running a Yarn ResourceManager on\u00a0a node running an\u00a0HDFS NameNode is fine. But keep it off the HBase Master if possible.<\/li>\n<li><strong>JobHistory Server<\/strong>\u00a0\u2013 stores the history of jobs \u2013 can be recreated if destroyed, no history is required to run Yarn. The JobHistory Server should run on the\u00a0<u>same node<\/u>\u00a0as the YARN\u00a0ResourceManager.<\/li>\n<li><strong>NodeManager<\/strong>(s) take instructions from the ResourceManager and manage resources available on a single node. Try to separate YARN NodeManager(s) from the HBase RegionServers, too much Java heap memory is required.\u00a0Try not to install\u00a0a YARN NodeManager on a node with Oozie, too much Java heap memory is required. Try not to run NodeManagers on the same node as RecourceManagers.<\/li>\n<li><strong>Gateway<\/strong>\u00a0&#8211; The Gateway (CDH distribution of YARN) stores YARN network configurations. Install a Gateway onto all APP servers.<\/li>\n<\/ul>\n<h2 id=\"Yarn-YARNResourceConfiguration\">YARN Resource Configuration<\/h2>\n<p>Configure\u00a0YARN with the following settings:<\/p>\n<div class=\"table-wrap\">\n<table class=\"wrapped confluenceTable\">\n<colgroup>\n<col \/>\n<col \/>\n<col \/>\n<col \/>\n<col \/>\n<col \/>\n<col \/>\n<col \/><\/colgroup>\n<tbody>\n<tr>\n<td class=\"confluenceTd\"><strong>Configuration<\/strong><\/td>\n<td class=\"confluenceTd\"><strong>Description<\/strong><\/td>\n<td class=\"confluenceTd\"><strong>Small\u00a0(8 GB Memory,\u00a02 CPUs)<\/strong><\/td>\n<td class=\"confluenceTd\"><strong>Medium (16 GB Memory,\u00a04 CPUs)<\/strong><\/td>\n<td class=\"confluenceTd\"><strong>Large (28 GB Memory,\u00a04 CPUs)<\/strong><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><strong>Very Large (56 GB Memory, 8 CPUs)<\/strong><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><strong>Extreme (128 GB Memory, 8 CPUs)<\/strong><\/td>\n<td class=\"confluenceTd\"><strong>Calculation<\/strong><\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><strong>NodeManager Local Directories<\/strong><\/p>\n<p>yarn.nodemanager.local-dirs<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">List of directories on the local filesystem where a NodeManager stores intermediate data files.<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/nm<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/nm, \/space2\/yarn\/nm<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/nm, \/space2\/yarn\/nm<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/nm, \/space2\/yarn\/nm<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/nm, \/space2\/yarn\/nm<\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><strong>NodeManager Container Log Directories<\/strong><\/p>\n<p>yarn.nodemanager.log-dirs<\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/container-logs<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/container-logs,<br \/>\n\/space2\/yarn\/container-logs<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/container-logs,<br \/>\n\/space2\/yarn\/container-logs<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/container-logs,<br \/>\n\/space2\/yarn\/container-logs<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">\/space1\/yarn\/container-logs,<br \/>\n\/space2\/yarn\/container-logs<\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\">yarn.app.mapreduce.am.resource.mb<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Physical memory for the ApplicationMaster<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1 GB<\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>3\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>3\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">= 2 * RAM-per-Container<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">ApplicationMaster Java Maximum Heap Size<\/td>\n<td class=\"confluenceTd\">The maximum heap size, in bytes, of the Java MapReduce\u00a0ApplicationMaster. This number will be formatted and concatenated with &#8216;ApplicationMaster Java Opts Base&#8217; to pass to Hadoop.<\/td>\n<td class=\"confluenceTd\">825955249 B<\/p>\n<p>&nbsp;<\/td>\n<td class=\"confluenceTd\"><u>1.5 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>1.5 GB<\/u><\/p>\n<p>&nbsp;<\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">75% of container space.\u00a0In YARN a\u00a0container is the space in memory and CPU where your job will run.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">Java Heap Size of NodeManager in Bytes<\/td>\n<td class=\"confluenceTd\">Maximum size for the Java Process heap memory. Passed to Java -Xmx.<\/td>\n<td class=\"confluenceTd\"><u>1 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>1 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>1 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">Run NodeManagers with 1 GB memory while yarn.scheduler.maximum-allocation-mb &lt; 16 GB.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">Java Heap Size of ResourceManager in Bytes<\/td>\n<td class=\"confluenceTd\">Maximum size for the Java Process heap memory. Passed to Java -Xmx.\u00a0Measured in bytes.<\/td>\n<td class=\"confluenceTd\"><u>1 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>1.5 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>1.5 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>3\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>3\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">75% of container space or larger. Not constrained to the size of the container.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">Dump Heap When Out of Memory<\/td>\n<td class=\"confluenceTd\">When set, generates heap dump file (in \/tmp) when\u00a0java.lang.OutOfMemoryError is thrown.<\/td>\n<td class=\"confluenceTd\">False<\/td>\n<td class=\"confluenceTd\">False<\/td>\n<td class=\"confluenceTd\">False<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">False<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">False<\/td>\n<td class=\"confluenceTd\">Not required.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">yarn.nodemanager.resource.memory-mb<\/td>\n<td class=\"confluenceTd\">Amount of physical memory that can be allocated for all containers\u00a0on a node.<\/td>\n<td class=\"confluenceTd\"><u>6 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>6\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>14 GB<\/u><\/p>\n<p><s><u>12 GB<\/u><\/s><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>30 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>64 GB<\/u><\/td>\n<td class=\"confluenceTd\">= Containers * RAM-per-Container<\/p>\n<p>To determine how much memory will be allowed across the entire Yarn cluster:<\/p>\n<p>this * number-of-nodes<\/p>\n<p>Details: The amount of memory allotted to a NodeManager for spawning containers should be the difference between a node\u2019s physical RAM minus all non-YARN memory demand, such as what is needed for the OS. So\u00a0<samp class=\"ph codeph\">yarn.nodemanager.resource.memory-mb<\/samp>\u00a0= total memory on the node &#8211; (sum of all memory allocations to other processes such as OS, DataNode, NodeManager, RegionServer etc.).<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">yarn.scheduler.minimum-allocation-mb<\/td>\n<td class=\"confluenceTd\">The smallest amount of physical memory, in MiB, that can be requested\u00a0for a container.<\/td>\n<td class=\"confluenceTd\">1 GB<\/td>\n<td class=\"confluenceTd\"><u>2 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>2 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>1\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>1\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">= RAM-per-Container<\/p>\n<p>To determine how many containers will be used\u00a0<u>per node<\/u>:<\/p>\n<p>yarn.nodemanager.resource.memory-mb\/yarn.scheduler.minimum-allocation-mb<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\"><strong>Container Memory Maximum<\/strong><\/p>\n<p>yarn.scheduler.maximum-allocation-mb<\/td>\n<td class=\"confluenceTd\">The largest amount of physical memory, in MB, that can be requested for a container.<\/td>\n<td class=\"confluenceTd\"><u>4 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>4\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>8 GB<\/u><\/p>\n<p><s><u>12 GB<\/u><\/s><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>8\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>8\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">= containers * RAM-per-Container<\/p>\n<p>The maximum allocation for a single container on a node, for every container request at the RM. To determine maximum memory for an entire cluster, add\u00a0memory for all containers together.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">yarn.scheduler.increment-allocation-mb<\/td>\n<td class=\"confluenceTd\">If using the Fair Scheduler, memory requests will be rounded up\u00a0to the nearest multiple of this number.<\/td>\n<td class=\"confluenceTd\">512 MB<\/td>\n<td class=\"confluenceTd\">512 MB<\/td>\n<td class=\"confluenceTd\">512 MB<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">512 MB<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">512 MB<\/td>\n<td class=\"confluenceTd\">If using the Fair Scheduler, memory requests will be rounded up to the nearest multiple of this number.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">yarn.app.mapreduce.am.command-opts<\/td>\n<td class=\"confluenceTd\">Java command line arguments passed to the MapReduce \u00a0 ApplicationMaster.<\/td>\n<td class=\"confluenceTd\">&#8220;-Djava.net.preferIPv4Stack=true&#8221;<\/td>\n<td class=\"confluenceTd\">&#8220;-Djava.net.preferIPv4Stack=true&#8221;<\/td>\n<td class=\"confluenceTd\">&#8220;-Djava.net.preferIPv4Stack=true&#8221;<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">&#8220;-Djava.net.preferIPv4Stack=true&#8221;<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">&#8220;-Djava.net.preferIPv4Stack=true&#8221;<\/td>\n<td class=\"confluenceTd\">= 0.8 * 2 * RAM-per-Container<\/p>\n<p>Not required.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">yarn.nodemanager.container-manager.thread-count<\/td>\n<td class=\"confluenceTd\">Number of threads container manager uses.<\/td>\n<td class=\"confluenceTd\"><u>4<\/u><\/td>\n<td class=\"confluenceTd\">20<\/td>\n<td class=\"confluenceTd\">20<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">20<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">20<\/td>\n<td class=\"confluenceTd\">Number of threads container manager uses.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">yarn.resourcemanager.resource-tracker.client.thread-count<\/td>\n<td class=\"confluenceTd\">Number of threads to handle resource tracker calls.<\/td>\n<td class=\"confluenceTd\"><u>4<\/u><\/td>\n<td class=\"confluenceTd\"><u>20<\/u><\/td>\n<td class=\"confluenceTd\">50<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">50<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">50<\/td>\n<td class=\"confluenceTd\">Number of threads to handle resource tracker calls.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">yarn.nodemanager.resource.cpu-vcores<\/td>\n<td class=\"confluenceTd\">Number of virtual CPU cores that can be allocated for containers.<\/td>\n<td class=\"confluenceTd\"><u>4<\/u><\/td>\n<td class=\"confluenceTd\"><u>4<\/u><\/td>\n<td class=\"confluenceTd\"><u>4<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>6<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>6<\/u><\/td>\n<td class=\"confluenceTd\">= number of virtual cores used by all containers<\/p>\n<p>this * number_of_nodes = total number of cores for the cluster<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\">yarn.scheduler.maximum-allocation-vcores<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">The largest number of virtual CPU cores that can be requested for a\u00a0container.<\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">this * yarn.nodemanager.resource.cpu-vcores = total number of containers\u00a0that can run on the node<\/p>\n<p><em>Note: this setting must be greater than or equal to the number asked for by the client.<\/em><\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\">yarn.scheduler.minimum-allocation-vcores<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">The smallest number of virtual CPU cores that can be requested for a container<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">The smallest number of virtual CPU cores that can be requested for a container. If using the Capacity or FIFO scheduler (or any scheduler, prior to CDH 5), virtual core requests will be rounded up to the nearest multiple of this number.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.map.memory.mb<\/td>\n<td class=\"confluenceTd\">The amount of physical memory, in MiB, allocated for each map task of\u00a0a job.<\/td>\n<td class=\"confluenceTd\">1 GB<\/td>\n<td class=\"confluenceTd\"><u>2 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>3 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>3 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>4\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">Max map memory, should be more than the yarn.scheduler.minimum-allocation-mb<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.reduce.memory.mb<\/td>\n<td class=\"confluenceTd\">The amount of physical memory, in MiB, allocated for each reduce task\u00a0of a job.<\/td>\n<td class=\"confluenceTd\">1 GB<\/td>\n<td class=\"confluenceTd\"><u>2 GB<\/u><\/td>\n<td class=\"confluenceTd\"><u>3 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>3 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>4\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">Max reduce memory, should be more than the yarn.scheduler.minimum-allocation-mb<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.map.cpu.vcores<\/td>\n<td class=\"confluenceTd\">The number of virtual CPU cores allocated for each map task of a job.<\/td>\n<td class=\"confluenceTd\">1<\/td>\n<td class=\"confluenceTd\">1<\/td>\n<td class=\"confluenceTd\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\">Number of virtual cores for a\u00a0MapReduce Map job\u00a0&#8211; should be &lt; yarn.nodemanager.resource.cpu-vcores<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.reduce.cpu.vcores<\/td>\n<td class=\"confluenceTd\">The number of virtual CPU cores allocated for each reduce task of a \u00a0 job.<\/td>\n<td class=\"confluenceTd\">1<\/td>\n<td class=\"confluenceTd\">1<\/td>\n<td class=\"confluenceTd\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">1<\/td>\n<td class=\"confluenceTd\">Number of virtual cores for a\u00a0MapReduce\u00a0Reduce job\u00a0&#8211; should be &lt; yarn.nodemanager.resource.cpu-vcores<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\"><strong>Map Task Maximum Heap Size<\/strong><\/p>\n<p>mapreduce.map.java.opts.max.heap<\/td>\n<td class=\"confluenceTd\">The maximum Java heap size, in bytes, of the map processes. This \u00a0 number will be formatted and concatenated with &#8216;Map Task Java Opts Base&#8217; to \u00a0 pass to Hadoop.<\/td>\n<td class=\"confluenceTd\">825955249 B<\/td>\n<td class=\"confluenceTd\"><u>1.5 GB<\/u><\/p>\n<p>&nbsp;<\/td>\n<td class=\"confluenceTd\"><u>2.5 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2.5 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>3\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">= 0.75 * RAM-per-Container<\/p>\n<p>Should be less than the mapreduce.map.memory.mb<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\"><strong>Reduce Task Maximum Heap Size<\/strong><\/p>\n<p>mapreduce.reduce.java.opts.max.heap<\/td>\n<td class=\"confluenceTd\">The maximum Java heap size, in bytes, of the reduce processes. This \u00a0 number will be formatted and concatenated with &#8216;Reduce Task Java Opts Base&#8217; \u00a0 to pass to Hadoop.<\/td>\n<td class=\"confluenceTd\">825955249 B<\/td>\n<td class=\"confluenceTd\"><u>1.5 GB<\/u><\/p>\n<p>&nbsp;<\/td>\n<td class=\"confluenceTd\"><u>2.5 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>2.5 GB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>3\u00a0GB<\/u><\/td>\n<td class=\"confluenceTd\">= 0.75 * RAM-per-Container<\/p>\n<p>should be less than the mapreduce.reduce.memory.mb<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.task.io.sort.factor<\/td>\n<td class=\"confluenceTd\">The number of streams to merge at the same time while sorting files\u00a0on the reducer side. This determines the number of open file handles. Merging\u00a0more files in parallel reduces merge sort iterations and improves run time by\u00a0eliminating disk I\/O.<\/p>\n<p><em>Summary: More streams merged at\u00a0once while sorting files.<\/em><\/td>\n<td class=\"confluenceTd\"><u>4<\/u><\/td>\n<td class=\"confluenceTd\"><u>5<\/u><\/td>\n<td class=\"confluenceTd\"><u>10<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>20<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>20<\/u><\/td>\n<td class=\"confluenceTd\">Note that merging more files in parallel uses more memory. If\u00a0&#8216;io.sort.factor&#8217; is set too high or the maximum JVM heap is set too low,\u00a0excessive garbage collection will occur. The Hadoop default is 10, but Cloudera recommends a higher value.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.task.io.sort.mb<\/td>\n<td class=\"confluenceTd\">Sort memory buffer &#8211; comes out of the JVM.<\/td>\n<td class=\"confluenceTd\">256 MB<\/td>\n<td class=\"confluenceTd\"><u>512 MB<\/u><\/td>\n<td class=\"confluenceTd\"><u>512 MB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>512 MB<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>768 MB<\/u><\/td>\n<td class=\"confluenceTd\">JVM heap &#8211; this = total usable heap space<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.job.reduces<\/td>\n<td class=\"confluenceTd\">The default number of reduce tasks per job.<\/td>\n<td class=\"confluenceTd\"><u>1<\/u><\/td>\n<td class=\"confluenceTd\"><u>6<\/u><\/td>\n<td class=\"confluenceTd\"><u>6<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>9<\/u><\/td>\n<td class=\"confluenceTd\" colspan=\"1\"><u>9<\/u><\/td>\n<td class=\"confluenceTd\">Typically set to 99% of the cluster&#8217;s reduce capacity, so that if a\u00a0node fails the reduces can still be executed in a single wave. Ignored when mapreduce.jobtracker.address is &#8220;local&#8221;.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.reduce.shuffle.parallelcopies<\/td>\n<td class=\"confluenceTd\">The default number of parallel transfers run by reduce during the\u00a0copy (shuffle) phase.<\/td>\n<td class=\"confluenceTd\"><u>4<\/u><\/td>\n<td class=\"confluenceTd\">10<\/td>\n<td class=\"confluenceTd\">10<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">10<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">10<\/td>\n<td class=\"confluenceTd\">This number should be between sqrt(nodes*number_of_map_slots_per_node)\u00a0and nodes*number_of_map_slots_per_node\/2<\/p>\n<p><em>Note: Setting this value too\u00a0high will increase CPU, memory &amp; network usage. And it could lead to more\u00a0disk spills and slow down your job.<\/em><\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\">mapreduce.client.submit.file.replication<\/td>\n<td class=\"confluenceTd\">The replication level for submitted job files.<\/td>\n<td class=\"confluenceTd\">10<\/td>\n<td class=\"confluenceTd\">10<\/td>\n<td class=\"confluenceTd\">10<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">10<\/td>\n<td class=\"confluenceTd\" colspan=\"1\">10<\/td>\n<td class=\"confluenceTd\"><em>*Should be less than or equal to the number of DataNodes.<\/em><\/p>\n<p>When a\u00a0jar\u00a0is passed using the -libjars option,\u00a0it\u00a0is physically copied to the libs\/ directory of the task working directory. This file\u00a0is replicated mapreduce.client.submit.file.replication number of times because the file has to be distributed to all the required nodes.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 id=\"Yarn-NodeCapacities\">Node Capacities<\/h2>\n<p>YARN uses yarn.nodemanager.resource.memory-mb and yarn.nodemanager.resource.cpu-vcores, which control the amount of memory and CPU on each node, both are available to jobs, for example maps and reduces. Set these configurations to the amount of memory and number of cores on the machine after subtracting out resources needed for other services. YARN\u2019s resource configuration is a careful balance between the size of the jobs and the throughput of the node. Jobs are encased in containers built with Java heap + application memory + CPU. A container contains memory + CPU.<\/p>\n<h2 id=\"Yarn-VirtualCores\">Virtual Cores<\/h2>\n<p>To better handle varying CPU requests, YARN supports virtual cores (vcores), a resource meant to express parallelism. The \u201cvirtual\u201d in the name is somewhat misleading &#8211; on the NodeManager, vcores should be configured equal to the number of physical cores on the machine. Tasks should be requested with vcores equal to the number of cores they can saturate at once. Currently vcores are very coarse &#8211; tasks will rarely want to ask for more than one of them, but a complementary axis that represents processing power may be added in the future to enable finer-grained resource configuration. Tasks that will use multiple threads can request more than 1 core with the mapreduce.map.cpu.vcores and mapreduce.reduce.cpu.vcores properties.<\/p>\n<h2 id=\"Yarn-RoundingRequestSizes\">Rounding Request Sizes<\/h2>\n<p>Also noteworthy are the yarn.scheduler.minimum-allocation-mb, yarn.scheduler.minimum-allocation-vcores, yarn.scheduler.increment-allocation-mb, and yarn.scheduler.increment-allocation-vcores properties, which default to 1024, 1, 512, and 1 respectively. If tasks are submitted with resource requests lower than the minimum-allocation values, their requests will be set to these values. If tasks are submitted with resource requests that are not multiples of the increment-allocation values, their requests will be rounded up to the nearest increments.<\/p>\n<h2 id=\"Yarn-ConfigureYARNforMapReduce\">Configure YARN for MapReduce<\/h2>\n<p>With YARN (as opposed to MRv1) memory seems to be the most difficult resource to adjust. However, MapReduce on a node with limited resources can be adjusted in such a way as to allow the Map and Reduce tasks to complete successfully while using as little memory as possible. MapReduce configurations are contained in the following parameters:<\/p>\n<p>mapreduce.reduce.shuffle.parallelcopies<\/p>\n<p>mapreduce.task.io.sort.factor<\/p>\n<p>mapreduce.map.memory.mb<\/p>\n<p>mapreduce.reduce.memory.mb<\/p>\n<p>Java Heap Size of NodeManager in Bytes<\/p>\n<p>Java Heap Size of ResourceManager in Bytes<\/p>\n<p>The tmp files on the DataNode are non-existing and therefore all the merging and shuffling are happening in memory, you can increase the time delay before the reducer starts in order to limit the load on the DataNode.<\/p>\n<p>mapreduce.job.reduce.slowstart.completedmaps (0.7 would be sufficient)<\/p>\n<p>mapreduce.task.io.sort.mb<\/p>\n<p>Also, at Hadoop discussions groups, it is mentioned that default value of\u00a0 dfs.datanode.max.xcievers parameter, the upper bound for the number of files an HDFS DataNode can serve, is too low and causes ShuffleError. In HDFS, you can try to set this value to 2048.<\/p>\n<h3 id=\"Yarn-RunningSmallMapReduceJobswithUber\">Running Small MapReduce Jobs with Uber<\/h3>\n<p>Running small MapReduce jobs (on small datasets) is more efficient when you use Uber because you remove the additional time that MapReduce normally spends spinning up and bringing down map and reduce processes. Uber jobs are jobs that are executed within the MapReduce ApplicationMaster. Instead of using the ResourceManager to create the map and reduce containers, the ApplicationMaster runs the map and reduce tasks within its own process and avoids the overhead of launching and communicating with remote containers.<\/p>\n<p>To enable uber jobs, you need to set the following property:<\/p>\n<div>\n<blockquote><p>mapreduce.job.ubertask.enable=true<\/p><\/blockquote>\n<\/div>\n<h2 id=\"Yarn-ExampleConfiguration\">Example Configuration<\/h2>\n<p>To make all of this more concrete, let\u2019s use an example. Each node in the cluster has 24 GB of memory and 6 cores. Other services running on the nodes require 4 GB and 1 core, so we set yarn.nodemanager.resource.memory-mb to 20480 and yarn.nodemanager.resource.cpu-vcores to 5. If you leave the map and reduce task defaults of 1024 MB and 1 virtual core intact, you will have at most 5 tasks running at the same time. If you want each of your tasks to use 5 GB, set their mapreduce.(map|reduce).memory.mb to 5120, which would limit you to 4 tasks running at the same time. Further calculate the total number of containers by dividing the memory assigned to yarn.nodemanager.resource.memory-mb * the number of nodes divided by the memory used for a container. Repeat the calculation for CPU.<\/p>\n<p><em>Note: Running HortonWorks\u2019 Yarn Utility script against our R200 on 8\/25\/14 revealed the following resource requirement for Yarn<\/em><em>:<\/em><\/p>\n<p>\/tmp\/hdp_manual_install_rpm_helper_files-2.0.6.101\/scripts$ python yarn-utils.py -c 4 -m 8 -d 2 -k False<\/p>\n<p>Using cores=4 memory=8GB disks=2 hbase=False<\/p>\n<p>Profile: cores=4 memory=6144MB reserved=2GB usableMem=6GB disks=2<\/p>\n<p>Num Container=4<\/p>\n<p>Container Ram=1536MB<\/p>\n<p>Used Ram=6GB<\/p>\n<p>Unused Ram=2GB<\/p>\n<p>yarn.scheduler.minimum-allocation-mb=1536<\/p>\n<p>yarn.scheduler.maximum-allocation-mb=6144<\/p>\n<p>yarn.nodemanager.resource.memory-mb=6144<\/p>\n<p>mapreduce.map.memory.mb=1536<\/p>\n<p>mapreduce.map.java.opts=-Xmx1228m<\/p>\n<p>mapreduce.reduce.memory.mb=3072<\/p>\n<p>mapreduce.reduce.java.opts=-Xmx2457m<\/p>\n<p>yarn.app.mapreduce.am.resource.mb=3072<\/p>\n<p>yarn.app.mapreduce.am.command-opts=-Xmx2457m<\/p>\n<p>mapreduce.task.io.sort.mb=614<\/p>\n<p>Reference:\u00a0<a class=\"external-link\" href=\"https:\/\/www.linkedin.com\/pulse\/article\/20140706112523-176301000-yarn-resource-allocation\" rel=\"nofollow\">https:\/\/www.linkedin.com\/pulse\/article\/20140706112523-176301000-yarn-resource-allocation<\/a><\/p>\n<p>Some interesting performance tweaks for YARN:\u00a0<a class=\"external-link\" href=\"http:\/\/blog.cloudera.com\/blog\/2014\/04\/apache-hadoop-yarn-avoiding-6-time-consuming-gotchas\/\" rel=\"nofollow\">http:\/\/blog.cloudera.com\/blog\/2014\/04\/apache-hadoop-yarn-avoiding-6-time-consuming-gotchas\/<\/a><\/p>\n<p>Yarn Memory Calculations:\u00a0<a class=\"external-link\" href=\"http:\/\/docs.hortonworks.com\/HDPDocuments\/HDP2\/HDP-2.0.9.1\/bk_installing_manually_book\/content\/rpm-chap1-11.html\" rel=\"nofollow\">http:\/\/docs.hortonworks.com\/HDPDocuments\/HDP2\/HDP-2.0.9.1\/bk_installing_manually_book\/content\/rpm-chap1-11.html<\/a><\/p>\n<h1 id=\"Yarn-TestYarn\">Test Yarn<\/h1>\n<p>1.\u00a0Log onto a host in the cluster.<\/p>\n<p>2. Run the Linux find command in a single container:<\/p>\n<div>\n<blockquote><p>sudo -u hdfs hadoop org.apache.hadoop.yarn.applications.distributedshell.Client -debug -shell_command find -shell_args &#8216;`pwd`&#8217; -jar `sudo find \/opt\/cloudera\/parcels\/ -name *-distributedshell-*.jar|head -n1` -container_memory 150 -master_memory 150<\/p><\/blockquote>\n<p><em>or<\/em><\/p>\n<blockquote><p>sudo -u hdfs hadoop org.apache.hadoop.yarn.applications.distributedshell.Client -debug -shell_command find -shell_args &#8216;`pwd`&#8217; -jar\u00a0`sudo find \/opt\/cloudera\/parcels\/ -name *-distributedshell-*.jar|head -n1`\u00a0-container_memory 350 -master_memory 350<\/p><\/blockquote>\n<\/div>\n<p>3. Run the Hadoop MapReduce PiEstimator example using one of the following commands (for Parcel installation):<\/p>\n<div>\n<blockquote><p>sudo -u hdfs yarn jar \/opt\/cloudera\/parcels\/CDH\/lib\/hadoop-mapreduce\/hadoop-mapreduce-examples.jar pi 10 100<\/p><\/blockquote>\n<p><em>or<\/em><\/p>\n<blockquote><p>sudo -u hdfs yarn jar \/opt\/cloudera\/parcels\/CDH\/lib\/hadoop-mapreduce\/hadoop-mapreduce-examples.jar pi 1 1<\/p><\/blockquote>\n<\/div>\n<p><em>Note: If the job gets stuck at:<\/em><\/p>\n<p><em>INFO mapreduce.Job:\u00a0 map 0% reduce 0%<\/em><\/p>\n<p><em>This is caused by too little memory for the MR application Master to run tasks.<\/em><\/p>\n<p><em>Try bumping up the yarn.nodemanager.resource.memory-mb setting under Yarn and restarting the service.<\/em><\/p>\n<p>4. View the results of running the job:<\/p>\n<ul>\n<li>Cloudera Manager &gt; Clusters &gt; ClusterName &gt; yarn &gt; Applications<\/li>\n<\/ul>\n<p>You will see an entry in yarn Applications<\/p>\n<p>Reference:\u00a0<a class=\"external-link\" href=\"http:\/\/docs.hortonworks.com\/HDPDocuments\/HDP2\/HDP-2.1.2\/bk_using-apache-hadoop\/content\/running_mapreduce_examples_on_yarn.html\" rel=\"nofollow\">http:\/\/docs.hortonworks.com\/HDPDocuments\/HDP2\/HDP-2.1.2\/bk_using-apache-hadoop\/content\/running_mapreduce_examples_on_yarn.html<\/a><\/p>\n<h1 id=\"Yarn-YarnCommands\">Yarn Commands<\/h1>\n<p>List running Yarn applications:<\/p>\n<div>\n<blockquote><p>yarn application -list<\/p><\/blockquote>\n<\/div>\n<p>Kill a running Yarn application. After you retrieve the applicationId with the list command, run kill:<\/p>\n<div>\n<blockquote><p>yarn application -kill application_1415884152130_0061<\/p><\/blockquote>\n<\/div>\n<h2 id=\"Yarn-RunninganexampleapplicationwithYARN\">Running an example application with YARN<\/h2>\n<p>Create a home directory on HDFS for the user who will be running the job (for example, joe):<\/p>\n<div>\n<blockquote><p>sudo -u hdfs hadoop fs -mkdir \/user\/joe<\/p>\n<p>sudo -u hdfs hadoop fs -chown joe \/user\/joe<\/p><\/blockquote>\n<\/div>\n<p>Do the following steps as the user joe.<\/p>\n<ol>\n<li>Make a directory in HDFS called input and copy some XML files into it by running the following commands in pseudo-distributed mode:<\/li>\n<li>Set HADOOP_MAPRED_HOME for user joe:<\/li>\n<li>Run an example Hadoop job to grep with a regular expression in your input data.<\/li>\n<li>After the job completes, you can find the output in the HDFS directory named output23 because you specified that output directory to Hadoop.<\/li>\n<\/ol>\n<div>\n<blockquote><p>hadoop fs -mkdir input<\/p>\n<p>hadoop fs -put \/etc\/hadoop\/conf\/*.xml input<\/p>\n<p>hadoop fs -ls input<\/p>\n<p>Found 3 items:<\/p>\n<p>-rw-r&#8211;r&#8211; 1 joe supergroup 1348 2012-02-13 12:21 input\/core-site.xml<\/p>\n<p>-rw-r&#8211;r&#8211; 1 joe supergroup 1913 2012-02-13 12:21 input\/hdfs-site.xml<\/p>\n<p>-rw-r&#8211;r&#8211; 1 joe supergroup 1001 2012-02-13 12:21 input\/mapred-site.xml<\/p>\n<p>export HADOOP_MAPRED_HOME=\/usr\/lib\/hadoop-mapreduce<\/p>\n<p>hadoop jar \/usr\/lib\/hadoop-mapreduce\/hadoop-mapreduce-examples.jar grep input\/*.xml output23 &#8216;dfs&#8217;<\/p><\/blockquote>\n<\/div>\n<div>\n<blockquote><p>hadoop fs -ls<\/p>\n<p>Found 2 items<\/p>\n<p>drwxr-xr-x &#8211; joe supergroup 0 2009-08-18 18:36 \/user\/joe\/input<\/p>\n<p>drwxr-xr-x &#8211; joe supergroup 0 2009-08-18 18:38 \/user\/joe\/output23<\/p><\/blockquote>\n<\/div>\n<p>You can see that there is a new directory called output23.<\/p>\n<ol>\n<li>List the output files.<\/li>\n<li>Read the results in the output file.<\/li>\n<\/ol>\n<div>\n<blockquote><p>$ hadoop fs -ls output23<\/p>\n<p>Found 2 items<\/p>\n<p>drwxr-xr-x &#8211; joe supergroup 0 2009-02-25 10:33 \/user\/joe\/output23\/_SUCCESS<\/p>\n<p>-rw-r&#8211;r&#8211; 1 joe supergroup 1068 2009-02-25 10:33 \/user\/joe\/output23\/part-r-00000<\/p><\/blockquote>\n<\/div>\n<div>\n<blockquote><p>hadoop fs -cat output23\/part-r-00000 | head<\/p>\n<p>1 dfs.safemode.min.datanodes<\/p>\n<p>1 dfs.safemode.extension<\/p>\n<p>1 dfs.replication<\/p>\n<p>1 dfs.permissions.enabled<\/p>\n<p>1 dfs.namenode.name.dir<\/p>\n<p>1 dfs.namenode.checkpoint.dir<\/p>\n<p>1 dfs.datanode.data.dir<\/p><\/blockquote>\n<h2 id=\"Yarn-CountNumberofLinesinaFile\">Count Number of Lines in a File<\/h2>\n<p>Count the number of rows in an HDFS file using Pig and a MapReduce job:<\/p>\n<blockquote><p>A = load &#8216;\/asset\/wm\/subcategory\/index\/2015\/05\/24\/index.txt&#8217;;<br \/>\nB = group A all;<br \/>\nC = foreach B generate COUNT(A);<br \/>\ndump C;<\/p><\/blockquote>\n<h2 id=\"Yarn-CountNumberofWordsinaFile\">Count Number of Words in a File<\/h2>\n<blockquote><p>lines = LOAD &#8216;\/user\/hadoop\/HDFS_File.txt&#8217; AS (line:chararray);<\/p>\n<p>words = FOREACH lines GENERATE FLATTEN(TOKENIZE(line)) as word;<\/p>\n<p>grouped = GROUP words BY word;<\/p>\n<p>wordcount = FOREACH grouped GENERATE group, COUNT(words);<\/p>\n<p>DUMP wordcount;<\/p><\/blockquote>\n<\/div>\n<h1 id=\"Yarn-Troubleshooting\">Troubleshooting<\/h1>\n<h2 id=\"Yarn-HostClockOffsetHasBecomeBad\">Host Clock Offset Has Become Bad<\/h2>\n<p>Once in a while VMs will lose connection to the time server or the ntp service will stop. Time is critical to Hadoop, all services will stop if they detect that the clock is off.<\/p>\n<p>You see this error thrown when the clock offset problem is encountered:<\/p>\n<p>The health test result for HOST_CLOCK_OFFSET has become bad: The host&#8217;s NTP service is not synchronized to any remote server.<\/p>\n<p>Other problems, Yarn&#8217;s ResourceManager will throw an error. Yarn&#8217;s NodeManagers will fail, HBase&#8217;s Master and HBase&#8217;s RegionServers will also show red.<\/p>\n<p>To fix this restart ntp on the VM:<\/p>\n<p>sudo service ntp restart;<\/p>\n<p>Or even easier, run the Orchestrator Runbook:<\/p>\n<p>Network\\Update NTP on Ubuntu VM<\/p>\n<h2 id=\"Yarn-YarnExampleStuck:map0%reduce0%\">Yarn Example Stuck: map 0% reduce 0%<\/h2>\n<p>After starting a Yarn example:<\/p>\n<div>\n<blockquote><p>sudo -u hdfs yarn jar \/opt\/cloudera\/parcels\/CDH\/lib\/hadoop-mapreduce\/hadoop-mapreduce-examples.jar pi 10 100<\/p><\/blockquote>\n<\/div>\n<p>The job gets stuck at:<\/p>\n<p>INFO mapreduce.Job:\u00a0 map 0% reduce 0%<\/p>\n<p>This is caused by too little memory for the MR application Master to run tasks.<\/p>\n<p>Try bumping up the memory on the VM, or the yarn.nodemanager.resource.memory-mb and yarn.nodemanager.resource.cpu-vcores in the yarn-site.xml used by the NodeManager. Go back and review the YARN Configurations and make sure you didn&#8217;t miss something.<\/p>\n<h2 id=\"Yarn-YarnMapReduceJobFails:errorinshuffleinfetcher\">Yarn MapReduce Job Fails: error in shuffle in fetcher<\/h2>\n<p>The error in shuffle in fetcher at org.apache.hadoop.mapreduce.task.reduce.Shuffle.run is caused by a lack of resources.<\/p>\n<p>See the Configure Yarn for more information about how to configure Yarn to handle nodes with low resources.<\/p>\n<p>From the Yarn ResourceManager log:<\/p>\n<p><strong>Error:<\/strong>\u00a0org.apache.hadoop.mapreduce.task.reduce.Shuffle$ShuffleError: error in shuffle in fetcher#6 at org.apache.hadoop.mapreduce.task.reduce.Shuffle.run(Shuffle.java:134) at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:376) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:167) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1554) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162) Caused by: java.lang.OutOfMemoryError: Java heap space at org.apache.hadoop.io.BoundedByteArrayOutputStream.&lt;init&gt;(BoundedByteArrayOutputStream.java:56) at org.apache.hadoop.io.BoundedByteArrayOutputStream.&lt;init&gt;(BoundedByteArrayOutputStream.java:46) at org.apache.hadoop.mapreduce.task.reduce.InMemoryMapOutput.&lt;init&gt;(InMemoryMapOutput.java:63) at org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl.unconditionalReserve(MergeManagerImpl.java:297) at org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl.reserve(MergeManagerImpl.java:287) at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyMapOutput(Fetcher.java:411) at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyFromHost(Fetcher.java:341) at org.apache.hadoop.mapreduce.task.reduce.Fetcher.run(Fetcher.java:165)<\/p>\n<p><strong>From Hue\u2019s log:<\/strong><\/p>\n<p>2014-08-21 10:50:08,835 [main] ERROR org.apache.pig.tools.grunt.GruntParser\u00a0 &#8211; ERROR 2997: Unable to recreate exception from backed error: Error: org.apache.hadoop.mapreduce.task.reduce.Shuffle$ShuffleError: error in shuffle in fetcher#6<\/p>\n<p>at org.apache.hadoop.mapreduce.task.reduce.Shuffle.run(Shuffle.java:134)<\/p>\n<p>at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:376)<\/p>\n<p>at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:167)<\/p>\n<p>at java.security.AccessController.doPrivileged(Native Method)<\/p>\n<p>at javax.security.auth.Subject.doAs(Subject.java:415)<\/p>\n<p>at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1554)<\/p>\n<p>at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162)<\/p>\n<p>Caused by: java.lang.OutOfMemoryError: Java heap space<\/p>\n<p>at\u00a0<a class=\"external-link\" href=\"http:\/\/org.apache.hadoop.io\/\" rel=\"nofollow\">org.apache.hadoop.io<\/a>.BoundedByteArrayOutputStream.&lt;init&gt;(BoundedByteArrayOutputStream.java:56)<\/p>\n<p>at\u00a0<a class=\"external-link\" href=\"http:\/\/org.apache.hadoop.io\/\" rel=\"nofollow\">org.apache.hadoop.io<\/a>.BoundedByteArrayOutputStream.&lt;init&gt;(BoundedByteArrayOutputStream.java:46)<\/p>\n<p>at org.apache.hadoop.mapreduce.task.reduce.InMemoryMapOutput.&lt;init&gt;(InMemoryMapOutput.java:63)<\/p>\n<p>at org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl.unconditionalReserve(MergeManagerImpl.java:297)<\/p>\n<p>at org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl.reserve(MergeManagerImpl.java:287)<\/p>\n<p>at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyMapOutput(Fetcher.java:411)<\/p>\n<p>at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyFromHost(Fetcher.java:341)<\/p>\n<p>at org.apache.hadoop.mapreduce.task.reduce.Fetcher.run(Fetcher.java:165)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>YARN allows multiple access engines to use Hadoop as the common standard for batch, interactive and real-time engines that can simultaneously access the same data [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-1232","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/P1BQ8S-jS","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.developerscloset.com\/index.php?rest_route=\/wp\/v2\/pages\/1232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.developerscloset.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.developerscloset.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.developerscloset.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.developerscloset.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1232"}],"version-history":[{"count":3,"href":"https:\/\/www.developerscloset.com\/index.php?rest_route=\/wp\/v2\/pages\/1232\/revisions"}],"predecessor-version":[{"id":1457,"href":"https:\/\/www.developerscloset.com\/index.php?rest_route=\/wp\/v2\/pages\/1232\/revisions\/1457"}],"wp:attachment":[{"href":"https:\/\/www.developerscloset.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}