Ubuntu – Elasticsearch stopped working suddenly

elasticsearchjavaUbuntuvps

I have deployed Elasticsearch on a development Ubuntu VPS.
We use that VPS only to host API for mobile apps.

Everything worked good till today, elasticsearch stopped working.

I tried to restart it, it says "Server ok" but when I check the status it gives me: "is not running".

The Ruby on Rails app log contains:

Errno::ECONNREFUSED (Connection refused - connect(2))

After that, I start getting this error: Too many open files

Can anyone help me?

Best Answer

Too many open files

/etc/security/limits.d/elasticsearch.conf

elasticsearch soft nofile 32000
elasticsearch hard nofile 32000

The look at your init script for the ulimit setting and raise it.

if [ -n "$MAX_OPEN_FILES" ]; then
    ulimit -n $MAX_OPEN_FILES
fi

On my ubuntu server, I also had to edit /etc/defaults/elasticsearch.

See generally:

http://www.elasticsearch.org/tutorials/too-many-open-files/

Related Topic