An SRV endpoint simplifies cluster maintenance and management. This eliminates the need to update the connection string when nodes are added or removed, allowing clients to connect to the cluster seamlessly and simplifying application design and maintenance. This topic describes how to apply for and modify an SRV endpoint in the MongoDB console.
Prerequisites
The instance must use ESSD cloud disks.
Usage notes
By default, SRV endpoints are not displayed in the console. You must manually apply for one.
To apply for a public SRV endpoint, you must first enable a public endpoint for the instance.
Applying for or modifying an SRV endpoint takes about 1 to 2 minutes.
After you modify an SRV endpoint, promptly update the connection string in your client applications.
Apply for an SRV endpoint
Navigate to the MongoDB replica set instance list or MongoDB sharded cluster instance list. At the top of the page, select a resource group and a region, and then click the ID of the target instance.
In the left-side navigation pane, click Database Connections.
Apply for an SRV endpoint.
In the Apply for Private SRV Endpoint section, click Apply For A Private SRV Endpoint.
In the Apply for Public SRV Endpoint section, click Public IP Connection.
NoteTo apply for a public SRV endpoint, you must first enable a public endpoint for the instance.
In the Apply for SRV Endpoint dialog box, click Confirm.
Modify an SRV endpoint
Navigate to the MongoDB replica set instance list or MongoDB sharded cluster instance list. At the top of the page, select a resource group and a region, and then click the ID of the target instance.
In the left-side navigation pane, click Database Connections.
Modify the SRV endpoint.
In the Modify Private SRV Endpoint section, click Modify Private SRV Endpoint.
In the Modify Public SRV Endpoint section, click Public IP Connection.
In the Modify SRV Endpoint panel, enter a new connection address prefix.
NoteThe connection address prefix must meet the following requirements:
Start with a lowercase letter and end with a lowercase letter or a digit.
Contain only lowercase letters, digits, and hyphens (-).
Be 8 to 63 characters long.
Result in a globally unique SRV endpoint.
Click Confirm.