Install
安装预编译二进制文件
安装etcd最简单的方法是从预构建的二进制文件:
- Download the compressed archive file for your platform from Releases, choosing release v3.5.0 or later.
- Unpack the archive file. This results in a directory containing the binaries.
- Add the executable binaries to your path. For example, rename and/or move the binaries to a directory in your path (like
/usr/local/bin
), or add the directory created by the previous step to your path. - From a shell, test that
etcd
is in your path:
etcd --version
etcd Version: 3.5.0
...
从源码编译
如果有安装Go 1.16+编译器,你可以从源码安装:
-
下载源码文件并解压https://github.com/etcd-io/etcd/archive/v3.5.0.zip;或者从仓库克隆
# To build from main@HEAD, omit the -b v3.5.0 flag. git clone -b v3.5.0 https://github.com/etcd-io/etcd.git
-
切换目录
cd etcd
-
编译
The binaries are under the bin
directory
./build.sh
- Add the full path to the
bin
directory to your path, for example:
$ export PATH="$PATH:`pwd`/bin"
- Test that
etcd
is in your path:
$ etcd --version