This topic provides answers to some frequently asked questions about using a client to access an Elasticsearch cluster.
- Is Alibaba Cloud Elasticsearch compatible with open source Elasticsearch APIs?
- How do I configure the cluster.name parameter when I use Transport Client to access an Alibaba Cloud Elasticsearch cluster?
- When I use Transport Client to access an Alibaba Cloud Elasticsearch cluster, the error message "NoNodeAvailableException" is displayed. What do I do?
- What do I do if the system reports the "Client Request Timeout" error message when I use a client to access an Elasticsearch cluster?
- Can I use a Java API to access an Alibaba Cloud Elasticsearch cluster over port 9200?
- What do I do if the system reports the "Connection reset by peer" error message when I use a client to access an Elasticsearch cluster?
- How do I install the curl tool and use a curl command to access an Elasticsearch cluster if I want to use a Windows client to connect to the cluster?
- Which SQL query methods are supported when I use a client to access an Alibaba Cloud Elasticsearch cluster?
Is Alibaba Cloud Elasticsearch compatible with open source Elasticsearch APIs?
- Alibaba Cloud Elasticsearch is fully compatible with the RESTful APIs provided by open source Elasticsearch. You can use the RESTful APIs to manage data in a cluster. For example, you can add documents, remove documents, modify documents, search for data, or configure aliases. For more information, see Restful API.
- Alibaba Cloud Elasticsearch provides a dedicated management API. You can call the API to implement operations that you can perform in the Alibaba Cloud Elasticsearch console. For example, you can create a cluster or configure an IP address whitelist for a cluster. For more information, see List of operations by function.
How do I configure the cluster.name parameter when I use Transport Client to access an Alibaba Cloud Elasticsearch cluster?
Set the cluster.name parameter to the ID of the cluster. You can obtain the ID from the Basic Information page of the cluster. For more information, see View the basic information of a cluster.
When I use Transport Client to access an Alibaba Cloud Elasticsearch cluster, the error message "NoNodeAvailableException" is displayed. What do I do?
client.transport.sniff
parameter to false. For more information, see Transport Client (5.x).
What do I do if the system reports the "Client Request Timeout" error message when I use a client to access an Elasticsearch cluster?
Possible cause | Solution |
---|---|
The memory of the Elasticsearch cluster is insufficient. As a result, read and write I/O operations are blocked. | View the monitoring data of the Elasticsearch cluster to obtain the memory usage and the read and write workloads of the cluster. If the memory of the cluster is insufficient and the read and write workloads of the cluster are heavy, we recommend that you appropriately reduce the number of read and write operations to improve read and write performance. |
You specify a short connection timeout period. As a result, timeout occurs before a connection between the client and the Elasticsearch cluster is established. | Adjust the value of the ConnectTimeout parameter and the value of the SocketTimeout parameter on the client based on your business requirements. For example, you can change the value of the ConnectTimeout parameter to 10000 and the value of the SocketTimeout parameter to 30000. |
Network issues such as network fluctuations occur. | Resolve the issues based on the actual situation. |
Can I use a Java API to access an Alibaba Cloud Elasticsearch cluster over port 9200?
What do I do if the system reports the "Connection reset by peer" error message when I use a client to access an Elasticsearch cluster?
Cause
Read and write operations are performed after the client is unexpectedly disconnected from the Elasticsearch cluster.
Solutions
- View the logs and monitoring data of the Elasticsearch cluster to check whether exceptions
occur on the cluster.
If issues such as unhealthy cluster status and node disconnection occur on the cluster, resolve the issues first. For information about how to view the monitoring data of an Elasticsearch cluster, see Metrics and exception handling suggestions.
- Check whether a network interception policy is configured for the client.
You can enable the system to capture packets from the user side, Elasticsearch service side, and Server Load Balancer (SLB) service side to troubleshoot network issues. If no network issues occur on the sides, you must check whether a network interception policy is configured for the client.
- Check whether the TCP connection that is established based on HTTP keep-alive times
out.
HTTP keep-alive ensures that a single TCP connection can transfer packets between the server and client as many as possible. Each time a packet is transferred between the server and client, the duration of the TCP connection established based on HTTP keep-alive is updated. If no packets are transferred between the server and client during a specific period of time, the TCP connection times out. In this case, HTTP keep-alive releases and closes the TCP connection.Note TCP keep-alive is a keepalive mechanism that is used to detect the status of a TCP connection. In theory, if no exceptions occur on the server and client after a TCP connection is established, the TCP connection permanently exists unless it is closed. HTTP keep-alive ensures that a single TCP connection can transfer packets between the server and client as many as possible. If no packets are transferred between the server and client during a specific period of time, HTTP keep-alive releases and closes the TCP connection.
If the TCP connection established based on HTTP keep-alive times out, you can increase the connection timeout period. For example, you can change the value of the ConnectTimeout parameter to 10000 and the value of the SocketTimeout parameter to 30000 on the client.
If the issue persists after you perform the preceding checks, you can check whether the code logic is correct, retry the connection, and analyze the issue based on the actual situation.
How do I install the curl tool and use a curl command to access an Elasticsearch cluster if I want to use a Windows client to connect to the cluster?
- Download the package for the cURL tool and install the cURL tool. You can obtain the package from cURL documentation.
- Run a curl command to access the Elasticsearch cluster. For more information, see Use curl commands and API operations to manage an Alibaba Cloud Elasticsearch cluster.
Which SQL query methods are supported when I use a client to access an Alibaba Cloud Elasticsearch cluster?
- SQL query methods such as SQL REST API, SQL Translate API, and SQL JDBC driver. For more information about the supported SQL query methods, see SQL Client Applications. Elasticsearch clusters of V6.3 or later support X-Pack SQL.
- aliyun-sql plug-in. The plug-in is supported by Alibaba Cloud Elasticsearch clusters whose versions are V6.7.0 or later and earlier than V7.0.0. The plug-in is compatible with X-Pack SQL queries. We recommend that you refer to X-Pack SQL queries.
- Third-party SQL plug-ins, such as the open source plug-in elasticsearch-sql. For more information about the plug-in, see elasticsearch-sql.