org.elasticsearch.cluster.block.ClusterBlockException: bloqué par: [SERVICE_UNAVAILABLE / 1 / état non récupéré / initialisé]

Dec 16 2020

J'utilise ELK 6.8.9 toute la configuration est dans mon fichier docker-compose. Cela fonctionnait bien mais quand soudain, j'obtiens une erreur de

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

Voici comment je 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}

en appelant

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
}

Réponses

ItayB Dec 16 2020 at 15:15

En supposant que vous ne vous souciez pas des données (comme vous l'avez dit dans les commentaires de la question - vous pouvez supprimer votre /opt/services/data/elasticsearchdossier sur votre machine locale

Faites-le pendant que votre conteneur est down, puis réexécutez up.