org.elasticsearch.cluster.block.ClusterBlockException: zablokowany przez: [SERVICE_UNAVAILABLE / 1 / stan nieodzyskany / zainicjowany]

Dec 16 2020

Używam ELK 6.8.9, cała konfiguracja znajduje się w moim pliku Docker-Compose. Działało dobrze, ale nagle pojawia się błąd

org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
or org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];

Tak konfiguruję 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}

dzwoniąc

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
}

Odpowiedzi

ItayB Dec 16 2020 at 15:15

Zakładając, że nie dbasz o dane (jak powiedziałeś w komentarzach do pytania - możesz usunąć swój /opt/services/data/elasticsearchfolder na komputerze lokalnym

Zrób to, gdy twój kontener jest, downa następnie uruchom upponownie.