> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 設定ファイルで利用可能なクラスターと、それらの中で定義されている サーバーに関する情報を含む system table。

# system.clusters

<div id="description">
  ## 説明
</div>

設定ファイルで利用可能なクラスターと、それらに含まれるサーバーに関する情報が含まれます。

<div id="Columns">
  ## カラム
</div>

* `cluster` ([String](/ja/reference/data-types)) — クラスター名。
* `shard_num` ([UInt32](/ja/reference/data-types)) — クラスター内の分片番号。1 から始まります。
* `shard_name` ([String](/ja/reference/data-types)) — クラスター内の分片名。
* `shard_weight` ([UInt32](/ja/reference/data-types)) — データ書き込み時の分片の相対的な重み。
* `internal_replication` ([UInt8](/ja/reference/data-types)) — このホストが、自身でデータをレプリケートできる構成の一部であるかどうかを示すフラグ。
* `replica_num` ([UInt32](/ja/reference/data-types)) — 分片内のレプリカ番号。1 から始まります。
* `host_name` ([String](/ja/reference/data-types)) — 設定で指定されたホスト名。
* `host_address` ([String](/ja/reference/data-types)) — DNS から取得したホストの IP アドレス。
* `port` ([UInt16](/ja/reference/data-types)) — サーバーへの接続に使用するポート。
* `is_local` ([UInt8](/ja/reference/data-types)) — ホストがローカルであるかどうかを示すフラグ。
* `user` ([String](/ja/reference/data-types)) — サーバーへの接続に使用するユーザー名。
* `default_database` ([String](/ja/reference/data-types)) — デフォルトのデータベース名。
* `errors_count` ([UInt32](/ja/reference/data-types)) — このホストがレプリカへの到達に失敗した回数。
* `slowdowns_count` ([UInt32](/ja/reference/data-types)) — ヘッジドリクエストで接続を確立する際に、レプリカの切り替えにつながった遅延の回数。
* `estimated_recovery_time` ([UInt32](/ja/reference/data-types)) — レプリカのエラー回数が 0 にリセットされ、正常に戻ったと見なされるまでの残り秒数。
* `database_shard_name` ([String](/ja/reference/data-types)) — `Replicated` データベースの分片名 (`Replicated` データベースに属するクラスターの場合) 。
* `database_replica_name` ([String](/ja/reference/data-types)) — `Replicated` データベースのレプリカ名 (`Replicated` データベースに属するクラスターの場合) 。
* `is_shared_catalog_cluster` ([UInt8](/ja/reference/data-types)) — クラスターが Shared Catalog に属しているかどうかを示す Bool。
* `is_active` ([Nullable(UInt8)](/ja/reference/data-types)) — `Replicated` データベースのレプリカの状態 (`Replicated` データベースに属するクラスターの場合) 。1 は 'レプリカはオンライン'、0 は 'レプリカはオフライン'、NULL は '不明' を意味します。
* `unsynced_after_recovery` ([Nullable(UInt8)](/ja/reference/data-types)) — `Replicated` データベースのレプリカの作成または復旧後に、そのレプリカのレプリケーションラグが max\_replication\_lag\_to\_enqueue を超えているかどうかを示します。
* `replication_lag` ([Nullable(UInt32)](/ja/reference/data-types)) — `Replicated` データベースのレプリカのレプリケーションラグ (`Replicated` データベースに属するクラスターの場合) 。
* `recovery_time` ([Nullable(UInt64)](/ja/reference/data-types)) — `Replicated` データベースのレプリカの復旧時間 (`Replicated` データベースに属するクラスターの場合) 。単位はミリ秒です。

<div id="example">
  ## 例
</div>

```sql title="Query" theme={null}
SELECT * FROM system.clusters LIMIT 2 FORMAT Vertical;
```

```text title="Response" theme={null}
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

Row 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
```

<div id="see-also">
  ## 関連項目
</div>

* [テーブルエンジン「Distributed」](/ja/reference/engines/table-engines/special/distributed)
* [distributed\_replica\_error\_cap 設定](/ja/reference/settings/session-settings#distributed_replica_error_cap)
* [distributed\_replica\_error\_half\_life 設定](/ja/reference/settings/session-settings#distributed_replica_error_half_life)
