ELASTICSEARCH Health red 솔루션
7564 단어 elasticsearch
액세스/_cat/shards 회보 blocked by: [SERVICE_UNAVAILABLE/1/state not recovered/오류, 그리고head는 es 집단을 연결할 수 없습니다. 집단 상태는 red입니다.
curl http://metron01:9200/_cat/health?v
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1534901569 09:32:49 metron green 3 2 2 1 0 0 0 0 - NaN%
2. 색인 디렉터리에서 파일 삭제
elasticsearch.yml data
data: "/home/opt/lmm/es_data"
#
rm -rf /home/opt/lmm/es_data/*
3. shards는 UNASSIGNED가 있음
# UNASSIGNED
curl -s "http://localhost:9200/_cat/shards" | grep UNASSIGNED
snort_index_2018.08.17.15 2 p UNASSIGNED
snort_index_2018.08.17.15 2 r UNASSIGNED
snort_index_2018.08.17.15 1 p UNASSIGNED
snort_index_2018.08.17.15 1 r UNASSIGNED
snort_index_2018.08.17.15 3 p UNASSIGNED
snort_index_2018.08.17.15 3 r UNASSIGNED
snort_index_2018.08.17.15 0 p UNASSIGNED
snort_index_2018.08.17.15 0 r UNASSIGNED
# snort_index_2018.08.17.15 0,1,2,3
데이터 node ID 조회
curl 'localhost:9200/_nodes/process?pretty'
{
"cluster_name" : "metron",
"nodes" : {
"I3_T2xI1RGCocy7sZcdg9w" : {
"name" : "metron03",
"transport_address" : "172.16.16.59:9300",
"host" : "172.16.16.59",
"ip" : "172.16.16.59",
"version" : "2.3.3",
"build" : "218bdf1",
"http_address" : "172.16.16.59:9200",
"attributes" : {
"master" : "false"
},
"process" : {
"refresh_interval_in_millis" : 1000,
"id" : 16002,
"mlockall" : false
}
},
"xOk36eUVQhSgAHYv6VT77Q" : {
"name" : "metron01",
"transport_address" : "172.16.16.57:9300",
"host" : "172.16.16.57",
"ip" : "172.16.16.57",
"version" : "2.3.3",
"build" : "218bdf1",
"http_address" : "172.16.16.57:9200",
"attributes" : {
"data" : "false",
"master" : "true"
},
"process" : {
"refresh_interval_in_millis" : 1000,
"id" : 25044,
"mlockall" : false
}
},
"ncgAeS6nQp-L0d3U0roVMA" : {
"name" : "metron02",
"transport_address" : "172.16.16.58:9300",
"host" : "172.16.16.58",
"ip" : "172.16.16.58",
"version" : "2.3.3",
"build" : "218bdf1",
"http_address" : "172.16.16.58:9200",
"attributes" : {
"master" : "false"
},
"process" : {
"refresh_interval_in_millis" : 1000,
"id" : 12653,
"mlockall" : false
}
}
}
}
모든shard와 번호에 대한reroute 실행
curl -XPOST 'metron01:9200/_cluster/reroute' -d '{
"commands" : [ {
"allocate" : {
"index" : "snort_index_2018.08.17.15", #
"shard" : 0, # shard ID
"node" : "I3_T2xI1RGCocy7sZcdg9w", # data node ID
"allow_primary" : true
}
}
]
}'
curl -XPOST 'metron01:9200/_cluster/reroute' -d '{
"commands" : [ {
"allocate" : {
"index" : "snort_index_2018.08.17.15",
"shard" : 1,
"node" : "I3_T2xI1RGCocy7sZcdg9w",
"allow_primary" : true
}
}
]
}'
curl -XPOST 'metron01:9200/_cluster/reroute' -d '{
"commands" : [ {
"allocate" : {
"index" : "snort_index_2018.08.17.15",
"shard" : 2,
"node" : "I3_T2xI1RGCocy7sZcdg9w",
"allow_primary" : true
}
}
]
}'
curl -XPOST 'metron01:9200/_cluster/reroute' -d '{
"commands" : [ {
"allocate" : {
"index" : "snort_index_2018.08.17.15",
"shard" : 3,
"node" : "I3_T2xI1RGCocy7sZcdg9w",
"allow_primary" : true
}
}
]
}'
다음 오류가 발생하면
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "[allocate] allocation of [.kibana][0] on node {metron03}{WPJIoZ6CRTetEAH_j8nPBw}{172.16.16.59}{172.16.16.59:9300}{master=false} is not allowed, reason: [YES(primary is already active)][YES(allocation disabling is ignored)][YES(target node version [2.3.3] is same or newer than source node version [2.3.3])][YES(node passes include/exclude/require filters)][YES(total shard limit disabled: [index: -1, cluster: -1] <= 0)][YES(no allocation awareness enabled)][YES(enough disk for shard on node, free: [187.9gb])][YES(allocation disabling is ignored)][YES(shard not primary or relocation disabled)][YES(below shard recovery limit of [4])][NO(shard cannot be allocated on same node [WPJIoZ6CRTetEAH_j8nPBw] it already exists on)]"
}
],
"type": "illegal_argument_exception",
"reason": "[allocate] allocation of [.kibana][0] on node {metron03}{WPJIoZ6CRTetEAH_j8nPBw}{172.16.16.59}{172.16.16.59:9300}{master=false} is not allowed, reason: [YES(primary is already active)][YES(allocation disabling is ignored)][YES(target node version [2.3.3] is same or newer than source node version [2.3.3])][YES(node passes include/exclude/require filters)][YES(total shard limit disabled: [index: -1, cluster: -1] <= 0)][YES(no allocation awareness enabled)][YES(enough disk for shard on node, free: [187.9gb])][YES(allocation disabling is ignored)][YES(shard not primary or relocation disabled)][YES(below shard recovery limit of [4])][NO(shard cannot be allocated on same node [WPJIoZ6CRTetEAH_j8nPBw] it already exists on)]"
},
"status": 400
}
복사본 수를 0으로 설정하면 es는 자동으로 남은 복사본을 삭제하고 다시 2로 바꾸어 처리할 수 있습니다.
curl -XPUT http://metron01:9200/.kibana/_settings -d'{
"index" : {
"number_of_replicas" : 0
}
}'
:{"acknowledged":true}
curl -XPUT http://metron01:9200/.kibana/_settings -d'{
"index" : {
"number_of_replicas" : 2
}
}'
:{"acknowledged":true}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
kafka connect e elasticsearch를 관찰할 수 있습니다.No menu lateral do dashboard tem a opção de connectors onde ele mostra todos os clusters do kafka connect conectados atu...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.