All Products
Search
Document Center

PolarDB:ModifyDBClusterEndpoint

Last Updated:Sep 24, 2026

Modifies the cluster endpoint attributes of a PolarDB cluster, including the read/write mode, whether new nodes are automatically added to the endpoint, consistency level, transaction splitting, whether the primary node accepts read requests, and connection pooling.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardb:ModifyDBClusterEndpoint

update

*dbcluster

acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The cluster ID.

pc-*************

DBEndpointId

string

Yes

The cluster endpoint ID.

pe-**************

Nodes

string

No

The read load nodes to add to the target endpoint. Separate multiple nodes with commas (,). Default value: the existing nodes.

Note
  • For PolarDB for MySQL, specify node IDs.

  • For PolarDB for PostgreSQL and PolarDB for PostgreSQL (Compatible with Oracle), specify node role names, such as Writer,Reader1,Reader2.

  • If ReadWriteMode is set to ReadOnly, you can mount only one node. However, if this node fails, the endpoint may be unavailable for up to 1 hour. Do not use this configuration in production environments. Select at least 2 nodes to improve availability.

  • If ReadWriteMode is set to ReadWrite, select at least 2 nodes.
    • PolarDB for MySQL allows you to select any two nodes. If both nodes are read-only nodes, write requests are forwarded to the primary node.

    • PolarDB for PostgreSQL and PolarDB for PostgreSQL (Compatible with Oracle) require the primary node to be included.

pi-**************,pi-*************

ReadWriteMode

string

No

The read/write mode. Valid values:

  • ReadWrite: read/write (automatic read/write splitting)

  • ReadOnly: read-only

ReadWrite

AutoAddNewNodes

string

No

Specifies whether new nodes are automatically added to the endpoint. Valid values:

  • Enable: New nodes are automatically added.

  • Disable: New nodes are not automatically added. (Default)

Valid values:

  • Enable :

    New nodes are automatically added to the endpoint.

  • Disable :

    New nodes are not automatically added to the endpoint.

Enable

EndpointConfig

string

No

The advanced configuration of the cluster endpoint in JSON format. You can configure the consistency level, transaction splitting, whether the primary node accepts read requests, connection pooling, and other settings.

  • To configure the load balancing policy, use the format {\"LoadBalancePolicy\":\"Load balancing policy\"}. Valid values:

    • 0: connection-based load balancing. (Default)

    • 1: active-request-based load balancing.

  • To configure whether the primary node accepts read requests, use the format {\"MasterAcceptReads\":\"Whether the primary node accepts reads\"}. Valid values:

    • on: The primary node accepts read requests. (Default)

    • off: The primary node does not accept read requests.

  • To configure transaction splitting, use two parameters together in the format {\"DistributedTransaction\":\"Transaction splitting\",\"TrxSplitAggressive\":\"Transaction splitting\"}. Valid values:

    • Disabled: DistributedTransaction=off, TrxSplitAggressive=off

    • Read request splitting before first write request: DistributedTransaction=on, TrxSplitAggressive=off

    • Full transaction splitting: DistributedTransaction=on, TrxSplitAggressive=on

  • To configure the consistency level, use the format {\"ConsistLevel\":\"Consistency level\"}. Valid values:

    • 0: eventual consistency (weak).

    • 1: session consistency (medium). (Default)

    • 2: global consistency (strong).

  • To configure the global consistency read timeout period, use the format {\"ConsistTimeout\":\"Global consistency read timeout\"}. Valid values: 0 to 60000. Default value: 20. Unit: ms.

  • To configure the session consistency read timeout period, use the format {\"ConsistSessionTimeout\":\"Session consistency read timeout\"}. Valid values: 0 to 60000. Default value: 0. Unit: ms.

  • To configure the global (or session) consistency read timeout policy, use the format {\"ConsistTimeoutAction\":\"Global consistency read timeout policy\"}. Valid values:

    • 0: Forward the read request to the primary node. (Default)

    • 1: The proxy returns an error message wait replication complete timeout, please retry to the application.

  • To configure the connection pool, use the format {\"ConnectionPersist\":\"Connection pool\"}. Valid values:

    • off: Disable the connection pool. (Default)

    • Session: Enable the session-level connection pool.

    • Transaction: Enable the transaction-level connection pooling.

  • To configure on-demand connection establishment, use the format {\"ConnectAllBackends\":\"On-demand connection\"}. Valid values:

    • on: Enabled.

    • off: Disabled. (Default)

  • To configure parallel query, use the format {\"MaxParallelDegree\":\"Parallel query\"}. Valid values:

    • on: Enable parallel query.

    • off: Disable parallel query. (Default)

  • To configure automatic request distribution among row offload reads from primary nodes, use the format {\"EnableHtapImci\":\"Row store/column store automatic request distribution\"}. Valid values:

    • on: Enable automatic request distribution among row offload reads from primary nodes.

    • off: Disable automatic request distribution among row offload reads from primary nodes. (Default)

  • To configure whether to enable overload protection, use the format {\"EnableOverloadThrottle\":\"Whether to enable overload protection\"}. Valid values:

    • on: Enable overload protection.

    • off: Disable overload protection. (Default)

  • To configure node weights, use the format {\"NodesWeight\":{\"Node ID\":\"Weight value\"}}.

Note
  • Transaction splitting, whether the primary node accepts read requests, connection pooling, and overload protection can be configured only when the read/write mode of the PolarDB for MySQL cluster endpoint is read/write (automatic read/write splitting).

  • When the read/write mode of the PolarDB for MySQL cluster endpoint is read-only, both connection-based load balancing and active-request-based load balancing policies are supported. The read/write (automatic read/write splitting) mode supports only the active-request-based load balancing policy.

  • Automatic request distribution among row offload reads from primary nodes can be configured when the read/write mode of the PolarDB for MySQL cluster endpoint is read/write (automatic read/write splitting), or when the read/write mode is read-only and the load balancing policy is active-request-based load balancing.

  • Only PolarDB for MySQL supports setting the consistency level to global consistency.

  • If ReadWriteMode is set to ReadOnly, the consistency level can only be set to 0.

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

  • Transaction splitting is constrained by the consistency level. For example, transaction splitting cannot be enabled when the consistency level is 0. Transaction splitting can be enabled when the consistency level is 1 or 2.

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

DBEndpointDescription

string

No

The name of the endpoint.

test

SccMode

string

No

Specifies whether to enable the global consistency (performance schema) feature for the node. Valid values:

  • ON: Enabled.

  • OFF: Disabled.

Valid values:

  • off :

    Disabled.

  • on :

    Enabled.

on

PolarSccWaitTimeout

string

No

The timeout period for global consistency.

100

PolarSccTimeoutAction

string

No

The timeout policy for global consistency. Valid values:

  • 0: Sends the request to the primary node.

  • 2: Timeout degradation. When the global consistency read times out, the query automatically degrades to regular requests, and the client does not receive an error message.

0

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidEndpointConfig.Malformed The specified parameter EndpointConfig is not valid. The specified EndpointConfig parameter is invalid.
400 InvalidDBEndpointId.Malformed The specified parameter DBEndpointId is not valid. The specified DBEndpointId parameter is invalid.
400 InvalidNodes.Malformed The specified parameter Nodes is not valid. The specified Nodes parameter is invalid.
403 OperationDenied.InstanceType The operation is not permitted due to instance type. The operation is not allowed due to the instance type
404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The specified DBClusterId parameter does not exist in the current record.
404 EndpointStatus.NotSupport Current endpoint status does not support this operation. This operation is not supported while the node is in the current state.
404 InvalidDBClusterId.Malformed The specified parameter DBClusterId is not valid. The specified DBClusterId parameter is invalid.
404 InvalidDBClusterId.NotFound The DBInstanceId provided does not exist in our records. The specified DBClusterId parameter does not exist in the current record.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.