Understand Spark: Cluster Manager, Master and Driver nodes

1. The Cluster Manager is a long-running service, on which node it is running? Cluster Manager is Master process in Spark standalone mode. It can be started anywhere by doing ./sbin/start-master.sh, in YARN it would be Resource Manager. 2. Is it possible that the Master and the Driver nodes will be the same machine? I … Read more

Apache Hadoop Yarn – Underutilization of cores

The problem lies not with yarn-site.xml or spark-defaults.conf but actually with the resource calculator that assigns the cores to the executors or in the case of MapReduce jobs, to the Mappers/Reducers. The default resource calculator i.e org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator uses only memory information for allocating containers and CPU scheduling is not enabled by default. To use both … Read more

How to log using log4j to local file system inside a Spark application that runs on YARN?

It looks like you’ll need to append to the JVM arguments used when launching your tasks/jobs. Try editing conf/spark-defaults.conf as described here spark.executor.extraJavaOptions=-Dlog4j.configuration=file:/apps/spark-1.2.0/conf/log4j.properties spark.driver.extraJavaOptions=-Dlog4j.configuration=file:/apps/spark-1.2.0/conf/log4j.properties Alternatively try editing conf/spark-env.sh as described here to add the same JVM argument, although the entries in conf/spark-defaults.conf should work. If you are still not getting any joy, you can explicitly … Read more

Hadoop: Connecting to ResourceManager failed

The problem connecting recource manager was because ive needed to add a few properties to yarn-site.xml : <property> <name>yarn.resourcemanager.address</name> <value>127.0.0.1:8032</value> </property> <property> <name>yarn.resourcemanager.scheduler.address</name> <value>127.0.0.1:8030</value> </property> <property> <name>yarn.resourcemanager.resource-tracker.address</name> <value>127.0.0.1:8031</value> </property> Yet, my Jobs arent runing but connecting is successful now

How to know what is the reason for ClosedChannelExceptions with spark-shell in YARN client mode?

Reason is association with yarn cluster may be lost due to the Java 8 excessive memory allocation issue: https://issues.apache.org/jira/browse/YARN-4714 You can force YARN to ignore this by setting up the following properties in yarn-site.xml <property> <name>yarn.nodemanager.pmem-check-enabled</name> <value>false</value> </property> <property> <name>yarn.nodemanager.vmem-check-enabled</name> <value>false</value> </property> Thanks to simplejack, Reference from Spark Pi Example in Cluster mode with Yarn: … Read more

Why does Hadoop report “Unhealthy Node local-dirs and log-dirs are bad”?

The most common cause of local-dirs are bad is due to available disk space on the node exceeding yarn’s max-disk-utilization-per-disk-percentage default value of 90.0%. Either clean up the disk that the unhealthy node is running on, or increase the threshold in yarn-site.xml <property> <name>yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage</name> <value>98.5</value> </property> Avoid disabling disk check, because your jobs may failed … Read more

Difference between `yarn.scheduler.maximum-allocation-mb` and `yarn.nodemanager.resource.memory-mb`?

Consider in a scenario where you are setting up a cluster where each machine having 48 GB of RAM. Some of this RAM should be reserved for Operating System and other installed applications. yarn.nodemanager.resource.memory-mb: Amount of physical memory, in MB, that can be allocated for containers. It means the amount of memory YARN can utilize … Read more