SRV HA endpoints facilitate the maintenance and management of instances by eliminating the need to modify endpoints when nodes are added or removed. Clients can interact with instances seamlessly, streamlining the design and maintenance of your application. This topic explains how to apply for an SRV endpoint in the MongoDB console and how to modify an SRV endpoint.
Prerequisites
The instance must have a standard SSD storage class.
Precautions
SRV endpoints are not displayed by default in the console. You must manually apply for SRV endpoints if needed.
Before applying for a public SRV endpoint, ensure you have applied for the instance's public endpoint.
The process to apply for or modify an SRV endpoint typically takes 1 to 2 minutes.
Promptly update the connection string information on your client after modifying an SRV endpoint.
Apply for an SRV endpoint
Navigate to the MongoDB replica set instance list or MongoDB sharded cluster instance list, select the resource group and region at the top, and then click the desired instance ID.
In the left-side navigation pane of the target instance page, click Database Connections.
To apply for an SRV endpoint:
Private IP: Click Privatelink - Virtual Private Cloud on the right, and then select Apply For A Private SRV Endpoint.
Public IP: To establish a public connection, click Public Connection on the right, followed by clicking Apply For A Public SRV Endpoint.
NoteRemember to apply for the public endpoint of the instance before applying for a public SRV endpoint.
In the Apply For An SRV Endpoint dialog box, you can click OK.
Modify an SRV endpoint
Navigate to the MongoDB replica set instance list or MongoDB sharded cluster instance list, select the resource group and region at the top, and then click the desired instance ID.
In the left-side navigation pane of the target instance page, click Database Connections.
To modify the SRV endpoint:
Private IP: To modify your Private SRV Endpoint, click Privatelink - Virtual Private Cloud on the right, followed by Modify Private SRV Endpoint.
Public IP: To modify the public SRV endpoint, click Public Connection on the right, followed by Modify Public SRV Endpoint.
In the modify SRV endpoint sidebar, enter the new connection address prefix in the appropriate field.
NoteThe format requirements for SRV endpoints are:
The name must start and end with a lowercase letter or a digit.
It can include lowercase letters, digits, and hyphens (-).
The prefix must be at least 8 characters long, and the total length, including the prefix, must not exceed 63 characters.
The SRV endpoint must be unique globally.
Click OK .