Skip to main content
Edit this page

clusters

コンフィグファイルに記載されている利用可能なクラスターとそのサーバーについての情報を含んでいます。

カラム:

  • cluster (String) — クラスター名。
  • shard_num (UInt32) — クラスター内のシャード番号。1から始まります。
  • shard_weight (UInt32) — データを書き込む際のシャードの相対的な重み。
  • 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) — ヘッジリクエストで接続を確立する際にレプリカを変更することになった遅延の回数。
  • estimated_recovery_time (UInt32) — レプリカエラーカウントがゼロになり、正常に戻るまでの残り秒数。
  • database_shard_name (String) — Replicated データベースシャードの名前(Replicated データベースに属するクラスターの場合)。
  • database_replica_name (String) — Replicated データベースレプリカの名前(Replicated データベースに属するクラスターの場合)。
  • is_active (Nullable(UInt8)) — Replicated データベースレプリカの状態(Replicated データベースに属するクラスターの場合)。1は「レプリカがオンライン」、0は「レプリカがオフライン」、NULL は「不明」を示します。
  • name (String) - クラスターへのエイリアス。

クエリ:

SELECT * FROM system.clusters LIMIT 2 FORMAT Vertical;

結果:

行 1:
────
cluster: test_cluster_two_shards
shard_num: 1
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_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

参照