Deploying etcd
- Download the source package. In this example, the source package is saved to the /home directory.
cd /home wget https://codeload.github.com/etcd-io/etcd/tar.gz/refs/tags/v3.1.20 mv v3.1.20 etcd-3.1.20.tar.gz
- Decompress the source package. Rename the generated folder to etcd and save it to the /usr/local directory.
tar -zxvf etcd-3.1.20.tar.gz mv etcd-3.1.20 /usr/local/etcd
- Set environment variables.
- Open the /etc/profile file.
vim /etc/profile
- Press i to enter the insert mode and add the following content to the end of the file. By default, etcd V2 is used. The API of etcd V3 is needed here.
export ETCDCTL_API=3 export ETCD_UNSUPPORTED_ARCH=arm64
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the /etc/profile file.
- Make the environment variables take effect.
source /etc/profile
- Perform the compilation.
cd /usr/local/etcd ./build

If an error is reported during the compilation, see "Not a git repository" Displayed When Compiling etcd, "no required module provides package" Displayed When Compiling etcd, and "Needed a single revision" Displayed When Compiling etcd.
- Search for the generated path. After the compilation is successful, two executable files etcd and etcdctl are generated in the /usr/local/etcd/bin directory.
ls /usr/local/etcd/bin

- Create a data storage path.
mkdir -p /usr/local/etcd/data
Parent topic: Deploying and Installing etcd 3.1.20