You can use the AWS CLI to create uniform instance groups in a cluster that use

You can use the aws cli to create uniform instance

This preview shows page 136 - 138 out of 395 pages.

You can use the AWS CLI to create uniform instance groups in a cluster that use Spot Instances. The offered Spot price depends on Availability Zone. When you use the CLI or API, you can specify the Availability Zone either with the AvailabilityZone argument (if you're using an EC2-classic 130
Image of page 136
Amazon EMR Management Guide Guidelines and Best Practices network) or the SubnetID argument of the --ec2-attributes parameter. The Availability Zone or subnet that you select applies to the cluster, so it's used for all instance groups. If you don't specify an Availability Zone or subnet explicitly, Amazon EMR selects the Availability Zone with the lowest Spot price when it launches the cluster. The following example demonstrates a create-cluster command that creates master, core, and two task instance groups that all use Spot Instances. Replace myKey with the name of your EC2 key pair. Note Linux line continuation characters (\) are included for readability. They can be removed or used in Linux commands. For Windows, remove them or replace with a caret (^). aws emr create-cluster --name " MySpotCluster " --release-label emr-5.28.1 \ --use-default-roles --ec2-attributes KeyName= myKey \ --instance-groups InstanceGroupType= MASTER ,InstanceType= m5.xlarge ,InstanceCount= 1 ,BidPrice= 0.25 \ InstanceGroupType= CORE ,InstanceType= m5.xlarge ,InstanceCount= 2 ,BidPrice= 0.03 \ InstanceGroupType= TASK ,InstanceType= m5.xlarge ,InstanceCount= 4 ,BidPrice= 0.03 \ InstanceGroupType= TASK ,InstanceType= m5.xlarge ,InstanceCount= 2 ,BidPrice= 0.04 Use the Java SDK to Create an Instance Group You instantiate an InstanceGroupConfig object that specifies the configuration of an instance group for a cluster. To use Spot Instances, you set the withBidPrice and withMarket properties on the InstanceGroupConfig object. The following code shows how to define master, core, and task instance groups that run Spot Instances. InstanceGroupConfig instanceGroupConfigMaster = new InstanceGroupConfig() .withInstanceCount(1) .withInstanceRole("MASTER") .withInstanceType("m4.large") .withMarket("SPOT") .withBidPrice("0.25"); InstanceGroupConfig instanceGroupConfigCore = new InstanceGroupConfig() .withInstanceCount(4) .withInstanceRole("CORE") .withInstanceType("m4.large") .withMarket("SPOT") .withBidPrice("0.03"); InstanceGroupConfig instanceGroupConfigTask = new InstanceGroupConfig() .withInstanceCount(2) .withInstanceRole("TASK") .withInstanceType("m4.large") .withMarket("SPOT") .withBidPrice("0.10"); Cluster Configuration Guidelines and Best Practices Use the guidance in this section to help you determine the instance types, purchasing options, and amount of storage to provision for each node type in an EMR cluster. What Instance Type Should You Use? There are several ways to add EC2 instances to a cluster, which depend on whether you use the instance groups configuration or the instance fleets configuration for the cluster. Instance Groups Manually add instances of the same type to existing core and task instance groups.
Image of page 137
Image of page 138

You've reached the end of your free preview.

Want to read all 395 pages?

  • Spring '12
  • LauraParker
  • Amazon Web Services, Amazon Elastic Compute Cloud

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors