org.elasticsearch.cluster.block.ClusterBlockException: diblokir oleh: [SERVICE_UNAVAILABLE / 1 / state not recovered / initialized]

Dec 16 2020

Saya menggunakan ELK 6.8.9 semua konfigurasi ada di file docker-compose saya. Itu berfungsi dengan baik tetapi ketika tiba-tiba saya mendapatkan kesalahan

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

Ini adalah cara saya mengkonfigurasi 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}

saat menelepon

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
}

Jawaban

ItayB Dec 16 2020 at 15:15

Dengan asumsi Anda tidak peduli dengan datanya (seperti yang Anda katakan di komentar pertanyaan - Anda dapat menghapus /opt/services/data/elasticsearchfolder Anda di mesin lokal Anda

Lakukan itu saat wadah Anda downdan kemudian jalankan upkembali.