跳到主要内容
跳到主要内容

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;

结果

Row 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

Row 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

另请参阅