This topic describes how to apply for a public endpoint for a replica set instance when you want to connect to this instance over the Internet.
The following table describes the connections supported by ApsaraDB for MongoDB.
|Intranet Connection - VPC||
|Intranet Connection - Classic Network||Cloud services on a classic network are not isolated. Unauthorized access can only be blocked by using security groups or whitelists. You can switch the network type to VPC. For more information, see Switch the network type of an ApsaraDB for MongoDB instance.|
|Public IP Connection||
- Log on to the ApsaraDB for MongoDB console.
- In the upper-left corner of the page, select the region where the target instance resides.
- In the left-side navigation pane, click Replica Set Instances.
- Find the target instance and click its ID.
- In the left-side navigation pane, click Database Connection.
- In the Public IP Connection section, click Apply for Public Connection String.
- In the Apply for Public Connection String message that appears, click OK.
Note If you want to connect to a replica set instance by using a public endpoint, you must add the public IP address of your client to a whitelist of this instance. For more information, see Configure a whitelist for a replica set instance.
After the application is complete, the replica set instance generates new endpoints for both the primary and secondary nodes and the corresponding connection string URI. For more information, see Overview of replica set instance connections.