我要评分
获取效率
正确性
完整性
易理解

Deploying etcd

  1. Download the source package. In this example, the source package is saved to the /home directory.
    1
    2
    3
    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
    
  2. Decompress the source package. Rename the generated folder to etcd and save it to the /usr/local directory.
    1
    2
    tar -zxvf etcd-3.1.20.tar.gz
    mv etcd-3.1.20 /usr/local/etcd
    
  3. Set environment variables.
    1. Open the /etc/profile file.
      1
      vim /etc/profile
      
    2. 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
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Make the environment variables take effect.
    1
    source /etc/profile
    
  5. Perform the compilation.
    1
    2
    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.

  6. 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.
    1
    ls /usr/local/etcd/bin
    

  7. Create a data storage path.
    1
    mkdir -p /usr/local/etcd/data