If an Elastic Compute Service (ECS) instance is deployed in a classic network and an ApsaraDB for MongoDB instance is deployed in a virtual private cloud (VPC), or if the ApsaraDB for MongoDB instance is deployed in a classic network and the ECS instance is deployed in a VPC, you can use the methods described in this topic to connect the ECS instance to the ApsaraDB for MongoDB instance.
Prerequisites
The ECS instance and the ApsaraDB for MongoDB instance belong to the same Alibaba Cloud account and are deployed in the same region.
The IP address of the ECS instance is added to all IP address whitelists of the ApsaraDB for MongoDB instance. For more information, see Modify an IP address whitelist of an ApsaraDB for MongoDB instance.
NoteFor more information about how to obtain the IP address of an ECS instance, see View instance information.
Connection methods
ECS instance network type | ApsaraDB for MongoDB instance network type | Connection method |
Classic network | VPC |
|
VPC | Classic network Note You cannot deploy ApsaraDB for MongoDB replica set and sharded cluster instances that are purchased on and after February 21, 2022 in classic networks. You can deploy the instances only in VPCs. For more information, see [Notice] Classic network unavailability for new ApsaraDB for MongoDB instances. | Migrate the ApsaraDB for MongoDB instance to the VPC to which the ECS instance belongs. For more information, see Switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC. Note
|