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

> 仅在配置了 ClickHouse Keeper 或 ZooKeeper 时才存在的系统表。它会公开配置中定义的 Keeper 集群中的数据。

# system.zookeeper

## 描述

只有在配置了 ClickHouse Keeper 或 ZooKeeper 时，该表才存在。`system.zookeeper` 表会公开配置中定义的 Keeper 集群中的数据。
查询必须在 `WHERE` 子句中包含 `path =` 条件，或像下面所示设置 `path IN` 条件。这对应于你想要获取数据的子节点所在路径。

查询 `SELECT * FROM system.zookeeper WHERE path = '/clickhouse'` 会输出 `/clickhouse` 节点下所有子节点的数据。
如需输出所有根节点的数据，请写 `path = '/'`。
如果 `path` 中指定的路径不存在，则会抛出异常。

查询 `SELECT * FROM system.zookeeper WHERE path IN ('/', '/clickhouse')` 会输出 `/` 和 `/clickhouse` 节点下所有子节点的数据。
如果指定的 `path` 集合中包含不存在的路径，则会抛出异常。
它可用于批次查询多个 Keeper 路径。

查询 `SELECT * FROM system.zookeeper WHERE path = '/clickhouse' AND zookeeperName = 'auxiliary_cluster'` 会输出 `auxiliary_cluster` ZooKeeper 集群中的数据。
如果指定的 `auxiliary_cluster` 不存在，则会抛出异常。

## 列

* `name` ([String](/zh/reference/data-types/string)) — 节点名称。
* `value` ([String](/zh/reference/data-types/string)) — 节点值。
* `zookeeperName` ([String](/zh/reference/data-types/string)) — 默认 ZooKeeper 集群或某个 auxiliary ZooKeeper 集群的名称。
* `czxid` ([Int64](/zh/reference/data-types/int-uint)) — 创建该节点的事务 ID。
* `mzxid` ([Int64](/zh/reference/data-types/int-uint)) — 最后一次修改该节点的事务 ID。
* `ctime` ([DateTime](/zh/reference/data-types/datetime)) — 节点创建时间。
* `mtime` ([DateTime](/zh/reference/data-types/datetime)) — 节点最后一次修改的时间。
* `version` ([Int32](/zh/reference/data-types/int-uint)) — 节点版本：该节点被修改的次数。
* `cversion` ([Int32](/zh/reference/data-types/int-uint)) — 新增或删除的子孙节点数量。
* `aversion` ([Int32](/zh/reference/data-types/int-uint)) — ACL 的修改次数。
* `ephemeralOwner` ([Int64](/zh/reference/data-types/int-uint)) — 对于 ephemeral 节点，表示拥有该节点的 session 的 ID。
* `dataLength` ([Int32](/zh/reference/data-types/int-uint)) — 值的大小。
* `numChildren` ([Int32](/zh/reference/data-types/int-uint)) — 子孙节点数量。
* `pzxid` ([Int64](/zh/reference/data-types/int-uint)) — 最后一次删除或新增子孙节点的事务 ID。
* `path` ([String](/zh/reference/data-types/string)) — 节点的路径。

## 示例

```sql theme={null}
SELECT *
FROM system.zookeeper
WHERE path = '/clickhouse/tables/01-08/visits/replicas'
FORMAT Vertical
```

```text theme={null}
Row 1:
──────
name:           example01-08-1
value:
czxid:          932998691229
mzxid:          932998691229
ctime:          2015-03-27 16:49:51
mtime:          2015-03-27 16:49:51
version:        0
cversion:       47
aversion:       0
ephemeralOwner: 0
dataLength:     0
numChildren:    7
pzxid:          987021031383
path:           /clickhouse/tables/01-08/visits/replicas

Row 2:
──────
name:           example01-08-2
value:
czxid:          933002738135
mzxid:          933002738135
ctime:          2015-03-27 16:57:01
mtime:          2015-03-27 16:57:01
version:        0
cversion:       37
aversion:       0
ephemeralOwner: 0
dataLength:     0
numChildren:    7
pzxid:          987021252247
path:           /clickhouse/tables/01-08/visits/replicas
```
