콘텐츠로 이동

OpenSearch Cluster Monitoring과 Incident Response 설계하기

Interactive Diagram

새 탭 ↗

OpenSearch Alerting 화면에 monitor를 많이 만들어도 운영자가 원인을 빨리 찾는 것은 아니다. cluster health의 yellow는 replica 부족일 수 있고, red는 primary shard 손실일 수 있다. node disk 사용률은 즉시 장애가 아니지만 allocation watermark를 넘으면 새로운 shard 배치와 recovery를 막는다. Alert는 상태를 복사하는 기능이 아니라 운영자의 다음 행동을 좁히는 signal이어야 한다.

이 글은 Cluster → Node → Index → Shard의 관측 계층을 Alert lifecycle과 incident response로 연결한다. Integration Alerting과 Metrics 설계가 업무 Event와 Interface Error를 다룬다면, 여기서는 search cluster 자체의 availability와 capacity를 다룬다.

Monitor는 상태와 조치를 연결한다

섹션 제목: “Monitor는 상태와 조치를 연결한다”
PlantUML Diagram

한 monitor는 input, condition, duration, severity, grouping key, notification policy를 가진 versioned object여야 한다. threshold를 넘는 순간마다 같은 message를 보내면 transient spike와 planned rolling update가 on-call을 압도한다. signal이 일정 기간 지속되는지, 같은 root cause인지, 이미 acknowledgement 되었는지를 Alert history에서 분리한다.

Cluster health는 색상 이상의 의미를 가진다

섹션 제목: “Cluster health는 색상 이상의 의미를 가진다”

_cluster/health는 빠른 시작점이지만 색상만 보고 incident severity를 결정하면 안 된다.

상태일반적 의미우선 확인기본 대응
Greenprimary와 replica가 모두 assignedbaseline metric관찰
Yellowprimary는 assigned, 일부 replica는 unassignedreplica 수, node 수, planned maintenancetime-bound warning 또는 maintenance suppression
Red하나 이상의 primary가 unassigned영향 index, data availability, recent node loss즉시 page와 allocation investigation

yellow에서도 replica 없는 primary node가 다시 죽으면 data availability가 red로 갈 수 있다. 반대로 rolling upgrade 직후의 짧은 yellow는 자동 recovery 중일 수 있다. 그래서 status != green 하나만으로 paging하지 않는다. status, 지속 시간, affected primary 여부, maintenance window, index criticality를 함께 판단한다.

{
"monitor": "cluster-health",
"input": { "path": "_cluster/health" },
"trigger": {
"warning": "status == 'yellow' for 10m outside maintenance",
"critical": "status == 'red' or unassigned_primary > 0"
},
"group_by": ["cluster", "status"],
"dedup_window": "15m"
}

예시는 policy shape를 보여 준다. 실제 monitor syntax와 metric field는 사용하는 OpenSearch Alerting version에서 검증한다. production incident message에는 cluster name, status, first observed time, affected index count, runbook link처럼 조치에 필요한 최소 context를 넣고 customer payload나 credential을 넣지 않는다.

Node pressure는 allocation failure보다 먼저 본다

섹션 제목: “Node pressure는 allocation failure보다 먼저 본다”

_nodes/stats와 _cat/allocation은 CPU, JVM heap, filesystem, shard skew를 관찰하는 기본 source다. threshold는 제품 공통 상수가 아니라 workload와 node class별 baseline에서 나온다.

signal왜 보는가Alert 설계
Disk used / watermarkallocation, merge, relocation 여유growth rate와 free bytes를 함께 확인
JVM heapGC pressure와 query/indexing failure 전조sustained usage와 GC time을 결합
CPUingest/query saturationqueue, rejected request와 함께 판단
Thread pool rejectionrequest가 이미 거부됨즉시 영향 신호로 grouping
Shard count per nodeskew와 recovery blast radiuscapacity planning signal

예를 들어 disk 75%를 무조건 critical로 두면 large disk node와 small disk node의 위험을 같은 방식으로 처리한다. percentage와 absolute free space, 증가 추세, high/flood-stage watermark를 함께 쓴다. disk가 높은데 write가 계속 들어오면 shard relocation 자체가 disk와 network를 더 써서 상황을 악화시킬 수 있으므로, retention/rollover와 ingest throttling 선택지를 runbook에 둔다.

JVM heap도 단일 sample보다 지속 시간, old-gen pressure, GC pause, rejected request가 중요하다. heap이 높다는 이유로 무작정 restart하면 shard recovery와 cache warm-up으로 incident를 키울 수 있다. query surge, aggregation cardinality, shard imbalance, memory leak 후보를 먼저 분리한다.

같은 metric이라도 node pool에 따라 의미가 다르다. Pool을 구분하지 않고 cluster 평균만 보면 한쪽의 포화가 다른 쪽의 여유에 가려진다.

node pool주로 포화되는 자원그 signal이 실제로 뜻하는 것
Hot datadisk write, merge I/O, heapingest rate가 rollover와 merge 여유를 넘어섰다
Cold datadisk capacity, relocation networkretention 기간이나 transition 속도가 tier 용량과 맞지 않는다
Cluster-managerheap, cluster state 갱신 지연shard/index 수가 많거나 pending task가 쌓였다
Ingest/coordinatingCPU, thread pool rejectionbulk 유입 또는 search fan-out이 계층 용량을 넘었다

Alert에 node pool label을 함께 넣어야 위 표를 실제로 쓸 수 있다. disk > 80%라는 message 하나로는 ingest throttling이 필요한 상황인지, Cold tier를 늘려야 하는 상황인지 구분되지 않는다.

Index와 shard는 data availability 경계다

섹션 제목: “Index와 shard는 data availability 경계다”

_cat/indices, _cat/shards, _cluster/allocation/explain은 어떤 index가 어떤 이유로 allocate되지 않는지 좁혀 준다. UNASSIGNED는 하나의 원인이 아니라 상태다.

두 Node에 Index 1, Index 2의 primary shard와 replica shard가 서로 다른 Node에 나뉘어 배치된 OpenSearch cluster 출처: OpenSearch 문서, Intro to OpenSearch, OpenSearch contributors, Apache-2.0

증상가능한 원인첫 진단
Unassigned replicanode 부족, allocation filter, disk watermarkallocation explanation, node tier 확인
Unassigned primarynode loss, corrupted shard, restore 필요affected index, last snapshot, recovery log 확인
Relocating shard가 장시간 지속disk/network pressure, throttling, large shardrelocation bytes, target disk, recovery rate 확인
Red indexprimary unavailablewrite/read impact와 restore path 확인
Rollover 후 write failuretemplate/policy/allocation 불일치write index와 ISM explain 확인

replica가 primary로 승격됐다고 해서 복구가 끝난 것은 아니다. 새 replica가 만들어질 때까지 fault tolerance는 낮다. alert 메시지는 unassigned shard exists에서 멈추지 말고 primary/replica 구분, index criticality, allocation reason을 포함해야 한다. 반대로 수백 replica가 같은 node drain으로 잠시 unassigned일 때는 개별 shard notification을 보내지 않고 incident 하나로 group한다.

Alert lifecycle과 notification을 분리한다

섹션 제목: “Alert lifecycle과 notification을 분리한다”

Alert 자체와 전달 channel을 같은 transaction으로 만들지 않는다. Alert history가 저장됐지만 webhook이 실패할 수 있고, notification이 재시도되는 동안 monitor evaluation은 계속되어야 한다.

상태의미운영 동작
OPENcondition이 새로 충족notification과 triage 시작
ACKNOWLEDGED담당자가 확인duplicate page 억제, investigation 유지
SUPPRESSEDmaintenance 또는 known issuehistory는 남기고 page 억제
RESOLVEDrecovery condition 충족recovery notification과 evidence 보관
ESCALATEDSLO 또는 duration 초과더 높은 on-call tier 호출

grouping key는 root cause에 가깝게 잡는다. cluster health Alert는 (cluster, status) 정도가 적절하지만, node disk Alert는 (cluster, node)가 필요할 수 있다. dedup key에는 time window를 포함해 같은 condition이 매 evaluation마다 새 history row를 만들지 않게 한다. notification channel은 internal service host, static token, vendor endpoint를 monitor configuration에 hard-code하지 않는다. secret reference와 separate notification adapter를 사용해 rotate·audit·retry를 분리한다.

Dev Tools는 진단 도구이며 변경 도구다

섹션 제목: “Dev Tools는 진단 도구이며 변경 도구다”

Dev Tools에서 실행하는 query는 read-only 확인과 destructive change를 엄격히 구분한다.

GET _cluster/health
GET _cat/allocation?v
GET _cat/shards?v&s=state
GET _nodes/stats/fs,jvm,process
GET _cluster/allocation/explain

이 명령은 symptom을 확인하기 위한 시작점이다. DELETE _data_stream/..., system index 삭제, force allocation, policy state 강제 변경은 incident commander 승인과 backup 확인 없이 runbook에 “첫 명령”으로 넣지 않는다. Alert history가 너무 많다는 현상은 retention, notification loop, monitor condition을 먼저 고칠 신호이지, history index를 바로 지우라는 신호가 아니다.

  1. Alert가 maintenance suppression 밖에서 지속되는지, alert grouping이 같은 root cause를 가리키는지 확인한다.
  2. cluster health에서 primary availability와 affected index 범위를 확인한다.
  3. node disk, heap, CPU, network, recent rollout과 allocation explanation으로 원인을 좁힌다.
  4. write throttling, replica recovery, capacity extension, snapshot restore 중 영향이 가장 작은 조치를 선택한다.
  5. recovery 후 Green 여부만 보지 말고 replica 재생성, ISM progress, ingest backlog, search error rate를 확인한다.
  6. incident history에 timeline, 선택한 조치, data-loss 여부, 후속 capacity 또는 rule 개선을 남긴다.
  1. test cluster에서 replica를 의도적으로 unassign하고 warning/critical grouping이 예상대로 나오는지 확인한다.
  2. synthetic disk growth와 node pressure를 주입해 duration, throttle, escalation이 동작하는지 확인한다.
  3. maintenance window에 planned rolling restart를 수행해 suppression이 history를 남기되 page를 억제하는지 확인한다.
  4. notification adapter를 일시 중단해 Alert history와 delivery retry가 독립적으로 기록되는지 확인한다.
  5. restore drill 뒤 cluster health, shard allocation, Data Stream write, query latency가 baseline으로 돌아오는지 확인한다.

OpenSearch monitoring은 green/yellow/red를 이메일로 보내는 일이 아니다. Cluster health는 availability, node pressure는 capacity, index와 shard는 data placement, Alert lifecycle은 사람의 대응 경계를 나타낸다. 이 신호를 duration·grouping·suppression·runbook과 함께 설계해야 planned change의 noise와 실제 primary loss를 구분하고, 단순 경보를 재현 가능한 incident response로 바꿀 수 있다.

이 글은 Kubernetes에서 OpenSearch Hot/Cold Storage와 Index Lifecycle 설계하기의 capacity signal, OpenSearch TLS와 Least-Privilege RBAC 구성하기의 identity boundary, Integration Alerting과 Metrics 설계의 application signal을 하나의 운영 흐름으로 연결한다.