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.
- Download the Go source package.
- Arm
1wget https://repo.huaweicloud.com/go/go1.21.10/go1.21.10.linux-arm64.tar.gz --no-check-certificate
- x86
1wget https://repo.huaweicloud.com/go/go1.21.10/go1.21.10.linux-amd64.tar.gz --no-check-certificate
- Arm
- Decompress the Go source package to a specified folder.
- Arm
1tar -zxf go1.21.10.linux-arm64.tar.gz -C /usr/local
- x86
1tar -zxf go1.21.10.linux-amd64.tar.gz -C /usr/local
- Arm
- 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.
- Check the Go version.
1go versionThe installation is successful if the following information is displayed:
1go version go1.21.10 linux/arm64
Parent topic: Configuring the Compilation Environment