If an Elastic Compute Service (ECS) instance is in the classic network and an ApsaraDB for MongoDB instance is in a virtual private cloud (VPC), or if the ApsaraDB for MongoDB instance is in the classic network and the ECS instance is 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 ApsaraDB for MongoDB instance belong to the same Alibaba Cloud account and are in the same region.
- The IP address of the ECS instance is added to a whitelist of the ApsaraDB MongoDB
instance. For more information, see Configure a whitelist or an ECS security group for an ApsaraDB for MongoDB instance.
Note For 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 ApsaraDB for MongoDB replica set and sharded cluster instances that are purchased
on and after February 21, 2022 do not support classic network and can only use VPC.
For more information, see Notice on 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
|