Skip to main content

Aerospike C Client Red Hat Install

Prerequisites

The Aerospike C client library requires the following libraries present on the machine to build and run:

Library Name.rpm PackageDescription
libsslopenssl
libcryptoopensslRequired for RIPEMD160 hash function.

To install library prerequisites using yum:

sudo yum install openssl-devel

Some CentOS installation paths do not include the necessary C development tools. You may also need these packages:

sudo yum install gcc gcc-c++

If asynchronous functionality is desired, one of the following event frameworks must be installed.

libuv 1.15.0+

libuv has excellent performance and supports all platforms. The client also supports async TLS (SSL) sockets when using libuv.

libev 4.24+

libev has excellent performance on Linux/macOS, but its Windows implementation is suboptimal. Therefore, the C client supports libev on Linux/macOS only. The client does support async TLS (SSL) sockets when using libev.

libevent 2.1.8+

libevent is less performant than the other two options, but it does support all platforms. The client also supports async TLS (SSL) sockets when using libevent.

If a different event framework version is required, then the C client should be built from source code with that event framework version instead of following these pre-compiled library installation steps.

Download and Extract

You can download the C client package manually from the Download page. Make sure to read the release notes of the version you are downloading. Alternatively, you can automate downloading versions of the C client package from the artifact repository:

https://download.aerospike.com/artifacts/aerospike-client-c/<version>/

C client version 6.3.0 and newer

Support for 64-bit ARM (ARMv8.2-A instruction set) was added in C client version 6.3.0, in parallel with the server 6.2 ARM support.

caution

The C client package naming was changed to align with the server and tools packages.

ARCH platforms are based on uname -m, and include x86_64, aarch64 (Graviton 2 and similar) and arm64 (Apple M1).

PackageDescription
aerospike-client-c_{VERSION}_el7_{ARCH}.tgzsync commands
aerospike-client-c-libuv_{VERSION}_el7_{ARCH}.tgzsync and async commands with libuv
aerospike-client-c-libev_{VERSION}_el7_{ARCH}.tgzsync and async commands with libev
aerospike-client-c-libevent_{VERSION}_el7_{ARCH}.tgzsync and async commands with libevent

Extract the contents of the chosen package:

tar xvf <package>

Example

tar xvf aerospike-client-c-libuv_6.3.0_el7_x86_64.tgz
cd aerospike-client-c-libuv_6.3.0_el7_x86_64

Prior to C client version 6.3.0

PackageDescription
aerospike-client-c-{VERSION}.el7.x86_64.tgzsync commands
aerospike-client-c-libuv-{VERSION}.el7.x86_64.tgzsync and async commands with libuv
aerospike-client-c-libev-{VERSION}.el7.x86_64.tgzsync and async commands with libev
aerospike-client-c-libevent-{VERSION}.el7.x86_64.tgzsync and async commands with libevent

Extract the contents of the chosen package:

tar xvf <package>

Example

tar xvf aerospike-client-c-libuv-6.2.1.el7.x86_64.tgz
cd aerospike-client-c-libuv-6.2.1.el7.x86_64

Contents

The package contains the following installer packages:

  • aerospike-client-c[-{EVENTLIB}]-devel-{VERSION}-1.el7.{ARCH}.rpm

    Aerospike C client development (static library and header files) installer for given version and event framework library. This installer is used for developers when compiling/linking their applications with the Aerospike client library.

  • aerospike-client-c[-{EVENTLIB}]-{VERSION}-1.el7.{ARCH}.rpm

    Aerospike C client runtime (shared library) installer for given version and event framework library.

Install

Install one development package to compile your application with Aerospike client. Install corresponding runtime package to run your application with Aerospike client.

sudo rpm -i <installer package>

Example

sudo rpm -i aerospike-client-c-libuv-devel-6.3.0-1.el7.x86_64.rpm
sudo rpm -i aerospike-client-c-libuv-6.3.0-1.el7.x86_64.rpm

Development files install in:

  • /usr/include/aerospike
  • /usr/include/citrusleaf
  • /usr/lib/libaerospike.a

Runtime files install in:

  • /usr/lib/libaerospike.so

Building Applications with Event Library

Event libraries usually install into /usr/local/lib. Most operating systems do not search /usr/local/lib by default. Therefore, the following LD_LIBRARY_PATH setting may be necessary.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

When compiling your async applications with aerospike header files, the event library must be defined (-DAS_USE_LIBUV or -DAS_USE_LIBEV or -DAS_USE_LIBEVENT) on the command line or in an IDE. Example:

gcc -DAS_USE_LIBUV -o myapp myapp.c -laerospike -lev -lssl -lcrypto -lpthread -lm -lz