Changing AZs for a Cluster Instance
Function
An availability zone (AZ) is a physical region where resources use independent power supplies and networks. AZs in the same region can communicate with each other through internal networks but are physically isolated.
Multi-AZ deployment is a high-availability solution provided by CSS. You can deploy a cluster across two or three AZs in the same region. This helps prevent data loss and lower the risk of downtime.
This API is used to change AZs for an Elasticsearch or OpenSearch cluster by specifying node types.
Constraints
-
To ensure service continuity, the total number of data nodes and cold data nodes in the cluster must be greater than or equal to 3.
-
To ensure that all index shards in the cluster can be allocated to the remaining data nodes or cold data nodes, and to prevent replicas from becoming unassignable when nodes go offline during switchover, the total number of data nodes and cold data nodes must be greater than the maximum number of index replicas plus 1.
-
In AZ high-availability reconstruction scenarios, when converting from a single-AZ deployment to a dual-AZ deployment, the final number of data nodes or cold data nodes in each AZ must be no fewer than 2.
-
During the switchover process, nodes are taken offline and rebuilt one by one. You must ensure that after any single node goes offline, the remaining nodes have enough disk capacity to accommodate all data from that node, and that disk usage remains below 80%.
-
While the cluster is switching AZs, the AZ attribute of some nodes may already have changed. In this case, the displayed AZ of the nodes may show an intermediate state. After the task is complete, the cluster AZ display returns to normal.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/clusters/{cluster_id}/inst-type/{inst_type}/azmigrate
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name. Constraints N/A Range Project ID of an account. The value contains 32 characters, consisting of lowercase letters and digits. Default Value N/A |
| cluster_id | Yes | String | Definition ID of the cluster whose AZs are to be changed. For details about how to obtain the cluster ID, see Obtaining the Cluster ID. Constraints N/A Range The value is a UUID containing 36 characters. Default Value N/A |
| inst_type | Yes | String | Definition Types of nodes whose AZs are to be changed. Constraints The value must be a valid node type. Before changing the AZ, you need to back up all key data to avoid data loss. Range Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| source_az | Yes | String | Definition Current AZ of the node, obtained from Querying Cluster Details. Constraints N/A Range N/A Default Value N/A |
| target_az | Yes | String | Definition Target AZ of the node, obtained from Regions and Endpoints in "Before You Start". Constraints N/A Range N/A Default Value N/A |
| migrate_type | Yes | String | Definition: AZ migration method. Constraints:
Value range: Default value: N/A |
| agency | Yes | String | Definition Agency name. After a node is rebuilt, NICs need to be reattached to the new node. This requires you to have VPC permissions. Select an IAM agency to grant the current account the permission to access and use VPC. Constraints The agency name can contain at most 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Range N/A Default Value N/A |
| indices_backup_check | No | Boolean | Definition: Whether to check full index snapshots. You are advised to select Check full index snapshot. This ensures that all data has been backed up, so that in case the task fails, the data can be restored using this snapshot. Constraints: N/A Value range: Default value: true |
Response Parameters
Status code: 200
Request succeeded.
None
Example Requests
Change AZs for the current cluster.
POST https://{Endpoint}/v1.0/{project_id}/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/inst-type/all/azmigrate
{
"source_az" : "cn-north-4c",
"target_az" : "cn-north-4a",
"migrate_type" : "az_migrate",
"agency" : "css-test-agency"
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | Invalid request. The client should not repeat the request without modifications. |
| 403 | The request is rejected. The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot