[Elasticsearch] 노드 교체

HI·2022년 6월 22일
0

elasticsearch 운영

목록 보기
5/7

무중단 노드 교체

교체작업전 사용중인 모든 인덱스는 replica를 가지고 있어야한다.
그래야 한노드가 떨어져도 클러스터는 yellow 상태를 유지해 검색에 문제가 발생하지 않는다.

그럼 A노드를 제거하고 B노드를 추가해보겠다.

1. shard routing none 샤드 재배치 방지 하기.

#샤드 움직이지 않게
PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.enable": "none"
  }
}

2. 추가할 B 노드 start

./start.sh

3. 제거할 A 노드 stop

./stop.sh

4. 추가한 B 노드 클러스터에 들어왔는지 확인

GET _cat/nodes?s=name

5. shard routing null

샤드가 다시 할당될 수 있도록한다.
primiary는 있기때문에 알아서 replica를 생성할 것이다.

PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.enable": null
  }
}

6. shard가 initializing 되는지 모니터링

7. shard initializing 수 조절, 속도 조절

PUT /_cluster/settings
{
  "transient": {
    "indices.recovery.max_bytes_per_sec": "60mb", //default:40mb
    "cluster.routing.allocation.node_concurrent_recoveries" : 2 , // default:2
    "cluster.routing.allocation.node_concurrent_incoming_recoveries" : 2 //default:2
  }
}
profile
https://github.com/gaeunban

0개의 댓글