Reputation: 131
I am using ELK 6.8.9 all configuration is in my docker-compose file. It was working fine but when suddenly I am getting an error of
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
or org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];
This is how I configure ELK
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.9
environment:
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
volumes:
- /opt/services/data/elasticsearch:/usr/share/elasticsearch/data
ports:
- 9200:9200
user: ${USER_ID}
on calling
curl -XGET 'localhost:9200/_cluster/health/balance_sheet?pretty'-- request
response -clear
{
"cluster_name" : "docker-cluster",
"status" : "red",
"timed_out" : true,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 0,
"active_shards" : 0,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
Upvotes: 6
Views: 13998
Reputation: 71
curl -X PUT "localhost:9200/_all/_settings" -H 'Content-Type: application/json' -d'{ "index.blocks.read_only" : false } }'
curl http://10.146.64.42:9200/_cat/indices
curl http://10.146.64.42:9200/_cluster/health
After a while, the elastic cluster will return to green health status.
Upvotes: 1
Reputation: 11367
Assuming you don't care about the data (as you said in the comments of the question - you can delete your /opt/services/data/elasticsearch
folder in your local machine
Do that while your container is down
and then run up
again.
Upvotes: 1