Amazon Elastic MapReduce
Developer Guide (API Version 2009-03-31)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Terminate a Cluster

This section describes the methods to terminate a cluster. You can terminate clusters in the STARTING, RUNNING, or WAITING states. A cluster in the WAITING state must be terminated or it runs indefinitely, generating charges to your account. You can terminate a cluster that fails to leave the STARTING state or is unable to complete a step.

If you are terminating a cluster that has termination protection set on it, you must first disable termination protection before you can terminate the cluster. For more information, see Terminating a Protected Cluster.

Depending on the configuration of the cluster, it may take up to 5-20 minutes for the cluster to completely terminate and release allocated resources, such as EC2 instances.

Amazon EMR Console

You can terminate a cluster using the Amazon EMR console.

To terminate a cluster

  1. Sign in to the AWS Management Console and open the Amazon Elastic MapReduce console at

  2. Select the cluster to terminate.

  3. Click Terminate.

  4. Click Yes, Terminate.

    Amazon EMR terminates the instances in the cluster and stops saving log data.

Using the CLI

To terminate a cluster, use the --terminate parameter and specify the cluster to terminate. The example that follows uses cluster j-C019299B1X.

To terminate a cluster

  • In the directory where you installed the Amazon EMR CLI, run the following from the command line. For more information, see the Command Line Interface Reference for Amazon EMR.

    • Linux, UNIX, and Mac OS X users:

      ./elastic-mapreduce --terminate JobFlowID
    • Windows users:

      ruby elastic-mapreduce --terminate JobFlowID

    The response is similar to the following:

    Terminated cluster JobFlowID


The TerminateJobFlows operation ends step processing, uploads any log data from Amazon EC2 to Amazon S3 (if configured), and terminates the Hadoop cluster. A cluster also terminates automatically if you set KeepJobAliveWhenNoSteps to False in a RunJobFlows request.

You can use this action to terminate either a single cluster or a list of clusters by their cluster IDs.

For more information about the input parameters unique to TerminateJobFlows, see TerminateJobFlows. For more information about the generic parameters in the request, see Common Request Parameters.