etcd v3.4.25 版本更新介绍
发布日期: 2023-04-14
版本号: v3.4.25
请查看变更日志以获取完整更改列表,并在升级etcd前阅读升级指南(可能存在破坏性变更)。安装指南可参考官方文档,了解支持的平台信息。
Linux/macOS安装步骤:
- 下载etcd v3.4.25版本压缩包(支持Google或GitHub源)
- 解压文件至临时目录,验证etcd及etcdctl版本
- 启动本地etcd服务,通过etcdctl进行键值读写操作
Docker部署方式:
- 使用gcr.io或quay.io的镜像
- 运行容器时绑定数据目录并配置端口、集群参数
- 通过docker exec执行版本检查、健康状态查询及数据读写
所有系统均需注意操作前清理临时文件,测试完成后可通过示例命令验证基础功能。
更新内容 (中文)
详见原始内容
更新内容 (原始)
Please check out CHANGELOG for a full list of changes. And make sure to read upgrade guide before upgrading etcd (there may be breaking changes).
For installation guides, please check out play.etcd.io and operating etcd. Latest support status for common architectures and operating systems can be found at supported platforms.
Linux
ETCD_VER=v3.4.25
# choose either URL
GOOGLE_URL=https://storage.googleapis.com/etcd
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download
DOWNLOAD_URL=${GOOGLE_URL}
rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test
curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd-download-test --strip-components=1
rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
/tmp/etcd-download-test/etcd --version
/tmp/etcd-download-test/etcdctl version
# start a local etcd server
/tmp/etcd-download-test/etcd
# write,read to etcd
/tmp/etcd-download-test/etcdctl --endpoints=localhost:2379 put foo bar
/tmp/etcd-download-test/etcdctl --endpoints=localhost:2379 get foo
macOS (Darwin)
ETCD_VER=v3.4.25
# choose either URL
GOOGLE_URL=https://storage.googleapis.com/etcd
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download
DOWNLOAD_URL=${GOOGLE_URL}
rm -f /tmp/etcd-${ETCD_VER}-darwin-amd64.zip
rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test
curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-darwin-amd64.zip -o /tmp/etcd-${ETCD_VER}-darwin-amd64.zip
unzip /tmp/etcd-${ETCD_VER}-darwin-amd64.zip -d /tmp && rm -f /tmp/etcd-${ETCD_VER}-darwin-amd64.zip
mv /tmp/etcd-${ETCD_VER}-darwin-amd64/* /tmp/etcd-download-test && rm -rf mv /tmp/etcd-${ETCD_VER}-darwin-amd64
/tmp/etcd-download-test/etcd --version
/tmp/etcd-download-test/etcdctl version
Docker
etcd uses gcr.io/etcd-development/etcd
as a primary container registry, and quay.io/coreos/etcd
as secondary.
rm -rf /tmp/etcd-data.tmp && mkdir -p /tmp/etcd-data.tmp && \
docker rmi gcr.io/etcd-development/etcd:v3.4.25 || true && \
docker run \
-p 2379:2379 \
-p 2380:2380 \
--mount type=bind,source=/tmp/etcd-data.tmp,destination=/etcd-data \
--name etcd-gcr-v3.4.25 \
gcr.io/etcd-development/etcd:v3.4.25 \
/usr/local/bin/etcd \
--name s1 \
--data-dir /etcd-data \
--listen-client-urls http://0.0.0.0:2379 \
--advertise-client-urls http://0.0.0.0:2379 \
--listen-peer-urls http://0.0.0.0:2380 \
--initial-advertise-peer-urls http://0.0.0.0:2380 \
--initial-cluster s1=http://0.0.0.0:2380 \
--initial-cluster-token tkn \
--initial-cluster-state new \
--log-level info \
--logger zap \
--log-outputs stderr
docker exec etcd-gcr-v3.4.25 /usr/local/bin/etcd --version
docker exec etcd-gcr-v3.4.25 /usr/local/bin/etcdctl version
docker exec etcd-gcr-v3.4.25 /usr/local/bin/etcdctl endpoint health
docker exec etcd-gcr-v3.4.25 /usr/local/bin/etcdctl put foo bar
docker exec etcd-gcr-v3.4.25 /usr/local/bin/etcdctl get foo