Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the right portion between hadoop instance types

I am trying to find out how many MASTER, CORE, TASK instances are optimal to my jobs. I couldn't find any tutorial that explains how do I figure it out.

  • How do I know if I need more than 1 core instance? What are the "symptoms" I would see in EMR's console in the metrics that would hint I need more than one core? So far when I tried the same job with 1*core+7*task instances it ran pretty much like on 8*core, but it doesn't make much sense to me. Or is it possible that my job is so much CPU bound that the IO is such minor? (I have a map-only job that parses apache log files into csv file)

  • Is there such a thing to have more than 1 master instance? If yes, when is it needed? I wonder, because my master node pretty much is just waiting for the other nodes to do the job (0%CPU) for 95% of the time.

  • Can the master and the core node be identical? I can have a master only cluster, when the 1 and only node does everything. It looks like it would be logical to be able to have a cluster with 1 node that is the master and the core , and the rest are task nodes, but it seems to be impossible to set it up that way with EMR. Why is that?

like image 258
Gavriel Avatar asked Apr 29 '14 09:04

Gavriel


People also ask

How does EMR determine cluster size?

To calculate the HDFS capacity of a cluster, for each core node, add the instance store volume capacity to the Amazon EBS storage capacity (if used). Multiply the result by the number of core nodes, and then divide the total by the replication factor based on the number of core nodes.

How do I find my EMR cluster ID?

You may look at /mnt/var/lib/info/ on Master node to find lot of info about your EMR cluster setup. More specifically /mnt/var/lib/info/job-flow. json contains the jobFlowId or ClusterID. You can use the pre-installed json parser ( jq ) to get the jobflow id.

How are EMR tasks nodes different from core nodes?

Every EMR cluster has only one master node which manages the cluster and acts as NameNode and JobTracker. Core node- All the MapReduce tasks performed by the core nodes which acts as data nodes and execute Hadoop jobs. Task nodes are part of the task instance group and are optional. They only run tasktrackers.

What is task node?

A task node indicates when a user has two choices, such as approving or to rejecting a record. You use task nodes when your business process requires you to evaluate the record. You also use task nodes when you want to create a task assignment that routes the record to one or more individuals.


1 Answers

The master instance acts as a manager and coordinates everything that goes in the whole cluster. As such, it has to exist in every job flow you run but just one instance is all you need. Unless you are deploying a single-node cluster (in which case the master instance is the only node running), it does not do any heavy lifting as far as actual MapReducing is concerned, so the instance does not have to be a powerful machine.

The number of core instances that you need really depends on the job and how fast you want to process it, so there is no single correct answer. A good thing is that you can resize the core/task instance group, so if you think your job is running slow, then you can add more instances to a running process.

One important difference between core and task instance groups is that the core instances store actual data on HDFS whereas task instances do not. In turn, you can only increase the core instance group (because removing running instances would lose the data on those instances). On the other hand, you can both increase and decrease the task instance group by adding or removing task instances.

So these two types of instances can be used to adjust the processing power of your job. Typically, you use ondemand instances for core instances because they must be running all the time and cannot be lost, and you use spot instances for task instances because losing task instances do not kill the entire job (e.g., the tasks not finished by task instances will be rerun on core instances). This is one way to run a large cluster cost-effectively by using spot instances.

The general description of each instance type is available here:

http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/InstanceGroups.html

Also, this video may be useful for using EMR effectively:

https://www.youtube.com/watch?v=a5D_bs7E3uc

like image 91
Taro Sato Avatar answered Oct 12 '22 07:10

Taro Sato