본문으로 바로가기
본문으로 바로가기

system.clusters

config 파일에 정의된 클러스터와 각 클러스터에 속한 서버에 대한 정보를 포함합니다.

컬럼:

  • cluster (String) — 클러스터 이름입니다.
  • shard_num (UInt32) — 클러스터에서의 세그먼트 번호입니다. 1부터 시작합니다.
  • shard_name (String) — 클러스터에서 세그먼트 이름입니다.
  • shard_weight (UInt32) — 데이터를 기록할 때 세그먼트의 상대 가중치입니다.
  • internal_replication (UInt8) — 이 호스트가 스스로 데이터를 복제할 수 있는 앙상블의 일부인지 나타내는 플래그입니다.
  • replica_num (UInt32) — 세그먼트 내 레플리카 번호입니다. 1부터 시작합니다.
  • host_name (String) — 설정에 지정된 호스트 이름입니다.
  • host_address (String) — DNS에서 가져온 호스트 IP 주소입니다.
  • port (UInt16) — 서버에 연결하는 데 사용하는 포트입니다.
  • is_local (UInt8) — 호스트가 로컬인지 나타내는 플래그입니다.
  • user (String) — 서버에 연결하는 데 사용하는 사용자 이름입니다.
  • default_database (String) — 기본 데이터베이스 이름입니다.
  • errors_count (UInt32) — 이 호스트가 레플리카에 도달하는 데 실패한 횟수입니다.
  • slowdowns_count (UInt32) — hedged 요청으로 연결을 설정할 때 레플리카를 변경하게 만든 지연 발생 횟수입니다.
  • estimated_recovery_time (UInt32) — 레플리카 오류 수가 0으로 초기화되어 정상 상태로 간주되기까지 남은 시간(초)입니다.
  • database_shard_name (String) — Replicated 데이터베이스 세গ먼트 이름입니다 (Replicated 데이터베이스에 속한 클러스터의 경우).
  • database_replica_name (String) — Replicated 데이터베이스 레플리카 이름입니다 (Replicated 데이터베이스에 속한 클러스터의 경우).
  • is_shared_catalog_cluster (UInt8) — 클러스터가 공유 카탈로그에 속하는지 여부를 나타내는 불리언 값입니다.
  • is_active (Nullable(UInt8)) — Replicated 데이터베이스 레플리카의 상태입니다 (Replicated 데이터베이스에 속한 클러스터의 경우). 1이면 「replica is online」, 0이면 「replica is offline」, NULL이면 「unknown」을 의미합니다.
  • unsynced_after_recovery (Nullable(UInt8)) — 레플리카를 생성하거나 복구한 후 max_replication_lag_to_enqueue보다 큰 복제 지연이 Replicated 데이터베이스 레플리카에 있는지 여부를 나타냅니다.
  • replication_lag (Nullable(UInt32)) — Replicated 데이터베이스 레플리카의 복제 지연입니다 (Replicated 데이터베이스에 속한 클러스터의 경우).
  • recovery_time (Nullable(UInt64)) — Replicated 데이터베이스 레플리카의 복구 시간입니다 (Replicated 데이터베이스에 속한 클러스터의 경우). 밀리초 단위입니다.

예제

쿼리:

SELECT * FROM system.clusters LIMIT 2 FORMAT Vertical;

결과:

Row 1:
──────
cluster:                 test_cluster_two_shards
shard_num:               1
shard_name:              shard_01
shard_weight:            1
replica_num:             1
host_name:               127.0.0.1
host_address:            127.0.0.1
port:                    9000
is_local:                1
user:                    default
default_database:
errors_count:            0
slowdowns_count:         0
estimated_recovery_time: 0
database_shard_name:
database_replica_name:
is_active:               NULL

2행: ────── cluster: test_cluster_two_shards shard_num: 2 shard_name: shard_02 shard_weight: 1 replica_num: 1 host_name: 127.0.0.2 host_address: 127.0.0.2 port: 9000 is_local: 0 user: default default_database: errors_count: 0 slowdowns_count: 0 estimated_recovery_time: 0 database_shard_name: database_replica_name: is_active: NULL


**See Also**

- [Table engine Distributed](../../engines/table-engines/special/distributed.md)
- [distributed_replica_error_cap setting](../../operations/settings/settings.md#distributed_replica_error_cap)
- [distributed_replica_error_half_life setting](../../operations/settings/settings.md#distributed_replica_error_half_life)