After a cluster is created, you can access the cluster to use Elasticsearch to perform operations, for example, defining index data, importing data, searching data and much more. For more information about Elasticsearch, see the Elasticsearch Reference. You can use either of the following methods to access a cluster:
The ECS, where you access the cluster by invoking Elasticsearch APIs, must meet the following requirements. For details about how to create and log in to an ECS, see Creating and Logging In to a Linux ECS or Creating and Logging In to a Windows ECS.
If this requirement is not met, modify the ECS security group or configure the inbound and outbound rules of the ECS security group to allow the ECS security group to be accessed by all security groups of the cluster. For details, see Configuring Security Group Rules.
To access a cluster by invoking Elasticsearch APIs on the ECS that is located in the same LAN as the cluster, perform the following steps:
Assume that there are two nodes in a cluster. Value 10.62.179.32:9200 10.62.179.33:9200 indicates that the private network addresses of the two nodes are separately 10.62.179.32 and 10.62.179.33, and port 9200 is used to access both nodes.
For example, run the following cURL command to check the index information in the cluster. In this example, the private network address of one node in the cluster is 10.62.179.32 and port 9200 is used to access the port.
curl -k 'https://10.62.179.32:9200/_cat/indices'
In the preceding command, the private network address and port number of only one node in the cluster are used. If the node fails, the command will fail to be executed. If the cluster contains multiple nodes, you can replace the private network address and port number of the faulty node with the private network address and port number of another node in the cluster. If the cluster contains only one node, restore the node and execute the command again.
Assume that communication encryption is not enabled in the cluster. The command output is shown in the following figure.