Help Center/ Document Database Service/ API Reference/ APIs V3.0 (Recommended)/ Database O&M/ Forcibly Promoting a Secondary Node to Primary
Updated on 2025-08-22 GMT+08:00

Forcibly Promoting a Secondary Node to Primary

API Description

This API is used to promote a secondary node of a replica set, shard node, or config node to primary.

Restrictions

If the primary to secondary synchronization delay is long, this operation may fail.

URI

  • URI format

    POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/nodes/{node_id}/primary

  • URI example
    Table 1 Request parameters

    Parameter

    Mandatory

    Type

    Description

    X-Auth-Token

    Yes

    String

    User token obtained from IAM.

    project_id

    Yes

    String

    Project ID of a tenant in a region.

    instance_id

    Yes

    String

    Instance ID.

    node_id

    Yes

    String

    ID of the secondary node.

Request Parameters

  • Parameter description

    None

  • Example request

    None

Response Parameters

  • Parameter description

    None

  • Example response

    None

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.