You can call this operation to switch between the master and slave instances.

This operation switches between the master and slave instances for ApsaraDB for RDS High-availability Edition. After switching, the slave instance becomes master and carries all business traffic.


You can use OpenAPI Explorer to perform debugging. OpenAPI Explorer allows you to perform various operations to simplify API usage. For example, you can retrieve APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Example Description
Action String Yes SwitchDBInstanceHA

The operation that you want to perform. Set this parameter to SwitchDBInstanceHA.

DBInstanceId String Yes rm-uf6wjk5xxxxxxxxxx

The ID of the instance.

NodeId String Yes 349054

The unique ID of the slave instance. You can call the Query high availability mode API operation to view the ID of the slave instance.

Force String No No

Indicates whether to turn on the forcible switch. Valid values:

  • Yes
  • No

Default value: No

EffectiveTime String No Immediate

The time when the switch takes effect. Valid values:

  • Immediate: The switch takes effect immediately.
  • MaintainTime: The switch takes effect during the maintenance time.

Default value: Immediate.

AccessKeyId String No LTAIfCxxxxxxxxxx

The AccessKey ID that Alibaba Cloud issues to a user for service access.

Response parameters

Parameter Type Example Description
RequestId String 1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC

The ID of the request.


Sample requests

http(s):// Action=SwitchDBInstanceHA
&<Common request parameters>

Successful response examples

XML format


JSON format


Error codes

For a list of error codes, visit the API Error Center.