elasticsearch system_error ai_generated partial

TranslogException:索引[my_index][0]的事务日志同步失败 - java.nio.file.AccessDeniedException:/data/elasticsearch/nodes/0/indices/.../translog/translog-12345.tlog

TranslogException: failed to sync translog for [my_index][0] - java.nio.file.AccessDeniedException: /data/elasticsearch/nodes/0/indices/.../translog/translog-12345.tlog

ID: elasticsearch/translog-sync-failure

其他格式: JSON · Markdown 中文 · English
80%修复率
86%置信度
1证据数
2025-01-20首次发现

版本兼容性

版本状态引入弃用备注
elasticsearch 7.17.0 active
elasticsearch 8.10.0 active
elasticsearch 8.15.0 active

根因分析

Elasticsearch进程缺少对事务日志文件的写入权限,通常由于文件系统权限更改或磁盘错误引起。

English

The Elasticsearch process lacks write permissions to the translog file, often due to filesystem permission changes or disk errors.

generic

官方文档

https://www.elastic.co/guide/en/elasticsearch/reference/current/translog.html

解决方案

  1. 修复事务日志目录的权限:chown -R elasticsearch:elasticsearch /data/elasticsearch/nodes/0/indices/ 并确保elasticsearch用户有写权限。
  2. 如果磁盘满,通过删除旧索引或增加磁盘容量释放空间,然后重试同步。
  3. 作为最后手段,关闭并重新打开索引以重新生成事务日志:POST /my_index/_close 然后 POST /my_index/_open。这可能会丢弃未提交的更改。

无效尝试

常见但无效的做法:

  1. 90% 失败

    The underlying permissions issue persists; the node will fail again when it tries to sync the translog.

  2. 70% 失败

    Deleting translog can cause data loss and corrupt the shard; Elasticsearch may refuse to start.

  3. 50% 失败

    The new directory may also have permissions issues if not configured correctly.