org.elasticsearch.cluster.block.ClusterBlockException : 차단 대상 : [SERVICE_UNAVAILABLE / 1 / 상태가 복구되지 않음 / 초기화 됨]

Dec 16 2020

ELK 6.8.9를 사용하고 있습니다. 모든 구성은 도커 작성 파일에 있습니다. 잘 작동했지만 갑자기 오류가 발생했습니다.

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

이것이 내가 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}

부름에

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
}

답변

ItayB Dec 16 2020 at 15:15

데이터에 대해 신경 쓰지 않는다고 가정합니다 (질문의 주석에서 말했듯이- /opt/services/data/elasticsearch로컬 컴퓨터에서 폴더를 삭제할 수 있습니다

컨테이너가있는 동안 그렇게 down한 다음 up다시 실행 하십시오.