All Products
Search
Document Center

PolarDB:ModifyDBClusterEndpoint

最終更新日:Oct 31, 2024

Modifies the attributes of a specified PolarDB cluster endpoint. For example, you can modify the following attributes for the specified cluster endpoint: read/write mode, consistency level, transaction splitting, primary node accepts read requests, and connection pool. You can also call the operation to specify whether newly added nodes are automatically associated with the specified cluster endpoint.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
polardb:ModifyDBClusterEndpointupdate
  • dbcluster
    acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The ID of the cluster.

pc-*************
DBEndpointIdstringYes

The ID of the endpoint.

pe-**************
NodesstringNo

The reader nodes to be associated with the endpoint. If you need to specify multiple reader nodes, separate the reader nodes with commas (,). If you do not specify this parameter, the predefined nodes are used by default.

Note
  • You must specify the node ID for each PolarDB for MySQL cluster.

  • You must specify the role name of each node for each PolarDB for PostgreSQL or PolarDB for Oracle cluster. Example: Writer,Reader1,Reader2.

  • If you set ReadWriteMode to ReadOnly, only one node can be associated with the cluster endpoint. If the only node becomes faulty, the cluster endpoint may be unavailable for up to an hour. We recommend that you do not associate only one node with the cluster endpoint in production environments. We recommend that you associate at least two nodes with the cluster endpoint to improve service availability.

  • If you set ReadWriteMode to ReadWrite, you must associate at least two nodes with the cluster endpoint.

    • No limits are imposed on the two nodes that you select for each PolarDB for MySQL cluster. If the two nodes are read-only nodes, write requests are forwarded to the primary node.
    • The following limit applies to PolarDB for PostgreSQL and PolarDB for Oracle clusters: One of the selected nodes must be the primary node.
pi-**************,pi-*************
ReadWriteModestringNo

The read/write mode. Valid values:

  • ReadWrite: The cluster endpoint handles read and write requests. Automatic read/write splitting is enabled.
  • ReadOnly: The cluster endpoint handles read-only requests.
ReadWrite
AutoAddNewNodesstringNo

Specifies whether to enable automatic association of newly added nodes with the cluster endpoint. Valid values:

  • Enable: enables automatic association of newly added nodes with the cluster endpoint.
  • Disable (default): disables automatic association of newly added nodes with the cluster endpoint.
Enable
EndpointConfigstringNo

The advanced configurations of the cluster endpoint, which are in the JSON format. You can configure the consistency level, transaction splitting, and connection pool settings, and specify whether the primary node accepts read requests.

  • The load balancing policy. Format: {\"LoadBalancePolicy\":\"Load balancing policy\"}. Valid values:

    • 0 (default): connections-based load balancing
    • 1: active requests-based load balancing
  • Specifies whether to allow the primary node to accept read requests. Format: {\"MasterAcceptReads\":\"Specification about whether to allow the primary node to accept read requests\"}. Valid values:

    • on (default): allows the primary node to accept read requests.
    • off: does not allow the primary node to accept read requests.
  • Specifies whether to enable the transaction splitting feature. Format: {\"DistributedTransaction\":\"Specification about whether to enable the transaction splitting feature\"}. Valid values:

    • on (default): enables the transaction splitting feature.
    • off: disables the transaction splitting feature.
  • The consistency level. Format: {\"ConsistLevel\":\"Consistency level\"}. Valid values:

    • 0: eventual consistency (weak)
    • 1 (default): session consistency (medium)
    • 2: global consistency (strong)
  • The global consistency timeout. Format: {\"ConsistTimeout\":\"Global consistency timeout\"}. Valid values: 0 to 60,000. Default value: 20. Unit: ms.

  • The session consistency timeout. Format: {\"ConsistSessionTimeout\":\"Session consistency timeout\"}. Valid values: 0 to 60,000. Default value: 0. Unit: ms.

  • The global (or session) consistency timeout policy. Format: {\"ConsistTimeoutAction\":\"Consistency timeout policy\"}. Valid values:

    • 0 (default): PolarProxy sends read requests to the primary node.
    • 1: PolarProxy returns the "wait replication complete timeout, please retry" error message to the application.
  • Specifies whether to enable the connection pool feature. Format: {\"ConnectionPersist\":\"Specification about whether to enable the connection pool feature\"}. Valid values:

    • off (default): disables the connection pool feature.
    • Session: enables the session-level connection pool.
    • Transaction: enables the transaction-level connection pool.
  • Specifies whether to enable the parallel query feature. Format: {\"MaxParallelDegree\":\"Specification about whether to enable the parallel query feature\"}. Valid values:

    • on: enables the parallel query feature.
    • off (default): disables the parallel query feature.
  • Specifies whether to enable the automatic request distribution among row store and column store nodes feature. Format: {\"EnableHtapImci\":\"Specification about whether to enable automatic request distribution among row store and column store nodes feature\"}. Valid values:

    • on: enables the automatic request distribution among row store and column store nodes feature.
    • off (default): disables the automatic request distribution among row store and column store nodes feature.
  • Specifies whether to enable the overload protection feature. Format: {\"EnableOverloadThrottle\":\"Specification about whether to enable the overload protection feature\"}. Valid values:

    • on: enables the overload protection feature.
    • off (default): disables the overload protection feature.
Note
  • You can configure the transaction splitting, connection pool, and overload protection settings, and specify whether the primary node accepts read requests settings for the cluster endpoint of a PolarDB for MySQL cluster only if ReadWriteMode of the cluster endpoint is set to Read and Write (Automatic Read/Write Splitting).

  • If ReadWriteMode of the cluster endpoint of a PolarDB for MySQL cluster is set to Read-only, you can specify the Connections-based Load Balancing or Active Request-based Load Balancing policy for the cluster endpoint. If ReadWriteMode of the cluster endpoint of a PolarDB for MySQL cluster is set to Read/Write (Automatic Read/Write Splitting), you can specify only the Active Request-based Load Balancing policy for the cluster endpoint.

  • You can enable automatic request distribution among column store and row store nodes for the cluster endpoint of a PolarDB for MySQL cluster if ReadWriteMode of the cluster endpoint is set to Read and Write (Automatic Read/Write Splitting), or if the ReadWriteMode of the cluster endpoint is set to Read-only and the load balancing policy is set to Active requests-based load balancing.

  • Only PolarDB for MySQL supports global consistency.

  • You can set the consistency level of the cluster endpoint of a PolarDB for MySQL cluster only to 0 if ReadWriteMode of the cluster endpoint is set to ReadOnly.

  • You can configure the settings for the consistency level, transaction splitting, and connection pool features, and specify whether the primary node accepts read requests settings at a time. Example: {\"ConsistLevel\":\"1\",\"DistributedTransaction\":\"on\",\"ConnectionPersist\":\"Session\",\"MasterAcceptReads\":\"on\"}.

  • The configuration for transaction splitting is limited by the configuration for the consistency level. For example, if you set the consistency level to 0, you cannot enable transaction splitting. If you set the consistency level to 1 or 2, you can enable transaction splitting.

{"ConsistLevel":"1","DistributedTransaction":"on","MasterAcceptReads":"off","ConnectionPersist": "on"}
DBEndpointDescriptionstringNo

The name of the custom cluster endpoint.

test
SccModestringNo

Specifies whether to enable the global consistency (high-performance mode) feature for the nodes. Valid values:

  • ON
  • OFF

Valid values:

  • on
  • off
on
PolarSccWaitTimeoutstringNo

Global consistency timeout.

100
PolarSccTimeoutActionstringNo

Global consistency timeout policy. Valid values:

  • 0: sends the request to the primary node.
  • 2: downgrades the consistency level of a query to inconsistent read when a global consistent read in the query times out. No error message is returned to the client.
0

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

CD3FA5F3-FAF3-44CA-AFFF-BAF869******

Examples

Sample success responses

JSONformat

{
  "RequestId": "CD3FA5F3-FAF3-44CA-AFFF-BAF869******"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidEndpointConfig.MalformedThe specified parameter EndpointConfig is not valid.The specified EndpointConfig parameter is invalid.
400InvalidDBEndpointId.MalformedThe specified parameter DBEndpointId is not valid.The specified DBEndpointId parameter is invalid.
400InvalidNodes.MalformedThe specified parameter Nodes is not valid.The specified Nodes parameter is invalid.
404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.
404EndpointStatus.NotSupportCurrent endpoint status does not support this operation.This operation is not supported while the node is in the current state.
404InvalidDBClusterId.MalformedThe specified parameter DBClusterId is not valid.The specified DBClusterId parameter is invalid.
404InvalidDBClusterId.NotFoundThe DBInstanceId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-07-30The Error code has changed. The request parameters of the API has changedView Change Details
2023-09-12The Error code has changedView Change Details