When you use Alibaba Cloud Logstash to write data to an Alibaba Cloud Elasticsearch instance, you may encounter issues such as network problems, incorrect pipeline configurations, and high server load. You might also find that a pipeline starts correctly but fails to write data, or that the service is running but data is missing. This topic provides solutions to help you troubleshoot and resolve these issues.
Network connectivity issues
Troubleshooting plan | Common error cases | Recommended solution |
Check whether Logstash is in the same network as the source and destination services. Note Alibaba Cloud Logstash and Alibaba Cloud Elasticsearch services are deployed in a virtual private cloud (VPC). You should deploy your business in the same VPC. | The source service is in a public network environment, while Logstash is in a VPC environment. | Choose one of the following solutions:
|
Check for errors in the NAT Gateway configuration. |
| Resolve the issue as follows:
|
Check whether the correct Java Database Connectivity (JDBC) driver plugin is uploaded. | In a PolarDB data synchronization scenario, a high-version JDBC driver is used. The log shows no errors, but data is not written to the destination. This issue can be resolved by switching to a lower-version driver. | Select the correct version of the JDBC driver. For more information, see Configure extension files. |
Check for restrictions in the whitelist or security group. | Filebeat is used to collect data for processing in Logstash. Filebeat is deployed on a user's ECS instance, but the listener port for the ECS instance is not open in the security group. | Resolve the issue as follows:
|
Check whether a Resource Access Management (RAM) user lacks the required permissions to access the source or destination service in the Logstash pipeline configuration. |
| Resolve the issue as follows:
|
Pipeline configuration errors
Troubleshooting plan | Common error cases | Recommended solution |
Check the main Logstash log for errors. For more information, see Query logs. | A plugin is not installed. For example, the error message | Choose one of the following solutions:
|
The configuration contains hidden special characters. | Enter the configuration manually. | |
The filter code is incorrect. For example, the Ruby code contains errors. | Choose one of the following solutions:
| |
A pipeline parameter name or value is incorrect. For example, hosts is written as host in the logstash-output-elasticsearch plugin, or the RDS instance name is incorrect. | To write the pipeline configuration, see the Logstash official documentation or the Alibaba Cloud Elasticsearch official best practices. | |
The connection between Logstash and the source or destination times out. For example, if Elasticsearch is inaccessible, the error message | Ensure network connectivity between Logstash and Elasticsearch, and enter the correct source and destination addresses. | |
The Elasticsearch instance has the HTTPS protocol enabled, but the Logstash pipeline is configured to use http. | Modify the pipeline configuration to use the same access protocol as the source and destination. |
Load issues
Troubleshooting plan | Common error cases | Recommended solution |
Check whether the node disk usage is too high. For more information, see the Cluster monitoring topic. |
| Resolve the issue as follows:
|
Check whether the node has an out-of-memory (OOM) error. For more information, see the Cluster monitoring topic. | The node has an OOM error and fails to start. | Restart the corresponding node in the console. |
Check for load issues on the source or destination. | The Elasticsearch cluster is unhealthy, which affects write operations. | Pause write operations and prioritize restoring the health of the cluster. You can also scale out the cluster. |
Pipeline starts normally, but no data is written to the destination
Troubleshooting plan | Common error cases | Recommended solution |
Enable the Logstash pipeline configuration debugging feature and check the debug logs to determine whether data is flowing into the Logstash service. You must install the logstash-output-file_extend plugin. For more information, see Use the Logstash pipeline configuration debugging feature.
| No data flows into Logstash:
| Resolve the issue as follows:
|
Data flows into Logstash:
| Resolve the issue as follows:
|
Service is normal but data is missing
Troubleshooting plan | Common error cases | Recommended solution |
Troubleshoot based on the pipeline configuration scenario and plugin properties:
| JDBC scenario:
| Resolve the issue as follows:
|
Scenario using the logstash-input-elasticsearch plugin:
| Logstash is not suitable for real-time data synchronization. If data is written to the source in real-time, you should increase the scheduled query interval. This reduces the frequency of queries and write operations on the source and destination. | |
Check the Logstash slow query log for slow write issues. For more information, see Query logs. | The load on the source and destination has not reached a bottleneck, but the number of Logstash pipeline worker threads is set to the official default value. | Increase the Logstash pipeline batch size and the number of worker threads. For more information, see Manage pipelines using configuration files. |