> For the complete documentation index, see [llms.txt](https://docs.zongsoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zongsoft.com/framework/externals/projects/etcd.md).

# Etcd (etcd)

Etcd 项目的能力范围、部署产物、接入入口与使用边界。

提供基础键值操作、序号和租约锁，适合需要原子序号分配或协调共享资源访问的场景。

| 项目项  | 值                                           |
| ---- | ------------------------------------------- |
| 源码目录 | `externals/etcd`                            |
| 主包   | `Zongsoft.Externals.Etcd`                   |
| 配套主题 | [缓存与分布式协作](/framework/externals/caching.md) |

## 部署与使用入口

将主包追加到已有宿主的[部署清单](/references/deploy-files.md)，并保留包中的插件清单、程序集及附属运行资源：

{% code title="Application.deploy（追加片段）" %}

```ini
[plugins zongsoft externals etcd]
nuget:Zongsoft.Externals.Etcd
```

{% endcode %}

连接设置位于 `/Externals/Etcd/ConnectionSettings`，驱动键为 `etcd`。序号与锁通过对应提供者接入；多个实现共存时，在应用组合层明确选择。

## 接入步骤

1. 配置测试集群和独立键前缀，先确认连接与目标键空间。
2. 验证序号首次分配、重复递增及过期策略；首次结果为 seed + interval。
3. 验证锁获取、竞争、租约失效及续期失败，再让资源端使用栅栏令牌拒绝旧持有者。

具体配置、调用示例和相关基础概念见[缓存与分布式协作](/framework/externals/caching.md)。

## 项目边界

{% hint style="info" %}
💡 当前提供者没有 Etcd 服务别名，不能照搬 Redis 的 `name@Redis` 调用。它也不是公共分布式缓存接口的替代实现；连接名不会自动成为键命名空间。
{% endhint %}

## 继续阅读

[按项目浏览扩展](/framework/externals/projects.md) · [缓存与分布式协作](/framework/externals/caching.md) · [源码与项目说明](https://github.com/Zongsoft/framework/tree/main/externals/etcd)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zongsoft.com/framework/externals/projects/etcd.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
