es进程启动报错has more than one write index

2023-03-22 16:13:04 浏览数 (1)

错误详情:

alias [xg_stat_1500017421_group_api_write_alias] has more than one write index [xg_stat_1500017421_group_api_20221208-000284,xg_stat_1500017421_group_api_20230201-000339]

解决方案:

  • 该节点由于长时间脱离集群,alias的write索引已经改变,而该节点的index alias还记录着老的write index,导致alias冲突,需要拿掉旧索引的元数据来恢复
  • 如果旧索引已经被删除,可通过日志查找关键字来获取索引UUID dangling index exists on local file system, but not in cluster metadata, auto import to cluster state
  • 批量操作
代码语言:shell复制
# 获取 dangling index UUID
grep 'dangling index exists' es-ofcnvrm6-2023-02-01-1.log  | awk '{print $4}' | awk -F'/' '{print $2}' | awk -F']]' '{print $1}' > dangling_index

# 删除 dangling index 元数据
#!/bin/bash
while read line
do
  echo "ll /data*/containers/*/es/data/nodes/0/indices/$line/_state"
  rm -r /data*/containers/*/es/data/nodes/0/indices/$line/_state
  echo "delete success"
done < dangling_index

0 人点赞