All Products
Search
Document Center

ApsaraDB RDS:View and manage instance endpoints and ports

Last Updated:Apr 08, 2024

This topic describes how to view and manage the endpoints and ports of an ApsaraDB RDS for MySQL instance in the ApsaraDB RDS console.

RDS instances that run RDS Basic Edition and RDS High-availability Edition

The following types of endpoints are provided for RDS instances that run RDS Basic Edition and RDS High-availability Edition. You can view and change the endpoints based on your connection requirements.

Endpoint type

Description

Method to view and change the endpoint

Instance endpoint

The internal and public endpoints of the instance. This type of endpoint is suitable for all types of connections.

Database proxy endpoint

If the database proxy feature is enabled for an RDS instance, we recommend that you use the database proxy endpoint to connect to the RDS instance. This helps improve read/write splitting performance and reduce the load on the primary RDS instance.

For more information, see What are database proxies?

View the internal and public endpoints and port numbers of an ApsaraDB RDS for MySQL instance

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Basic Information section of the page that appears, click View Details next to Network Type. In the panel that appears, view the internal and public endpoints and ports of the RDS instance.

    Note

    image.png

Change the internal and public endpoints and port numbers

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Database Connection.

  3. Click Modify Endpoint.

  4. In the dialog box that appears, select a connection type, enter the prefix of the new endpoint, specify the port number, and then click OK.

    Note
    • The prefix can contain lowercase letters, digits, and hyphens (-). The prefix must start with a lowercase letter and end with a lowercase letter or a digit.

    • The prefix must contain at least 8 characters, and the total length of the endpoint cannot exceed 63 characters. The total length includes the prefix and suffix of the endpoint.

    • The port number ranges from 1000 to 65534.

    • If your RDS instance runs RDS Cluster Edition, you can click Edit in the Instance Topology Management section of the Basic Information page to change the internal and public endpoints and ports.

FAQ

  • After I change a specific endpoint or port number of my RDS instance, do I need to update the endpoint or port number information on my application?

    Yes, after you change a specific endpoint or port number of your RDS instance, you must update the endpoint or port number information on your application. Otherwise, your application cannot connect to your RDS instance.

  • After I change a specific endpoint or port number of my RDS instance, is the change immediately applied? Do I need to restart my RDS instance?

    After you change a specific endpoint or port number of your RDS instance, the change is immediately applied. You do not need to restart your RDS instance.

  • After I change or release a specific endpoint of my RDS instance, can I use the endpoint for another RDS instance?

    Yes, you can use the endpoint for another RDS instance.

  • Does a primary/secondary switchover trigger changes to the endpoints of my RDS instance?

    No, a primary/secondary switchover does not trigger changes to the endpoints of your RDS instance. However, the IP addresses that are associated with the endpoints change. Your application can still connect to your RDS instance by using the endpoints.

RDS instances that run RDS Cluster Edition

Different types of endpoints are provided for RDS instances that run RDS Cluster Edition in different business scenarios. You can view or change the endpoints based on your business scenario. The following table describes the types of the endpoints.

Endpoint type

Description

Method to view and change the endpoint

Read/write endpoint

Each RDS instance that runs RDS Cluster Edition has only one read/write endpoint. The read/write endpoint can be used to connect only to the primary node in the RDS cluster. When workloads are switched over between the primary and secondary nodes, the endpoint is used to automatically connect to the new primary node. You can use the endpoint to perform read and write operations.

Note

The read/write endpoint consists of the internal and public endpoints. After an RDS cluster is created, an internal endpoint is automatically generated. You can apply for a public endpoint based on your business requirements.

View and manage the read/write endpoint

Read-only endpoint

You can create only one read-only endpoint for each RDS cluster. The read-only endpoint is used to access one or more secondary nodes in the cluster. You can add nodes to or remove nodes from a read-only endpoint and adjust the weights of the nodes that are added to the read-only endpoint.

The number of secondary nodes that are added to the read-only endpoint is always the same as the user-defined number of secondary nodes to ensure availability.

  • If a secondary node fails, the secondary node is automatically rebuilt.

  • If a secondary node is promoted to serve as the primary node, a new secondary node is automatically added to the read-only endpoint.

View and manage the read-only endpoint

Direct node connection endpoint

You can create a direct connection endpoint for a node in an RDS cluster. The operations that are supported by the endpoint vary based on the attribute of the node for which the endpoint is created.

  • If the node is a primary node, read and write operations are supported.

  • If the node is a secondary node, only read operations are supported.

After you create a direct connection endpoint for a node, the endpoint is bound only to the node.

  • After a primary node is switched to serve as a secondary node, you can perform only read operations by using the endpoint.

  • After a secondary node is promoted to serve as a primary node, you can perform read and write operations by using the endpoint.

View and manage the direct node connection endpoint

Database proxy endpoint

You can create database proxy endpoints that have different read and write attributes.

  • If the database proxy endpoint has the read and write attributes, you can use the endpoint to perform read/write splitting to implement linear business expansion. For more information, see What is read/write splitting?

    In this case, a database proxy endpoint is associated with at least one primary node. Write requests are forwarded only to the primary nodes. The database proxy endpoint supports features such as transaction splitting and connection pooling. For more information, see Use the transaction splitting feature and Set the connection pool type.

  • If the database proxy endpoint has the read-only attribute, you can use the endpoint to process only read requests, such as reporting.

    In this case, a database proxy endpoint is associated with at least one secondary node and does not forward requests to the primary node. The database proxy endpoint does not support features such as transaction splitting or connection pooling. For more information, see Use the transaction splitting feature and Set the connection pool type.

Note

View and manage the read/write endpoint

The read/write endpoint consists of the internal and public endpoints. After an RDS cluster is created, an internal endpoint is automatically generated. You can apply for a public endpoint based on your business requirements.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Database Connection section of the Instance Topology Management section, view and change the read/write endpoint of the RDS cluster and apply for a public endpoint.

    • View the read/write endpoint

      Move the pointer over the Read/Write Mode card and view the read/write endpoint in the tooltip that appears.

      image.png

    • Change the read/write endpoint and apply for a public endpoint

      Click Edit. In the dialog box that appears, perform the following operations based on your business requirements:

      • Click Change Connection to change the internal endpoint and port number.

      • Click Change VPC to switch the VPC and vSwitch.

      • Click Apply for to apply for a public endpoint.

        Note

        You can also click Apply for Public Endpoint to apply for a public endpoint.

View and manage the read-only endpoint

View the read-only endpoint

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Database Connection section of the Instance Topology Management section, move the pointer over the Read-only Mode card to view the read-only endpoint in the tooltip that appears.

    image.png

Create and delete a read-only endpoint

Prerequisite

The RDS cluster is in the Running state.

Background information

  • When you configure a read-only endpoint for an RDS cluster, the read and write requests of the RDS cluster are not affected.

  • You can configure only one read-only endpoint for an RDS cluster.

  • The read-only endpoint of an RDS cluster can be used for multiple secondary nodes in the RDS cluster to implement load balancing. An internal endpoint is automatically generated for the read-only endpoint.

  • When you delete the read-only endpoint of an RDS cluster, the read and write requests of the RDS cluster are not affected.

  • After you delete the read-only endpoint of an RDS cluster, the internal and public endpoints of the read-only endpoint are released, and the established connections are interrupted.

Procedure

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Database Connection section of the Instance Topology Management section, perform the following operations based on your business requirements:

    • Create an endpoint

      Click Add Endpoint. In the dialog box that appears, configure the Internal Endpoint Prefix, Port, VPC, and vSwitch parameters, add the secondary node that you want to access, and then click OK.

      增加

    • Delete an endpoint

      In the Read-only Mode card, click Delete. In the message that appears, click OK.

Related operations

Operation

Description

CreateDBInstanceEndpoint

Creates an endpoint for an ApsaraDB RDS for MySQL instance that runs RDS Cluster Edition.

DeleteDBInstanceEndpoint

Deletes an endpoint of an ApsaraDB RDS for MySQL instance that runs RDS Cluster Edition.

Add nodes to and remove nodes from a read-only endpoint

Prerequisite

The RDS cluster is in the Running state.

Background information

  • When you add nodes to the read-only endpoint of an RDS cluster, the existing persistent connections are not affected. New connections are established based on the weights of the nodes. This way, the connections on the nodes are balanced.

  • The node configuration of the read-only endpoint of an RDS cluster takes effect on both the internal and public endpoints of the read-only endpoint.

  • When you remove a node from the read-only endpoint of an RDS cluster, your database system becomes unavailable for approximately 30 to 120 seconds. Connections to other nodes are not affected.

  • The node configuration of the read-only endpoint of an RDS cluster takes effect on both the internal and public endpoints of the read-only endpoint.

  • Make sure that at least one node is added to the read-only endpoint of an RDS cluster.

Procedure

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Read-only Mode card in the Database Connection of the Instance Topology Management section, perform the following operations based on your business requirements:

    image.png

    • Add nodes

      1. Click Edit. In the dialog box that appears, select the nodes that you want to add to the endpoint and click the 加入 icon.

      2. Adjust the weights of the new nodes based on your business requirements and click OK.

        调整权重

    • Remove nodes

      Click Edit. In the dialog box that appears, select the nodes that you want to remove from the endpoint, click the 删除 icon, and then click OK.

FAQ

  • Why are the CPU utilization and memory usage different on nodes that have the same weight?

    Server Load Balancer (SLB) balances the connections on nodes. However, the CPU and memory resources that are consumed by the connections may be different from each other. Therefore, the CPU utilization and memory usage may be different even on nodes that have the same weight.

  • Are existing connections affected when I adjust the weights of nodes? Will my database system become unavailable?

    No, existing connections are not affected, and your database system will not become unavailable. When you adjust the weights of nodes, only new connections to the nodes are affected.

  • Can I set the weights of all nodes to 0?

    No, you cannot set the weights of all nodes to 0. You must set the weight of at least one node to a value that is greater than 0.

  • Why are the CPU utilization and memory usage different on nodes that have the same weight?

    SLB balances the connections on nodes. However, the CPU and memory resources that are consumed by the connections may be different from each other. Therefore, the CPU utilization and memory usage may be different even on nodes that have the same weight.

  • Can I remove all nodes from the read-only endpoint of an RDS cluster?

    No, you cannot remove all nodes from the read-only endpoint of an RDS cluster. At least one node must be added to the read-only endpoint of the RDS cluster.

Adjust the weights of the nodes that are added to the read-only endpoint

Prerequisite

  • The RDS cluster is in the Running state.

  • The weight of at least one node is greater than 0.

Background information

  • When you adjust the weights of the nodes that are added to the read-only endpoint of an RDS cluster, the existing persistent connections are not affected. New connections are established based on the weights of the nodes. This way, the connections on the nodes are balanced.

  • The node configuration of the read-only endpoint of an RDS cluster takes effect on both the internal and public endpoints of the read-only endpoint.

Procedure

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Read-only Mode card in the Database Connection of the Instance Topology Management section, click Edit.

    编辑

  3. In the dialog box that appears, adjust the weights of the nodes and click OK.

    调整权重

FAQ

Why are the CPU utilization and memory usage different on nodes that have the same weight?

SLB balances the connections on nodes. However, the CPU and memory resources that are consumed by the connections may be different from each other. Therefore, the CPU utilization and memory usage may be different even on nodes that have the same weight.

Related operations

Operation

Description

ModifyDBInstanceEndpoint

Modifies the information about the endpoint of an ApsaraDB RDS for MySQL instance that runs RDS Cluster Edition.

View and manage the direct node connection endpoint

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Database Connection of the Instance Topology Management section, create, view, and change the direct node connection endpoint of the RDS cluster or apply for a public endpoint for the RDS cluster.

    • Create a direct node connection endpoint

      In the required node section, click Create Node Endpoint. In the dialog box that appears, configure the internal network information and click OK.

    • View and change the direct node connection endpoint or apply for a public endpoint

      Click Manage. In the dialog box that appears, perform the following operations based on your business requirements:

      image.png

      • View the direct node connection endpoint.

      • Click Change Endpoint to change the internal endpoint and port number.

      • Click Change VPC to switch the VPC and vSwitch.

      • Click Apply for to apply for a public endpoint.