ApsaraDB for MongoDB supports the classic network and Virtual Private Cloud (VPC). If you need a more secure network for the current instance that resides in the classic network, you can switch the network type of the instance from classic network to VPC. This topic describes how to switch the network type of an instance from classic network to VPC.
- Classic network endpoint: Classic network endpoints are used for communication over the classic network. In the classic network, Alibaba Cloud services are not isolated. To block unauthorized traffic, you must configure security groups or IP address whitelists.
- VPC endpoint: VPC endpoints are used for communication over VPCs. A VPC is an isolated network that provides higher security and higher performance than the classic network. By default, ApsaraDB for MongoDB provides VPC endpoints for instances to ensure high security and high performance.
If you switch the network type of an instance, a transient connection occurs for the instance. We recommend that you perform this operation during off-peak hours or make sure that your application is configured to reconnect to the instance after it is disconnected. This protects your business from being affected.
- Create a VPC in the same region as the ApsaraDB for MongoDB instance. For more information, see Create and manage a VPC.
- Log on to the ApsaraDB for MongoDB console.
- In the upper-left corner of the page, select the resource group and the region of the target instance.
- In the left-side navigation pane, click Replica Set Instances, or Sharded Cluster Instances based on the instance type.
- Find the target instance and click its ID.
- In the left-side navigation pane, click Database Connections.
- In the Internal Connections - Classic Network section, click Switch to VPC.
- In the VPC panel, configure the following parameters. Select VPC and VSwitch.
Parameter Description VPC The ID of the VPC created in Step 1. VSwitch The ID of the vSwitch created in Step 1. Retain the connection address of the classic network Determine whether to turn on Retain the connection address of the classic network based on your business requirements.
- On: VPC endpoints are created while the existing classic network endpoints are retained before the specified expiration time. For more information, see Configure a hybrid access solution to switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC.
- Off: If the network type is switched from classic network to VPC, the ApsaraDB for MongoDB instance encounters a transient connection. In this situation, services such as Elastic Compute Service (ECS) that reside in the classic network are not able to connect to the ApsaraDB for MongoDB instance.
- Click OK.