Before you use Alibaba Cloud Elasticsearch (ES), make sure that you can access your Elasticsearch instance. This topic describes how to access an Alibaba Cloud Elasticsearch instance.

Use the Kibana console

Alibaba Cloud Elasticsearch provides the Kibana console for you to scale out your businesses. The Kibana console is a part of the Elasticsearch ecosystem, which has been seamlessly integrated into Elasticsearch. The Kibana console enables you to monitor and manage Elasticsearch instances.

  1. Create an Alibaba Cloud Elasticsearch instance.
    Notice

    Before you log on to the Kibana console, make sure that Public Network Access is set to Enable and the IP address of the host used to log on to the Kibana console is included in the Kibana whitelist. You can configure these settings on the Network Access Configuration page of the Kibana module.

  2. Choose Instance ID > Data Visualization.
  3. On the Data Visualization page, click Console under Kibana.
  4. Enter the username and password on the logon page, and then click LOG IN.

    The username is elastic. Enter the password specified when you create your Elasticsearch instance.

  5. In the Kibana console, choose Dev Tools in the left-side navigation pane, and send the following request on the Console tab to access your Elasticsearch instance.Use Kibana to access Elasticsearch
    GET /
    If the request is successful, the following result is returned:
    {
      "name" : "QxxxxIp",
      "cluster_name" : "es-cn-vxxxxxxxxxxmedp",
      "cluster_uuid" : "Xxxxxxxxxxxxxxw",
      "version" : {
        "number" : "6.7.0",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "8453f77",
        "build_date" : "2019-03-21T15:32:29.844721Z",
        "build_snapshot" : false,
        "lucene_version" : "7.7.0",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }

Use an ECS instance

To use an Elastic Compute Service (ECS) instance to access your Alibaba Cloud Elasticsearch instance, you must first create an ECS instance in the same region, zone, and VPC network as your Elasticsearch instance. For more information, see Create an instance by using the provided wizard.
Notice You can also use an existing ECS instance. Make sure that both instances are deployed in the same region, zone, and VPC network. For more information about how to use an ECS instance deployed in a classic network to access an Elasticsearch instance deployed in a VPC network, see Connect to Alibaba Cloud Elasticsearch from a classic network.
  1. Log on to the ECS instance through Secure Shell (SSH).
  2. Run the following curl command to access your Elasticsearch instance:
    Note If the system displays "curl command not found", run the yum install curl command to install curl on your ECS instance.
    curl -u <username>:<password> http://<host>:<port>
    Variable Description
    <username> The account that is used to access the Elasticsearch instance. We recommend that you use an account other than elastic.
    Notice
    • After you change the password of the elastic account, it may take a period of time for the new password to take effect. During this period of time, you cannot use the elastic account to access the Elasticsearch instance. Therefore, we recommend that you do not use the elastic account.
    • If the version of your Elasticsearch instance contains "with_X-Pack", you must specify both the username and password to access the Elasticsearch instance.
    <password> The password of the Elasticsearch instance. Enter the password specified when you create the Elasticsearch instance or initialize Kibana.
    <host> The internal network address of the Elasticsearch instance. You can find the address on the Basic Information page of the Elasticsearch instance.
    <port> The port of the Elasticsearch instance. The default port is 9200. You can find the port number on the Basic Information page of the Elasticsearch instance.
    Example:
    curl -u elastic:es_password http://es-cn-vxxxxxxxxxxxxmedp.elasticsearch.aliyuncs.com:9200
    If the request is successful, the following result is returned:Successful response
    {
      "name" : "QxxxxIp",
      "cluster_name" : "es-cn-vxxxxxxxxxxmedp",
      "cluster_uuid" : "Xxxxxxxxxxxxxxw",
      "version" : {
        "number" : "6.7.0",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "8453f77",
        "build_date" : "2019-03-21T15:32:29.844721Z",
        "build_snapshot" : false,
        "lucene_version" : "7.7.0",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }

Use a client

We recommend that you use the Java high-level REST client to access your Elasticsearch instance. For more information, see Use the Java API to manage an Alibaba Cloud Elasticsearch cluster.