All Products
Search
Document Center

ApsaraDB for MongoDB:Connect an ECS instance to an ApsaraDB for MongoDB instance that uses a different network type over the internal network

Last Updated:Jul 04, 2024

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

Connection methods

ECS instance network type

ApsaraDB for MongoDB instance network type

Connection method

Classic network

VPC

  • Migrate the ECS instance to the VPC to which the ApsaraDB for MongoDB instance belongs. For more information, see Migrate an ECS instance from a classic network to a VPC.

  • Use the ClassicLink feature to establish interconnection. For more information, see Connect an instance in a classic network to a VPC.

    Note
    • Before you establish a ClassicLink-based interconnection, make sure that you are familiar with the limits of the ClassicLink feature. For more information, see Overview.

    • The ClassicLink-based interconnection is a temporary solution in specific conditions. To achieve high-speed connection in the production environment, we recommend that you deploy the ECS instance and the ApsaraDB for MongoDB instance in the same 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
  • You cannot change the network type of standalone instances.

  • A transient disconnection occurs when you switch the network type of the ApsaraDB for MongoDB instance. To prevent negative impacts on your business, we recommend that you perform this operation during off-peak hours or make sure that your application can automatically reconnect to the ApsaraDB for MongoDB instance.