.. _mongocli-ops-manager-standby-clusters-failover:

==============================================
mongocli ops-manager standby-clusters failover
==============================================

.. default-domain:: mongodb

.. contents:: On this page
   :local:
   :backlinks: none
   :depth: 1
   :class: singlecol

Trigger a failover of your standby cluster without Ops Manager.

Promotes the standby cluster to active by writing the PromoteStandby
state to the disaster recovery (DR) state file in S3.

The command fails unless the current state is 'Standby'. The write is guarded against
concurrent modifications.

Run 'mongocli ops-manager standby-clusters configure' first to set up access
to the DR state file.

Syntax
------

.. code-block::
   :caption: Command Syntax

   mongocli ops-manager standby-clusters failover [options]

.. Code end marker, please don't delete this comment

Options
-------

.. list-table::
   :header-rows: 1
   :widths: 20 10 10 60

   * - Name
     - Type
     - Required
     - Description
   * - --awsAccessKey
     - string
     - false
     - AWS Access Key ID that can access the Amazon S3 bucket specified in s3BucketName.
   * - --awsAuthMode
     - string
     - false
     - AWS authentication mode for standby cluster commands. Valid values are staticCredentials, assumeRole, or credentialsChain.
   * - --awsProfile
     - string
     - false
     - Named AWS profile from the shared AWS config files to use with the default credentials chain, including AWS SSO profiles after aws sso login.
   * - --awsRegion
     - string
     - false
     - AWS region of the Amazon S3 bucket that holds the standby cluster DR state file. Defaults to us-east-1; any value works for S3-compatible stores.
   * - --awsRoleArn
     - string
     - false
     - AWS IAM role ARN to assume for standby cluster commands. Required when awsAuthMode is assumeRole.
   * - --awsSecretKey
     - string
     - false
     - AWS Secret Access Key that can access the Amazon S3 bucket specified in s3BucketName.
   * - --force
     - 
     - false
     - Flag that indicates whether to skip the confirmation prompt before proceeding with the requested action.
   * - -h, --help
     - 
     - false
     - help for failover
   * - -o, --output
     - string
     - false
     - Output format. Valid values are json, json-path, go-template, or go-template-file. To see the full output, use the -o json option.
   * - --s3BucketEndpoint
     - string
     - false
     - URL of an S3-compatible endpoint for the standby cluster DR state file. Use only for S3-compatible stores.
   * - --s3BucketName
     - string
     - false
     - Name of the Amazon S3 bucket that holds the standby cluster DR state file.
   * - --s3Key
     - string
     - false
     - Object key of the standby cluster DR state file, for example <clusterPrefix>/dr_status_<componentId>.json.
   * - -w, --watch
     - 
     - false
     - Flag that indicates whether to watch the DR state file until the failover completes.

Inherited Options
-----------------

.. list-table::
   :header-rows: 1
   :widths: 20 10 10 60

   * - Name
     - Type
     - Required
     - Description
   * - -P, --profile
     - string
     - false
     - Name of the profile to use from your configuration file. To learn about profiles for MongoCLI, see https://dochub.mongodb.org/core/atlas-cli-configuration-file.

Examples
--------

.. code-block::
   :copyable: false

   # Trigger a failover of the standby cluster, with a confirmation prompt:
   mongocli ops-manager standby-clusters failover

   
.. code-block::
   :copyable: false

   # Trigger a failover without the confirmation prompt and follow the
   
.. code-block::
   :copyable: false

   # promotion progress until the cluster becomes active:
   mongocli ops-manager standby-clusters failover --force --watch
