生产elasticsearch排障 open index fail

我们elasticsearch 进行了批量写入的优化。

1.当前面临的问题是 elasticsearch open index 成功,查询失败。

尝试 close/open

curl xx.xxx.xxx.xxx:9200/test_index/_close

```

{

"acknowledge":"true"

}

```

curl xx.xxx.xxx.xxx:9200/test_index/_open


```

{

"acknowledge":"true"

}

```

问题依旧

2. 尝试 _cluster/reroute

首先通过 

curl xx.xx.xxx.xxx:9200/_cat/shards

看到是test_index 的所有primary shard UNASSIGNED

因此尝试使用

curl xx.xx.xxx.xxx:9200/_cluster/reroute

{

"allocate":{

"index":"test_index",

"shard":0,

"node":"yyyyyyyyyyyyyy"

}

}

报错, primary shard not assigned

经过百度搜索,查看了es的文档,有以下接口进行分析

curl xx.xx.xx.xx:9200/_cluster/allocation/explain

发现某个文件错误是 "ACCESS DENIED EXCEPTION"

原来是shard 的文件没有权限

原文地址:https://www.cnblogs.com/lykm02/p/13936888.html