跳转到主要内容

描述

包含各个 Replicated 数据库副本的信息。

  • database (String) — 所属 Replicated 数据库的名称。
  • is_readonly (UInt8) — 数据库副本是否处于只读模式。
  • max_log_ptr (Int32) — 常规活动日志中的最大条目编号。
  • replica_name (String) — ClickHouse Keeper 中的副本名称。
  • replica_path (String) — ClickHouse Keeper 中副本数据的路径。
  • zookeeper_path (String) — ClickHouse Keeper 中数据库数据的路径。
  • shard_name (String) — 集群中分片的名称。
  • log_ptr (Int32) — 副本已复制到其执行队列的常规活动日志中的最大条目编号,再加一。
  • total_replicas (UInt32) — 该数据库已知副本的总数。
  • zookeeper_exception (String) — 最近一次异常的消息;如果在从 ClickHouse Keeper 拉取信息时发生错误,则会返回该消息。
  • is_session_expired (UInt8) — 与 ClickHouse Keeper 的会话已过期。基本等同于 is_readonly

示例

SELECT * FROM system.database_replicas FORMAT Vertical;
Row 1:
──────
database:            db_2
is_readonly:         0
max_log_ptr:         2
replica_name:        replica1
replica_path:        /test/db_2/replicas/shard1|replica1
zookeeper_path:      /test/db_2
shard_name:          shard1
log_ptr:             2
total_replicas:      1
zookeeper_exception: 
is_session_expired:  0
最后修改于 2026年6月10日