ApsaraDB for MongoDB blocks all access by default (IP address 127.0.0.1). You must configure a whitelist to allow external devices to connect to your instance. Review and update whitelists regularly to maintain security.
Prerequisites
-
You have created an instance by following the Quick Start steps.
-
The instance is in the Running state.
Procedure
This procedure modifies the default whitelist group. To create a whitelist group or configure a security group, see Manage whitelists and security groups.
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, choose .
-
In the Whitelist Settings section, use one of the following methods to modify the whitelist for the instance.
Modify manually
-
Perform one of the following operations based on the instance type:
-
For a replica set instance: In the Actions column of the target group, click Modify.
-
For a sharded cluster instance: In the Actions column of the target group, click Manually Modify.
-
-
In the Manually Modify panel, enter IP addresses or IP address ranges in the IP Whitelist text box.
-
The following formats are supported:
-
A single IP address. Example:
10.23.12.24. -
0.0.0.0/0WarningSetting the whitelist to
0.0.0.0/0allows access from any IP address. This creates a high security risk for your ApsaraDB for MongoDB instance. Use this value with caution. -
CIDR format, which stands for Classless Inter-Domain Routing. For example, in
10.23.12.24/24, /24 indicates the prefix length of the address. The prefix length can be an integer from 1 to 32.
-
-
Separate multiple IP addresses or IP address ranges with commas (,).
-
-
Click Confirm.
Add ECS private IPs
-
In the Actions column of the target group, click Add Internal IP Addresses of ECS Instances.
-
In the Import ECS Internal IP panel, select the private IP addresses of the ECS instances that you want to add from the IP Whitelist list.
-
Click
. -
Click OK.
-