Reputation: 2605
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
Upvotes: 2
Views: 4211
Reputation: 1508
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.
Upvotes: 0
Reputation: 3408
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).
Upvotes: 1