This topic describes how to create and configure an Alibaba Cloud Elasticsearch instance, including how to purchase an instance, enable public network access, configure the whitelist, and configure auto indexing.

Prerequisites

Alibaba Cloud Elasticsearch only supports VPC networks. Before you create an Elasticsearch instance, you must create a VPC network and a VSwitch.

Procedure

  1. Log on to the Alibaba Cloud Elasticsearch console and purchase an Elasticsearch instance.
    The following figure shows the information of the Elasticsearch instance purchased in this example. Set the Elasticsearch version to 6.3. Other versions may have the incompatibility issue.Purchase an Elasticsearch instance
    Note When you purchase an Elasticsearch instance, you must specify the password. Please record your password and keep it confidential. This password is used when you use the Java API to connect to your Elasticsearch instance.
    After you purchase the Elasticsearch instance, you are navigated to the Instances page. Wait until the Status of the instance changes to Active, and then continue the following tasks.Elasticsearch instance status
    Note It may take about 30 minutes for Elasticsearch to activate the instance.
  2. Enable public network access.
    Click the instance name. In the left-side navigation pane, choose Security, and click the Public Network Access switch to enable this feature.
    Note After Public Network Access is enabled, you can check the public endpoint of the instance on the Basic Information page. Please record the public endpoint. This endpoint is used when you call the Java API to connect to your Elasticsearch instance.
  3. Add the public IP address of your host to the public network whitelist of your Elasticsearch instance.Modify the public network whitelist
    To query the public IP address of your host, visit www.google.com, enter "What Is My IP Address", and click the relevant link.
  4. Enable auto indexing
    Notice Elasticsearch must restart the Elasticsearch instance to enable this feature. Make sure that your businesses are not adversely affected before you confirm the operation.
    1. Go to the Cluster Configuration page of the Elasticsearch instance, click Edit Configuration on the right side of YML Configuration.
    2. On the YML Configuration page, set Auto Indexing to Enable.
    3. Select the This operation will restart the instance. Continue? check box, and then click OK.Restart the Elasticsearch instance

What to do next

After the Elasticsearch instance is restarted, you can use the Java high-level REST client to Call the document API.