Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Go

  • Install Go on the management and compute nodes.
  • This section uses Go 1.18.3 as an example.

Procedure

  1. Use Xshell to log in to the server as the root user.
  2. Download Go 1.18.3 and upload it to the /root directory on the server.

    https://golang.google.cn/dl/go1.18.3.linux-arm64.tar.gz

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

    cd /root
    wget https://golang.google.cn/dl/go1.18.3.linux-arm64.tar.gz
  3. Delete the built-in Go software and then decompress the installation package uploaded in 2.
    rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.3.linux-arm64.tar.gz
  4. Add /usr/local/go/bin to the system environment variables.
    export PATH=$PATH:/usr/local/go/bin
  5. Set the Go environment variables.
    go env -w GO111MODULE=on
    go env -w GOPROXY=https://goproxy.cn,direct
    go env -w GOSUMDB=sum.golang.google.cn
  6. Check whether Go is successfully installed.
    go version

    If the Go version is displayed, the installation is successful.