You can apply for a public endpoint for your ApsaraDB for MongoDB instance for connections over the public internet.
Background information
ApsaraDB for MongoDB sharded cluster instances support three network types: VPC, classic network, and the public internet. The following table describes the endpoints for each network type.
Endpoint type | Description |
VPC endpoint |
|
Classic network endpoint | Cloud services on the classic network are not isolated. Unauthorized access can be blocked only by using security groups or whitelists. For more information about how to switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC, see Switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC. Note The classic network is not supported for DynamoDB-compatible sharded cluster instances. |
Public endpoint |
|
Procedure
Log on to the ApsaraDB for MongoDB console.
In the upper-left corner of the page, select the resource group and region to which the instance belongs.
In the left-side navigation pane, click Sharded Cluster Instance.
On the page that appears, find the instance that you want to manage and click its ID.
- In the left-side navigation pane, click Database Connections.
- In the Public Connections section, click Apply for Public Connection String.
- In the dialog box that appears, select the Node Type and Node ID for the node that needs a public endpoint, and then click OK.
Parameter Value Description Node Type Shard A shard node. Before you apply for a public endpoint for a shard node, you must first apply for a shard endpoint. You may need to read oplog data from a shard node over the public internet for specific tasks, such as data synchronization between clusters. To do so, you can apply for a public endpoint for the node.
cs A config server. Before you apply for a public endpoint for a config server, you must first apply for a shard endpoint. You may need to read configuration information from the config server over the public internet for specific tasks, such as data synchronization between clusters. To do so, you can apply for a public endpoint for the node.
Mongos A mongos. This is the default option. In most cases, applications only need to connect to a mongos to read and write data. Node ID Select the ID of the node for which you want to apply for a public endpoint. None Note- For more information about node types, see Sharded cluster architecture.
- You can repeat this step to apply for public endpoints for multiple nodes. However, you must wait for the current public endpoint to be created before applying for a new one.
Results
After the application is complete, a public endpoint and a corresponding ConnectionStringURI are generated for the node. For details, see Overview of sharded cluster instance connections.
More information
- Connect to MongoDB over the public internet.
- To ensure data security, release a public endpoint if you no longer need it.