# Dangled indices判定条件

**URL:** <https://discuss.elastic.co/t/dangled-indices/123869>\
**Category:** 中文提问与讨论\
**Created:** [March 14, 2018, 9:41am UTC](https://discuss.elastic.co/t/dangled-indices/123869 "2018-03-14T09:41:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![z\_y\_xing](https://avatars.discourse-cdn.com/v4/letter/z/d2c977/32.png) [@z\_y\_xing](https://discuss.elastic.co/u/z_y_xing)\
**Post date:** [March 14, 2018, 9:41am UTC](https://discuss.elastic.co/t/dangled-indices/123869/1 "2018-03-14T09:41:46Z")

</div>

我看了下 [dangling indices](https://www.elastic.co/guide/en/elasticsearch/reference/master/_dangling_indices.html#_dangling_indices)  
里面有这样一句话：  
.....  
any shards stored in its local data directory directory which **do not already exist** in the cluster ...

比较好奇是怎么判断不存在的？

es 日志说这索引是dangling的，然后自动导入了：

```auto
[2018-03-14T12:33:11,873][WARN][o.e.c.m.MetaDataIndexUpgradeService] [master_183_97] [malfunctionlog-20171121/DtbhNG-uS8m8uoNKEL0pDA] ignoring unknown index setting: [index.store.throttle.max_bytes_per_sec] with value [30mb]; archiving
[2018-03-14T12:33:11,875][INFO][o.e.g.LocalAllocateDangledIndices] [master_183_97] auto importing dangled indices [[malfunctionlog-20171121/DtbhNG-uS8m8uoNKEL0pDA]/CLOSE] from [{data_188_54}{YYokJS_-RACuV5LDY94H5Q}{bO723BNsTveimfmnWa1PVQ}{10.8.188.54}{10.8.188.54:9300}{ml.max_open_jobs=10, ml.enabled=true}]
[2018-03-14T12:33:15,385][WARN][o.e.m.j.JvmGcMonitorService] [master_183_97] [gc][7384835] overhead, spent [527ms] collecting in the last [1s]

```

但是我get info是closed的

```auto
GET _cat/indices
...
      close malfunctionlog-20171121 DtbhNG-uS8m8uoNKEL0pDA     
...

```

---

<div class="post-metadata">

**Author:** ![medcl.net](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/medcl.net/32/4414_2.png) [@medcl.net](https://discuss.elastic.co/u/medcl.net)\
**Post date:** [April 10, 2018, 9:20am UTC](https://discuss.elastic.co/t/dangled-indices/123869/2 "2018-04-10T09:20:05Z")

</div>

上面写的很清楚了，当一个节点加入集群的时候，如果集群里面不存在这个索引，但是本地目录里面有这个索引，就会认为其是一个dangling索引，然后会导入进去。具体这个索引是 close 和 open，不在判断的条件里面的。

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 8, 2018, 9:20am UTC](https://discuss.elastic.co/t/dangled-indices/123869/3 "2018-05-08T09:20:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
