kgneng2 / blokg

blog
MIT License
0 stars 0 forks source link

unassigned 된 shard 처리 #60

Open kgneng2 opened 2 years ago

kgneng2 commented 2 years ago

1. DELETE

1. cluster 상태확인

http://host:10200/_cluster/health?pretty

2. unassinged 된 shard

2. shard allocation is delayed

curl -XPUT "localhost:9200/<INDEX_NAME>/_settings?pretty" -H 'Content-Type: application/json' -d'
{
  "settings": {
    "index.unassigned.node_left.delayed_timeout": "5m"
  }
}'

3. too many shard

N >= R + 1 

replica 갯수가 Node수보다 작아야한다

4. re-enable shard allocation

PUT _cluster/settings
{
  "transient": {
     "cluster.routing.allocation.enable" : "all"
  }
}

Refererence

kgneng2 commented 2 years ago

curl -XGET http://localhost:9200/_cat/shards | grep UNASSIGNED | awk {'print $1'} | xargs -i curl -XDELETE "/{}"