사용중인 노드 제거 방법

ELK|2022. 7. 28. 22:34
728x90

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html

PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.exclude._name" : "타깃노드네임"
  }
}

 

해당을 입력하면 데이터노드의 경우 가지고 있는 샤드가 다른 데이터 노드로 자동 이동 된다고 하나 자동으로 안될 경우

수동 이동을 하도록 하자.

POST _cluster/reroute
{
   "commands": [
      {
         "move": {
            "index": "인덱스명",
            "shard": "보낼샤드넘버,
            "from_node": "현재노드명",
            "to_node": "타겟노드명"
         }
      }
   ]
}

노드타입을 hot warm등 다양 하게 사용 중이라면 잠시 hot -> warm, warm -> hot 등등 이동이 크게 무리가 안가는 상황이라면 exclude대상 노드가 가진 인덱스에 대해서 해당 사용시 reroute보단 편하게 이동 가능

PUT targetindex
{
  "settings": {
	"index.routing.allocation.require.box_type": "hot" 
  }
}

 

댓글()