# How to restart a server if Elasticsearch encounters "too many files opened" error?

**URL:** <https://discuss.elastic.co/t/how-to-restart-a-server-if-elasticsearch-encounters-too-many-files-opened-error/13121>\
**Category:** Elasticsearch\
**Created:** [August 8, 2013, 6:54am UTC](https://discuss.elastic.co/t/how-to-restart-a-server-if-elasticsearch-encounters-too-many-files-opened-error/13121 "2013-08-08T06:54:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticSearch\_Noob](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@ElasticSearch\_Noob](https://discuss.elastic.co/u/ElasticSearch_Noob)\
**Post date:** [August 8, 2013, 6:54am UTC](https://discuss.elastic.co/t/how-to-restart-a-server-if-elasticsearch-encounters-too-many-files-opened-error/13121/1 "2013-08-08T06:54:38Z")

</div>

Hi good day,

I have an elasticsearch server hosted on a server ( it has 4 CPUs and 8GB  
worth of ram ).  
Everynow and than, i encounter an error which goes "too many files opened".

I fix this by rebooting the server, and than restarting the Elasticsearch  
service.

May I know how do i automate this ?

Alternatively, is there a better one to avoid the "too many files opened"  
error ? I googled around and i understand that i can increase the limit for  
number of files opened for that server.  
But is there a better solution ?

Best Regards.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)\
**Post date:** [August 8, 2013, 6:57am UTC](https://discuss.elastic.co/t/how-to-restart-a-server-if-elasticsearch-encounters-too-many-files-opened-error/13121/2 "2013-08-08T06:57:59Z")

</div>

Hello!

Restarting the server is not the best way, you should rather fix the problem. Look at this tutorial - [http://www.elasticsearch.org/tutorials/too-many-open-files/](http://www.elasticsearch.org/tutorials/too-many-open-files/)

The "Too many files opened" means that ElasticSearch doesn't have all the resources it needs to operate properly - in this case it can't create or open all the needed files, so you should increase your limit.

_--_

Regards,

Rafał Kuć

Sematext :: [http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - ElasticSearch_

Hi good day,

I have an elasticsearch server hosted on a server ( it has 4 CPUs and 8GB worth of ram ).

Everynow and than, i encounter an error which goes "too many files opened".

I fix this by rebooting the server, and than restarting the Elasticsearch service.

May I know how do i automate this ?

Alternatively, is there a better one to avoid the "too many files opened" error ? I googled around and i understand that i can increase the limit for number of files opened for that server.

But is there a better solution ?

Best Regards.

--

You received this message because you are subscribed to the Google Groups "elasticsearch" group.

To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).

For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)\
**Post date:** [August 8, 2013, 7:00am UTC](https://discuss.elastic.co/t/how-to-restart-a-server-if-elasticsearch-encounters-too-many-files-opened-error/13121/3 "2013-08-08T07:00:41Z")

</div>

Hello!

Restarting the server is not the best way, you should rather fix the  
problem. Look at this tutorial -

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

The "Too many files opened" means that Elasticsearch doesn't have all the  
resources it needs to operate properly - in this case it can't create or  
open all the needed files, so you should increase your limit.

--  
Regards,  
Rafał Kuć  
Sematext :: [http://sematext.com/](http://sematext.com/) :: Solr - Lucene - Elasticsearch

W dniu czwartek, 8 sierpnia 2013 08:54:38 UTC+2 użytkownik Elasticsearch  
Noob napisał:

> Hi good day,
> 
> I have an elasticsearch server hosted on a server ( it has 4 CPUs and 8GB  
> worth of ram ).  
> Everynow and than, i encounter an error which goes "too many files opened".
> 
> I fix this by rebooting the server, and than restarting the Elasticsearch  
> service.
> 
> May I know how do i automate this ?
> 
> Alternatively, is there a better one to avoid the "too many files opened"  
> error ? I googled around and i understand that i can increase the limit for  
> number of files opened for that server.  
> But is there a better solution ?
> 
> Best Regards.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:22am UTC](https://discuss.elastic.co/t/how-to-restart-a-server-if-elasticsearch-encounters-too-many-files-opened-error/13121/4 "2017-07-06T02:22:11Z")

</div>

Closed on July 6, 2017, 2:22am UTC


