This topic describes how to modify a public or internal endpoint of an ApsaraDB for MongoDB instance. When you change an ApsaraDB for MongoDB instance, you can replace the endpoint of the new instance with that of the original instance without the need to modify the application.
Limits
Architecture | Endpoint | Port |
Standalone instance | You can modify only the public and internal endpoints of a primary node. | You cannot modify the port of a standalone instance. |
Replica set instance | You can modify the endpoints of the primary, secondary, and read-only nodes for an instance that uses local SSDs and Enhanced SSDs (ESSDs). | You can modify the port of an instance that runs MongoDB 4.2 or later and uses ESSDs. |
Sharded cluster instance |
| You can modify the port of an instance that runs MongoDB 4.2 or later and uses ESSDs. |
Procedure
Log on to the ApsaraDB for MongoDB console.
In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based on the instance type.
In the upper-left corner of the page, select the resource group and region to which the instance belongs.
Click the ID of an instance, or click in the Actions column corresponding to the instance and select Manage.
In the left-side navigation pane of the instance details page, click Database Connections.
In the Internal Connections or Public Connections section, click Update Connection String.
In the Update Connection String pane, specify the following parameters.
Parameter
Description
Node
Select the node from the drop-down list.
NoteYou can modify only the endpoint of the mongos node for a sharded cluster instance.
Current Connection String
The current endpoint of the node.
New Connection String
The prefix of the new endpoint of the node, which must meet the following requirements:
The prefix must start with a lowercase letter.
The prefix must start or end with a lowercase letter or digit.
The prefix must be 8 to 64 characters in length and can contain lowercase letters, digits, and hyphens (-).
Port Number
The port corresponding to the new endpoint. Valid values: 1000 to 65535.
Click Submit.
What to do next
After you modify the endpoint of the node, connect your client to the instance by using the new endpoint and port.