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

> 仅在配置了 ZooKeeper 时才存在的系统表。显示当前与 ZooKeeper 的连接（包括辅助 ZooKeepers）。

# system.zookeeper_connection

<Info>
  **在 ClickHouse Cloud 中查询**

  此系统表中的数据分别保存在 ClickHouse Cloud 各节点的本地。因此，如需查看所有数据的完整情况，需要使用 `clusterAllReplicas` 函数。更多详情请参见[此处](/zh/reference/system-tables/overview#system-tables-in-clickhouse-cloud)。
</Info>

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

如果未配置 ZooKeeper，则此表不存在。`system.zookeeper_connection` 表显示当前与 ZooKeeper 的连接 (包括辅助 ZooKeepers) 。每一行都显示一个连接的信息。

<div id="columns">
  ## 列
</div>

* `name` ([String](/zh/reference/data-types/string)) — ZooKeeper 集群的名称。
* `host` ([String](/zh/reference/data-types/string)) — ClickHouse 连接到的 ZooKeeper 节点的主机名/IP。
* `port` ([UIn16](/zh/reference/data-types/int-uint)) — ClickHouse 连接到的 ZooKeeper 节点的端口。
* `index` ([Nullable(UInt8)](/zh/reference/data-types/int-uint)) — ClickHouse 连接到的 ZooKeeper 节点的索引。该索引来自 ZooKeeper 配置。如果未连接，此列为 NULL。
* `connected_time` ([DateTime](/zh/reference/data-types/datetime)) — 连接建立的时间
* `session_uptime_elapsed_seconds` ([UInt64](/zh/reference/data-types/int-uint)) — 自连接建立以来经过的秒数。
* `is_expired` ([UInt8](/zh/reference/data-types/int-uint)) — 当前连接是否已过期。
* `keeper_api_version` ([UInt8](/zh/reference/data-types/int-uint)) — Keeper API 版本。
* `client_id` ([Int64](/zh/reference/data-types/int-uint)) — 该连接的会话 ID。
* `xid` ([Int64](/zh/reference/data-types/int-uint)) — 当前会话的 XID。
* `enabled_feature_flags` ([Array(Enum16)](/zh/reference/data-types/array)) — 已启用的功能开关。仅适用于 ClickHouse Keeper。可能的值包括 `FILTERED_LIST`、`MULTI_READ`、`CHECK_NOT_EXISTS`、`CREATE_IF_NOT_EXISTS`、`REMOVE_RECURSIVE`。
* `availability_zone` ([String](/zh/reference/data-types/string)) — 可用区。
* `session_timeout_ms` ([UInt64](/zh/reference/data-types/int-uint)) — 会话超时时间 (以毫秒为单位) 。
* `last_zxid_seen` ([Int64](/zh/reference/data-types/int-uint)) — 当前会话看到的最后一个 zxid。

示例：

```sql theme={null}
SELECT * FROM system.zookeeper_connection;
```

```text theme={null}
┌─name────┬─host──────┬─port─┬─index─┬──────connected_time─┬─session_uptime_elapsed_seconds─┬─is_expired─┬─keeper_api_version─┬─client_id─┬─xid─┬─enabled_feature_flags────────────────────────────────────────────────────┬─availability_zone─┐
│ default │ 127.0.0.1 │ 2181 │     0 │ 2025-04-10 14:30:00 │                            943 │          0 │                  0 │       420 │  69 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS'] │ eu-west-1b        │
└─────────┴───────────┴──────┴───────┴─────────────────────┴────────────────────────────────┴────────────┴────────────────────┴───────────┴─────┴──────────────────────────────────────────────────────────────────────────┴───────────────────┘
```
