Stopping and Starting an Amazon DocumentDB Cluster

    During periods where you don’t need an Amazon DocumentDB cluster, you can stop all instances in that cluster at once. You can then start the cluster again anytime you need to use it. Starting and stopping simplifies the setup and teardown processes for clusters that are used for development, testing, or similar activities that don’t require continuous availability. You can stop and start a cluster using the AWS Management Console or the AWS CLI with a single action, regardless of how many instances are in the cluster.

    While your cluster is stopped, the cluster storage volume remains unchanged. You are charged only for storage, manual snapshots, and automated backup storage within your specified retention window. You aren’t charged for any instance hours. Amazon DocumentDB automatically starts your cluster after seven days so that it doesn’t fall behind any required maintenance updates. When your cluster starts after seven days, you will begin to be charged for the instances in the cluster again. While your cluster is stopped, you can’t query your storage volume because querying requires that instances are in the available state.

    When an Amazon DocumentDB cluster is stopped, neither the cluster nor its instances can be modified in any way. This includes adding or removing instances, or deleting the cluster.

    The following procedure shows you how to stop a cluster with one or more instances in the available state, or start a stopped cluster.

    To stop or start an Amazon DocumentDB cluster

    1. Sign in to the AWS Management Console, and open the Amazon DocumentDB console at https://console.aws.amazon.com/docdb.

    2. In the navigation pane, choose Clusters.

      Tip

      If you don’t see the navigation pane on the left side of your screen, choose the menu icon () in the upper-left corner of the page.

    3. Choose Actions, and then choose the action that you want to perform on the cluster.

        1. Choose Stop.

          ![

          To avoid activating the failover mechanism, the stop operation stops the replica instances first, and then the primary instance.

        2. On the confirmation dialog, confirm that you want to stop the cluster by choosing Stop cluster, or to keep the cluster running, choose Cancel.

          ![

          1. ](/projects/DocumentDB-20201111-en/bc36ebb9aaf995d5a0fa5d95738f20e1.png)
    4. Monitor the status of the cluster and its instances. If you started the cluster, you can resume using the cluster when the cluster and its instances are available. For more information, see .

      ![

      1. Image: Status of clusters stopping and starting
      2. ](https://docs.aws.amazon.com/documentdb/latest/developerguide/images/db-cluster-stop-start-status.png)

    The following code examples show you how to stop a cluster with one or more instances in the available state, or start a stopped cluster.

    To stop a cluster with one or more available instances using the AWS CLI, use the operation. To start a stopped cluster, use the start-db-cluster operation. Both operations use the --db-cluster-identifier parameter.

    • --db-cluster-identifier—Required. The name of the cluster to stop or start.

    Example — To stop a cluster using the AWS CLI

    The following code stops the cluster . The cluster must have one or more instances in the available state.

    For Linux, macOS, or Unix:

    For Windows:

    1. aws docdb stop-db-cluster ^
    2. --db-cluster-identifier sample-cluster

    Example — To start a cluster using the AWS CLI

    The following code starts the cluster sample-cluster. The cluster must currently be stopped.

    For Linux, macOS, or Unix:

    For Windows:

    1. --db-cluster-identifier sample-cluster

    While an Amazon DocumentDB cluster is stopped, you can do a point-in-time restore to any point within your specified automated backup retention window. For details about doing a point-in-time restore, see Restoring to a Point in Time.

    You can’t modify the configuration of an Amazon DocumentDB cluster, or any of its instances, while the cluster is stopped. You also can’t add or remove instances from the cluster, or delete the cluster if it still has any associated instances. You must start the cluster before performing any such administrative actions.

    Amazon DocumentDB applies any scheduled maintenance to your stopped cluster only after it’s started again. After seven days, Amazon DocumentDB automatically starts a stopped cluster so that it doesn’t fall too far behind in its maintenance status. When the cluster restarts, you will begin to be charged for the instances in the cluster again.