This topic describes the frequently asked questions about connecting to Alibaba Cloud Elasticsearch from a classic network.

How do I connect to an Elasticsearch instance deployed in a VPC network from a classic network?

For network security, your Alibaba Cloud Elasticsearch instance is deployed in your Virtual Private Cloud (VPC) network. If your business system is deployed in a classic network, you can use the ClassicLink feature supported by VPC to connect to the VPC network.

What is ClassicLink?

A ClassicLink is a network connection provided by VPC for you to connect to a VPC network from a classic network.

What are the limits of ClassicLink?

  • Up to 1,000 ECS instances of the classic network can be connected to the same VPC.

  • An ECS instance of the classic network can be connected to only one VPC, and the VPC must be under the same account and belong to the same region.

    For cross-account connection such as ones connecting an ECS instance under account A to a VPC under account B, you can transfer the ECS instance from account A to account B.

  • To enable the ClassicLink function of a VPC, the following conditions must be met:
    VPC CIDR block Limitations
    172.16.0.0/12 There is no custom route entry destined for 10.0.0.0/8 in the VPC.
    10.0.0.0/8
    • There is no custom route entry destined for 10.0.0.0/8 in the VPC.

    • Make sure that the CIDR block of the VSwitch to communicate with the ECS instance in the classic network is within 10.111.0.0/16.

    192.168.0.0/16
    • There is no custom route entry destined for 10.0.0.0/8 in the VPC.

    • Add a route entry, of which the destination CIDR block is 192.168.0.0/16 and the next hop is the private NIC, to the ECS instance of the classic network. Download the Route script.
      Note Before running the script, read the readme file in the script carefully.

How do I enable ClassicLink?

  1. Log on to the VPC console.
  2. Select the region where your VPC network is deployed.
  3. On the VPCs page, select your VPC network, and click Manage in the Actions column.

    We recommend that you select a VPC network that is attached to the CIDR block 172.16.0.0/12.

  4. On the VPC Details page, click Enable ClassicLink.
  5. In the Enable ClassicLink message, click OK.
    After ClassicLink is enabled, the ClassicLink field displays Enabled.Enable ClassicLink

How do I create a ClassicLink?

Before you create a ClassicLink, make sure that the following requirements are met:
  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. Select the region where your ECS instance is deployed.
  4. On the Instances page, find the classic network-connected instance, choose More > Network and Security Group > Set classic link in the Actions column.
  5. In the Connect to VPC dialog box, select the VPC network to be connected, and click OK.
  6. Click Go to the instance security group list and add ClassicLink rules, and click Add ClassicLink Rule.Add a ClassicLink rule
  7. In the Add ClassicLink Rule dialog box, set the parameters by referencing the following parameter descriptions, and then click OK.
    Parameter Description
    Classic Security Group Displays the name of the classic security group.
    Select VPC Security Group Select a VPC security group.
    Mode Select one of the following authorization modes:
    • Classic <=> VPC: allows ECS instances in a VPC network and cloud resources in a classic network to access each other. We recommend that you select this mode.
    • Classic => VPC: allows ECS instances in a classic network to access cloud resources in a VPC network.
    • VPC => Classic: allows cloud resources in a VPC network to access ECS instances in a classic network.
    Protocol Select a communication protocol.
    Port Range Specify the ports used for communication. Specify the port range in the format of xx/xx. For example, to specify port 80, enter 80/80.
    Priority Specify the priority of the rule. A lower value indicates a higher priority.
    Description Enter the description of the security group.

How do I test the connectivity between the classic and VPC networks?

  1. Go back to the ECS console, click the Column Filters icon in the upper-right corner. In the dialog box that appears, select Link Status, and click OK to view the connection status of the ECS instance.
    Figure 1. Column filter
    Column filter
    Figure 2. Connection Status
    Connection Status
    Figure 3. Connected
    Connected
  2. Log on to the ECS instance from which the ClassicLink is established, and run the curl command to connect to the Elasticsearch instance in the VPC network.
    After you connect to the Elasticsearch instance, the following result is returned.Connect to the Elasticsearch instance through ClassicLink