项目场景:
线上的flink作业,需要将消费的数据处理后写入es的索引中,但任务偶发的检查点超时,通过分析日志,排查后发现为写入es的时候阻塞引起的检查点超时。
问题描述
flink作业sink 写入es的时候任务卡住,导致检查点超时,排查到的报错日志如下:

Sink to es error ,stackTrace: ElasticsearchException[Elasticsearch except
ion [type=es_rejected_execution_exception, reason=rejected execution of processing of [732947227][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[fin_input
_total_invoice_index][2]] containing [37] requests, target allocation id: lmspLqJ0QZqnXN0HkMzkQA, primary term: 1 on EsThreadPoolExecutor[name = es-node01/write, queue
capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@2c99189a[Running, pool size = 8, active threads = 8, queued tasks = 217, completed tasks
= 442464936]]]]
原因分析:
1、通过上述日志分析,可能是写入时es阻塞导致,观察es集群监控图,发现12点至12点30分之间,es集群写入存在延时情况。

2、通过观察其他索引同时间段写入情况,发现12点至12点30分之间,存在其他索引往es灌数导致es集群写入延时。

解决方案:
1、临时解决方案:将灌数任务调整为夜间执行,错过查询高峰。
2、长期解决方案:对es集群索引进行优化,清除历史冷数据。
1487

被折叠的 条评论
为什么被折叠?



