Menu
Amazon EMR
Developer Guide

Specify the AMI Version for a New Cluster

This documentation is for AMI versions 2.x and 3.x of Amazon EMR. For information about Amazon EMR releases 4.0.0 and above, see the Amazon EMR Release Guide. For information about managing the Amazon EMR service in 4.x releases, see the Amazon EMR Management Guide.

You must specify which AMI version a new cluster should use when you launch it. For more information about the default configuration and applications available on AMI versions, see AMI Versions Supported in Amazon EMR Versions 2.x and 3.x.

To specify an AMI version during cluster launch using the AWS CLI

When you create a cluster using the AWS CLI, add the --ami-version parameter to the create-cluster subcommand. The --ami-version parameter is required when you create a cluster using the AWS CLI.

  • To launch a cluster and fully specify the AMI (using AMI version 3.11.0), type the following command and replace myKey with the name of your EC2 key pair.

    • Linux, UNIX, and Mac OS X users:

      Copy
      aws emr create-cluster --name "Test cluster" --ami-version 3.11.0 \ --applications Name=Hue Name=Hive Name=Pig \ --use-default-roles --ec2-attributes KeyName=myKey \ --instance-count 5 --instance-type m3.xlarge
    • Windows users:

      Copy
      aws emr create-cluster --name "Test cluster" --ami-version 3.11.0 --applications Name=Hue Name=Hive Name=Pig --use-default-roles --ec2-attributes KeyName=myKey --instance-count 5 --instance-type m3.xlarge

    When you specify the instance count without using the --instance-groups parameter, a single Master node is launched, and the remaining instances are launched as core nodes. All nodes will use the instance type specified in --instance-type.

    Note

    If you have not previously created the default EMR service role and EC2 instance profile, type aws emr create-default-roles to create them before typing the create-cluster subcommand.

    The following example specifies the AMI using the major and minor version. The cluster is launched on the AMI that matches those specifications and has the latest patches. For example, if the most recent AMI version is 3.11.0, specifying --ami-version 3 would launch a cluster using AMI 3.11.0.

    Copy
    aws emr create-cluster --name "Test cluster" --ami-version 2.4 --applications Name=Hive Name=Pig --use-default-roles --ec2-attributes KeyName=myKey --instance-count 5 --instance-type m3.xlarge

For more information on using Amazon EMR commands in the AWS CLI, see http://docs.aws.amazon.com/cli/latest/reference/emr.