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

Installing etcd by Compiling Source Code

  1. Download the etcd source package.
    1. Download the etcd source package using your local browser.

      Download address: https://codeload.github.com/etcd-io/etcd/tar.gz/refs/tags/v3.1.20

    2. Copy the source package to the /home directory on the server.

    If the server is connected to the Internet, you can run the following command on the server to download the source package.

    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. Go to the /home directory.
    cd /home/
  3. Decompress the file.
    tar -zxvf etcd-3.1.20.tar.gz
  4. Set environment variables.
    1. Open the /etc/profile file.
      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. Therefore, the API of etcd V3 is required.
      export ETCDCTL_API=3
      export ETCD_UNSUPPORTED_ARCH=arm64
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Make the environment variables take effect.
    source /etc/profile
  6. Perform the compilation.
    cd etcd-3.1.20
    ./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.

  7. Check the installation path. After the compilation is successful, two executable files etcd and etcdctl are generated in the etcd-3.1.20/bin directory.
    cd /home
    ls etcd-3.1.20/bin

  8. Modify the installation path. Copy the bin directory and etcd.conf.yml.sample file in the etcd-3.1.20 folder to the /usr/loca/etcd directory and view the path.
    mkdir -p /usr/local/etcd/conf
    cp -r /home/etcd-3.1.20/bin /usr/local/etcd
    cp -r /home/etcd-3.1.20/etcd.conf.yml.sample /usr/local/etcd/conf/etcd.conf
    ls /usr/local/etcd