DBAtlas · 데이터베이스 운영 아틀라스

샤드 크기와 샤드 수 감사 (oversharding / 과대 샤드 탐지)

Elasticsearch유지보수

명령어

# Largest shards (GB):
GET _cat/shards?v&h=index,shard,prirep,state,docs,store,node&s=store:desc&bytes=gb
# Indices by primary size:
GET _cat/indices?v&h=index,pri,rep,docs.count,pri.store.size,store.size&s=pri.store.size:desc&bytes=gb
# Shard count and disk per node:
GET _cat/allocation?v&h=node,shards,disk.indices,disk.percent&s=shards:desc
GET _cluster/stats?filter_path=indices.shards.total,indices.shards.primaries,nodes.count.data
GET _cluster/settings?include_defaults=true&filter_path=*.cluster.max_shards_per_node

하는 일

가장 큰 샤드, 인덱스의 primary 크기, 노드별 샤드 수, 전체 샤드 수, cluster.max_shards_per_node 한도를 나열한다.

사용 시점

용량 계획 중, recovery 시간이 길어지거나 heap 압박이 증가할 때, 그리고 'this action would add [x] 샤드, but this cluster currently has [y]/[z] maximum normal shards open' 오류 시.

주의

아주 작은 샤드가 많으면(oversharding) master와 heap에 부담을 주고, 아주 큰 샤드는 recovery와 rebalancing을 몇 시간으로 늘린다. primary 샤드 수는 인덱스 생성 후 바꿀 수 없으며, 바로잡으려면 shrink, split 또는 reindex가 필요하다. max_shards_per_node를 올리면 한도는 사라지지만 문제는 해결되지 않는다.

DBAtlas에서 열기 →

관련 항목