Skip to main content

Install the Aerospike client


Prerequisites

  • Go version v1.21+.

To install the latest stable version of Go, see http://golang.org/dl/. Your package manager may also have go. To see if go is installed and working, try go version.

The Aerospike Go client implements the Aerospike network protocols in pure Go, and does not depend on the C client. It is goroutine friendly, and works asynchronously.

Supported operating systems:

  • Major Linux distributions (Ubuntu, Debian, Red Hat, Amazon)
  • macOS
  • Windows (untested)

Installing

  1. Install Go v1.21+ and setup your environment as documented here. Your package manager may also have go. To see if go is installed and working, try go version.
  2. Get the client in your $GOPATH:
go get github.com/aerospike/aerospike-client-go/v7
  1. Update the client library:
go get -u github.com/aerospike/aerospike-client-go/v7

Testing

The Aerospike Go client package contains a number of tests.

Tests require Ginkgo and Gomega library.

go get github.com/onsi/ginkgo
go get github.com/onsi/gomega

Before running the tests, update dependencies:

cd $GOPATH/src/github.com/aerospike/aerospike-client-go/tools/benchmark
go get .

To run all test cases with race detection:

ginkgo -r -race -- -h 127.0.0.1 -p 3000

Building for Aerospike Cloud

To compile the Go client for the proxy server in Aerospike Cloud, pass -tags as_proxy to the compiler on build.