# Failed to read latest segment infos on flush

**URL:** <https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438>\
**Category:** Elasticsearch\
**Created:** [October 17, 2015, 7:58pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438 "2015-10-17T19:58:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![genesis](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@genesis](https://discuss.elastic.co/u/genesis)\
**Post date:** [October 17, 2015, 7:58pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/1 "2015-10-17T19:58:58Z")

</div>

Any idea why I am getting:  
2015-10-17 19:37:57,551][WARN][index.engine.internal] [ElasticSearch-18] [abc-2015.10.13][4] failed to read latest segment infos on flush  
java.nio.file.FileSystemException: /var/data/elasticsearch4/Media/nodes/0/indices/abc-2015.10.13/4/index/\_eqn.si: Too many open files  
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)

more /etc/sysconfig/elasticsearch

# Directory where the Elasticsearch binary distribution resides

ES\_HOME=/usr/share/elasticsearch

# Maximum number of open files

MAX\_OPEN\_FILES=65535

cat /etc/security/limits.conf

# End of file

- soft core unlimited
- soft memlock unlimited
- hard memlock unlimited

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 18, 2015, 9:01pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/2 "2015-10-18T21:01:30Z")

</div>

> [@genesis](#):
>
> Too many open files

I'd check that your ulimit changes have been applied, you can get that from the `_nodes` API endpoint.

---

<div class="post-metadata">

**Author:** ![genesis](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@genesis](https://discuss.elastic.co/u/genesis)\
**Post date:** [October 19, 2015, 2:55am UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/3 "2015-10-19T02:55:22Z")

</div>

Can you please elaborate?  
It is a 12 nodes cluster, with 3 masters and 9 data nodes

stats | grep open\_file\_descriptors  
"open\_file\_descriptors" : 48827,  
"open\_file\_descriptors" : 60585,  
"open\_file\_descriptors" : 65211,  
"open\_file\_descriptors" : 420,  
"open\_file\_descriptors" : 64604,  
"open\_file\_descriptors" : 63084,  
"open\_file\_descriptors" : 64135,  
"open\_file\_descriptors" : 453,  
"open\_file\_descriptors" : 62657,  
"open\_file\_descriptors" : 63350,  
"open\_file\_descriptors" : 417,  
"open\_file\_descriptors" : 64252,  
the 420, 453 & 417 are from the master servers.  
Please advice

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 19, 2015, 6:11am UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/4 "2015-10-19T06:11:33Z")

</div>

You are so close to the 65k limit.  
You might have too many shards on your cluster .

How many do you have?

---

<div class="post-metadata">

**Author:** ![mikemccand](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mikemccand](https://discuss.elastic.co/u/mikemccand)\
**Post date:** [October 19, 2015, 10:12am UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/5 "2015-10-19T10:12:14Z")

</div>

Did you change any low-level index settings, e.g. for compound file format?

---

<div class="post-metadata">

**Author:** ![genesis](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@genesis](https://discuss.elastic.co/u/genesis)\
**Post date:** [October 19, 2015, 1:32pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/6 "2015-10-19T13:32:52Z")

</div>

{  
"cluster\_name" : "abcmedia",  
"status" : "green",  
"timed\_out" : false,  
"number\_of\_nodes" : 12,  
"number\_of\_data\_nodes" : 9,  
"active\_primary\_shards" : 4377,  
"active\_shards" : 8754,  
"relocating\_shards" : 2,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 0  
}

---

<div class="post-metadata">

**Author:** ![genesis](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@genesis](https://discuss.elastic.co/u/genesis)\
**Post date:** [October 19, 2015, 1:34pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/7 "2015-10-19T13:34:07Z")

</div>

No, we have not made any configuration changes.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 19, 2015, 10:17pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/8 "2015-10-19T22:17:37Z")

</div>

That's a _massive_ number of shards for that many nodes, you need to reduce that.

---

<div class="post-metadata">

**Author:** ![genesis](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@genesis](https://discuss.elastic.co/u/genesis)\
**Post date:** [October 20, 2015, 3:44pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/9 "2015-10-20T15:44:31Z")

</div>

Do you mean reduce the number of shards or increase the number of nodes?

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 20, 2015, 5:46pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/10 "2015-10-20T17:46:45Z")

</div>

Reduce the number of shards. Each shard is basically a separate Lucene  
index, so each one will consume file resources.

Ivan

---

<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:** [July 5, 2017, 11:43pm UTC](https://discuss.elastic.co/t/failed-to-read-latest-segment-infos-on-flush/32438/11 "2017-07-05T23:43:48Z")

</div>


