To ensure security and stability, ApsaraDB for MongoDB restricts access by default. The default whitelist contains only 127.0.0.1. Before using an instance, you must configure its whitelist to allow external connections. A properly configured whitelist enhances your instance's security. We recommend that you maintain your whitelist regularly.
Background information
-
Before you use an instance for the first time, you must add a whitelist group.
-
After you configure a whitelist, the instance's endpoint appears on the Basic Information and Database Connections pages.
Procedure
-
Log on to the ApsaraDB for MongoDB console.
-
Based on the instance type, click Replica Set Instances or Sharded Cluster Instances in the navigation pane on the left.
-
In the upper-left corner of the page, select the instance's resource group and region.
-
Click the target instance's ID, or click Manage in its Actions column.
-
In the left navigation pane on the instance details page, click .
-
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 White List 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 Intranet IP panel, select the private IP addresses of the ECS instances that you want to add from the IP Whitelist list.
-
Click
. -
Click OK.
-
