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

Installing Go

To ensure that the Go version used for compilation meets the Milvus requirements, it is advised to install Go 1.21.10 or later.

The Go environment is used to develop, compile, and run programs written with Go. Milvus supports clients in multiple programming languages, including Python, Java, and Go. Installing Go can facilitate the use of or extend the Milvus functionality.

  1. Download the Go source package.
    • Arm
      1
      wget https://repo.huaweicloud.com/go/go1.21.10/go1.21.10.linux-arm64.tar.gz --no-check-certificate
      
    • x86
      1
      wget https://repo.huaweicloud.com/go/go1.21.10/go1.21.10.linux-amd64.tar.gz --no-check-certificate
      
  2. Decompress the Go source package to a specified folder.
    • Arm
      1
      tar -zxf go1.21.10.linux-arm64.tar.gz -C /usr/local
      
    • x86
      1
      tar -zxf go1.21.10.linux-amd64.tar.gz -C /usr/local
      
  3. Set environment variables for Go to take effect.
    1
    2
    3
    4
    5
    6
    7
    echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
    echo 'export GOPATH=/data/milvus/go' >> ~/.bashrc
    echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc
    echo 'export GO111MODULE=on' >> ~/.bashrc
    echo 'export GOPROXY=https://repo.huaweicloud.com/repository/goproxy/' >> ~/.bashrc
    echo 'export GOSUMDB=off' >> ~/.bashrc
    source ~/.bashrc
    
    • GOROOT specifies the path to Go.
    • GOPATH stores the downloaded Go package, which can be modified based on the environment.
    • GOPROXY is easy to fail. You can try other proxies, for example, https://goproxy.cn,direct.
    • If the Go dependency fails to be downloaded, run the go mod tidy command repeatedly in the milvus directory until the download is successful.
  4. Check the Go version.
    1
    go version
    

    The installation is successful if the following information is displayed:

    1
    go version go1.21.10 linux/arm64