ApsaraDB for MongoDB provides public endpoints. This topic describes how to manage public endpoints.
Background information
By default, the ApsaraDB for MongoDB console displays private endpoints in the Internal Connections - VPC section. To connect to an instance over the Internet, you must manually apply for a public endpoint.
Endpoint type | Description |
Private endpoint |
|
Public endpoint |
|
Apply for a public endpoint
Usage notes
When you apply for a public endpoint for an instance that uses local disks and runs MongoDB 3.2 or earlier, the instance is restarted. We recommend that you apply for a public endpoint for the instance during off-peak hours.
Before connecting to an instance by using a public endpoint, you must add the public IP address of the client connecting to the instance to a whitelist of the instance.
For sharded cluster instances that use cloud disks, you can apply for public endpoints only for mongos nodes.
Procedure
Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select the resource group and region to which the desired instance belongs. Then, find the instance and click the instance ID.
In the left-side navigation pane of the instance details page, click Database Connections.
Release a public endpoint
Usage notes
After releasing a public endpoint of an instance or that of a node, you can no longer connect to the instance or node by using the original public endpoint.
After you release a public endpoint, we recommend that you delete the corresponding public IP address from a whitelist to ensure data security.
Procedure
Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select the resource group and region to which the desired instance belongs. Then, find the instance and click the instance ID.
In the left-side navigation pane of the instance details page, click Database Connections.
Perform the corresponding operations based on the instance architecture.
Replica set or standalone instance
NoteAfter you release the public endpoint of a replica set instance, the public endpoints of both the primary and secondary nodes are released.
In the Public Connections section, select the endpoint and then click Release in the Actions column.
In the Confirm Release dialog box, click OK.
Sharded cluster instance
NoteFor a sharded cluster instance, you can release the public endpoint of one or more mongos, shard, or ConfigServer nodes. The nodes whose public endpoints are not released are still accessible. For more information about the components of a sharded cluster instance, see Sharded cluster instances.
After you release the endpoint of a shard or ConfigServer component, the public endpoints of both the primary and secondary nodes in the component are released.
In the Public Connections section, select the endpoint that you want to release and then click Release in the Actions column.
In the Confirm Release dialog box, click OK.
To release the public endpoints of multiple nodes in a sharded cluster instance, repeat the preceding steps.
References
For more information about the endpoints of an instance, see Overview of instance connections.
For more information about how to connect to an instance by using a public endpoint, see Connect to an instance over the Internet from a local client.
When you connect to a database by using a public endpoint, we recommend that you use SSL encryption. For more information, see Use the mongo shell to connect to a database in SSL encryption mode.