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
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.
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.
NoteThe internal and public endpoints of an RDS instance are displayed only after you configure IP address whitelists for the instance. For more information, see Use a database client or the CLI to connect to an ApsaraDB RDS for MySQL instance.
The public endpoint of an RDS instance is displayed only after you apply for a public endpoint for the RDS instance. For more information, see Apply for or release a public endpoint for an ApsaraDB RDS for MySQL instance.
If your RDS instance runs RDS Cluster Edition, you can view the internal and public endpoints and ports in the Instance Topology Management section of the Basic Information page.
Change the internal and public endpoints and port numbers
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.
In the left-side navigation pane, click Database Connection.
Click Modify Endpoint.
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.
NoteThe 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 prefix is globally unique and cannot be configured or modified to the prefix of an existing endpoint. You must change the prefix to an unused endpoint prefix.
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?
No, you do not need to restart your RDS instance. The modification takes effect immediately.
After I change or release an 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. After the primary/secondary switchover is complete, the original secondary RDS instance becomes the primary RDS instance, and your application is automatically connected to the primary RDS instance.
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. | |
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.
| |
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.
After you create a direct connection endpoint for a node, the endpoint is bound only to the node.
| |
Database proxy endpoint | You can create database proxy endpoints that have different read and write attributes.
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.
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.
In the Database Connection section of the
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.
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.
NoteYou 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
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.
In the Database Connection section of the
section, move the pointer over the Read-only Mode card to view the read-only endpoint in the tooltip that appears.
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
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.
In the Database Connection section of the 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 |
Creates an endpoint for an ApsaraDB RDS for MySQL instance that runs RDS Cluster Edition. | |
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
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.
In the Read-only Mode card in the Database Connection of the section, perform the following operations based on your business requirements:
Add nodes
Click Edit. In the dialog box that appears, select the nodes that you want to add to the endpoint and click the icon.
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
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.
In the Read-only Mode card in the Database Connection of the section, click Edit.
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 |
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
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.
In the Database Connection of the
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:
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.