2
votes

Up until 3 days ago my elastic search(local installation) was working perfectly fine.

Today it stopped working given as connection error.

requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=9200): Max retries exceeded with url:

I tried the following options too.

curl -XGET http://127.0.0.1:9200
curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused

I tried running it manually using the below code and received the following error.

cd /usr/local/Cellar/elasticsearch/2.4.0

ElasticsearchException[failed to read [id:206, legacy:false, file:/usr/local/var/elasticsearch/elasticsearch_sam/nodes/0/_state/global-206.st]]; nested: IOException[failed to read [id:206, legacy:false, file:/usr/local/var/elasticsearch/elasticsearch_sam/nodes/0/_state/global-206.st]]; nested: CorruptStateException[Format version is not supported (resource SimpleFSIndexInput(path="/usr/local/var/elasticsearch/elasticsearch_sam/nodes/0/_state/global-206.st"))

The Elastic search version I am using is 2.4.0 and java version is java version "1.8.0_101" and I am running a MAC system

I have all my data stored in Elastic search without any back up.

I'd be glad if anybody could help me with the situation

Thanks

2
If you open 127.0.0.1:9200 in browser what do you see?Vova Bilyachat
because problem seems to be that ES is not started. Check logsVova Bilyachat
It says "Safari Cant connect to the server"Sam
try to restart ES, and go to logs folder see what is going there?Vova Bilyachat
I am not sure, I didn't have to manually start elastic search earlier. I ran the bin/elasticsearch command going to the installation directory "cd /usr/local/Cellar/elasticsearch/2.4.0". It gives the same error 'ElasticsearchException[failed to read [id:206,..........'Sam

2 Answers

1
votes

You get a CorruptStateException which means Elasticsearch detects an inconsistency in one of it's persistent states.

Basically just identify the broken shard curl -XGET http://localhost:9200/_cluster/state?pretty=true > foo.json The shard(s) will have "INITIALIZING" status and will have their node id associated, which will let you know where is the blocked shard. If you're using one replica, and the other shard is efficiently started, you can just remove the directory containing the broken shard (the one you executer the check index thing) and it should rebuild itself based on the other, uncorrupted shard (from another node).

0
votes

Just in case whoever faced the issue: Guice Exception: ElasticsearchException[failed to read... with Likely root cause: org.elasticsearch.gateway.CorruptStateException: Format version is not supported. Simply remove any folder/files in /usr/local/var/elasticsearch and then the service should be back up and running.

Hope this helps.