Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling a Benchmark Tool

To deploy a benchmark tool in an etcd cluster, deploy and start the etcd cluster in advance. Perform the following operations on each node in the cluster.

  1. Modify environment variables.
    1. Open the /etc/profile file.
      vim /etc/profile
    2. Press i to enter the insert mode and add the GOPATH information in the line above GOROOT.
      export GOPATH=/usr/local/etcd/tools/benchmark

    3. Change the path.
      Before:
      export PATH=$PATH:$GOROOT/bin
      After:
      export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    4. Press Esc, type :wq!, and press Enter to save the file and exit.
  2. Make the environment variables take effect.
    source /etc/profile
  3. Go to the benchmark directory and obtain the benchmark dependency package. Before performing the get operation, set a proxy .
    cd /usr/local/etcd/tools/benchmark/
    go env -w GO111MODULE=on
    go env -w GOPROXY=https://goproxy.cn,direct
    go get go.etcd.io/etcd/v3/tools/benchmark

    During the download, the version number is displayed. It is v3.5.4 in this example, which is marked in the red box in the preceding figure.

  4. Install the dependency package. (Change the benchmark number as required.)
    go install go.etcd.io/etcd/v3/tools/benchmark@v3.5.4

  5. Check the executable benchmark file. After the installation is complete, an executable benchmark file is generated in the usr/local/etcd/tools/benchmark/bin directory.
    ls /usr/local/etcd/tools/benchmark/bin