org.elasticsearch.cluster.block.ClusterBlockException: bị chặn bởi: [SERVICE_UNAVAILABLE / 1 / trạng thái không được phục hồi / khởi tạo]

Dec 16 2020

Tôi đang sử dụng ELK 6.8.9, tất cả cấu hình đều có trong tệp docker-soạn của tôi. Nó đang hoạt động tốt nhưng đột nhiên tôi gặp lỗi

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

Đây là cách tôi định cấu hình 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}

đang gọi

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
}

Trả lời

ItayB Dec 16 2020 at 15:15

Giả sử bạn không quan tâm đến dữ liệu (như bạn đã nói trong phần nhận xét của câu hỏi - bạn có thể xóa /opt/services/data/elasticsearchthư mục của mình trong máy cục bộ của mình

Làm điều đó trong khi vùng chứa của bạn đang hoạt động downvà sau đó chạy uplại.