Aerospike Database Server – flash-optimized, in-memory, nosql database
Aerospike Database Server – flash-optimized, in-memory, nosql database
Welcome to the Aerospike Database Server source code tree!
Aerospike is a distributed, scalable NoSQL database. It is architected with three key objectives:
For more information on Aerospike, please visit: http://aerospike.com
The Aerospike Database Server can be built and deployed on various current 64-bit GNU/Linux platform versions, such as Red Hat Enterprise Linux 8/9, Amazon Linux 2023, Debian 11 or later, and Ubuntu 20.04 or later.
The majority of the Aerospike source code is written in the C programming language, conforming to the ANSI C99 standard.
To install dependencies for a development environment run
./bin/install-dependencies.sh in the aerospike-server repo.
In particular, the following tools and libraries are needed:
Building Aerospike requires the GCC 5.1 or later C compiler toolchain, with the standard GNU/Linux development tools and libraries installed in the build environment, including:
autoconfautomakecmakelibtoolmakeThe C++ compiler is required for the Aerospike geospatial indexing feature and its dependency, Google's S2 Geometry Library (both written in C++.) C++ is also used for yaml/json configuration parsing.
gcc-c++.g++.OpenSSL 0.9.8b or later.
openssl-devellibssl-dev.zlib-develzlib1g-dev.The Aerospike Database Server build depends upon the following submodules:
Submodule Description abseil-cpp Support for the S2 Spherical Geometry Library common The Aerospike Common Library jansson C library for encoding, decoding and manipulating JSON data jemalloc The JEMalloc Memory Allocator json nlohmann/json library for json in c++, used primarily for config parsing jsonschema pboettch/json-schema-validator used to validate configuration against our schemas libbacktrace A C library that may be linked into a C/C++ program to produce symbolic backtraces lua The Lua runtime mod-lua The Aerospike Lua Interface s2geometry The S2 Spherical Geometry Library yamlcpp jbeder/yaml-cpp used to parse yaml config filesAfter the initial cloning of the aerospike-server repo., the
submodules must be fetched for the first time using the following
command:
$ git submodule update --init
[!IMPORTANT] As this project uses submodules, the source archive downloadable via GitHub's
Download ZIPbutton will not build unless the correct revision of each submodule is first manually installed in the appropriatemodulessubdirectory.
[!TIP] Aerospike collects telemetry information about builds. To opt out, the environment variable AEROSPIKE_TELEMETRY must be set to FALSE.
$ make -- Perform the default build (no packaging.)
[!TIP] You can use the
-joption withmaketo speed up the build on multiple CPU cores. For example, to run four parallel jobs:
$ make -j4
$ make deb -- Build the Debian (Ubuntu) package.
$ make rpm -- Build the Red Hat Package Manager (RPM) package.
$ make source -- Package the source code as a compressed "tar" archive.
$ make clean -- Delete any existing build products, excluding built packages.
$ make cleanpkg -- Delete built packages.
$ make cleanall -- Delete all existing build products, including built packages.
$ make cleangit -- Delete all files untracked by Git. (Use with caution!)
$ make strip -- Build a "strip(1)"ed version of the server executable.
$ make {<Target>}* {<VARIABLE>=<VALUE>}* -- Build <Target>(s) with optional variable overrides.
$ make -- Default build.
Aerospike supports two configuration formats:
Traditional .conf format: Sample configuration files are provided in as/etc. The
developer configuration file, aerospike_dev.conf, contains basic
settings that should work out-of-the-box on most systems. The package
example configuration files, aerospike.conf, and the Solid State Drive
(SSD) version, aerospike_ssd.conf, are suitable for running Aerospike
as a system daemon.
YAML format: Aerospike supports YAML-based configuration with JSON schema validation as an experimental feature. This format provides structured configuration with automatic validation against a schema file.
To use YAML configuration:
--experimental flag when starting the server--schema-file <file> (default location:
/opt/aerospike/schema/aerospike_config_schema.json)Converting existing configurations: Use the asconfig tool to convert traditional
.conf files to YAML format. The tool generates YAML files with metadata headers that
include version information.
Schema validation: The JSON schema file validates your YAML configuration at startup, catching configuration errors early and providing better error messages for invalid settings.
The asconfig tool currently outputs an older yaml config format, which is not the same as the
experimental YAML format the server validates. To move from a traditional .conf file
to the server’s experimental YAML config:
.conf file with asconfig./opt/aerospike/schema/aerospike_config_schema.json.asconfignamespaces, namespaces[].setsnetwork.tlsxdr.dcs, xdr.dcs[].namespacesname fields that were used inside array entries; the name now becomes the map key.contexts (see schema for valid types/contexts):type: console uses only contextstype: file requires path plus contextstype: syslog supports facility, path, tag, and contexts{ value, unit }
objects where supported. Plain numeric values are still valid. Refer to the schema
for the authoritative list of unit-capable fields and allowed units.# asconfig output (not valid for the server’s experimental YAML)
namespaces:
- name: test
replication-factor: 2
# server experimental YAML format
namespaces:
test:
replication-factor: 2
Notes:
name property inside the map value.YAML configuration as output by asconfig.
# asconfig output (not valid for the server’s experimental YAML)
service:
cluster-name: my-cluster
pidfile: /var/run/aerospike/asd.pid
logging:
- name: console
any: info
network:
service:
addresses:
- any
port: 3000
fabric:
port: 3001
heartbeat:
mode: mesh
port: 3002
addresses:
- local
interval: 150
timeout: 10
namespaces:
- name: test
replication-factor: 2
storage-engine:
type: memory
data-size: 4294967296
The configuration after aligning it with the database schema.
# server experimental YAML format
service:
cluster-name: my-cluster
pidfile: /var/run/aerospike/asd.pid
logging:
- type: console
contexts:
any: info
network:
service:
addresses:
- any
port: 3000
fabric:
port: 3001
heartbeat:
mode: mesh
port: 3002
addresses:
- local
interval: 150
timeout: 10
namespaces:
test:
replication-factor: 2
storage-engine:
type: memory
data-size: 4294967296
Logging section as output by asconfig.
# asconfig output (not valid for the server’s experimental YAML)
logging:
- name: console
any: info
- name: /var/log/aerospike/aerospike.log
any: info
Logging section after aligning it with the database schema.
# server experimental YAML format
logging:
- type: console
contexts:
any: info
- type: file
path: /var/log/aerospike/aerospike.log
contexts:
any: info
- type: syslog
facility: local1
path: /dev/log
tag: asd
contexts:
any: info
See /opt/aerospike/schema/aerospike_config_schema.json for the full list of
logging contexts and the allowed syslog facilities.
The database's experimental yaml configuration format allows certain configs to use values with units.
# server experimental YAML unit-enabled fields
namespaces:
test:
storage-engine:
data-size:
value: 4
unit: g
xdr:
dcs:
dc1:
namespaces:
test:
ship-versions-interval:
value: 1
unit: h
See /opt/aerospike/schema/aerospike_config_schema.json for the definitive list of
fields that accept units, the allowed unit values, and the { value, unit } form.
These sample files may be modified for specific use cases (e.g., setting network addresses, defining namespaces, and setting storage engine properties) and tuned for maximum performance on a particular system. Also, system resource limits may need to be increased to allow, e.g., a greater number of concurrent connections to the database. See "man limits.conf" for how to change the system's limit on a process' number of open file descriptors ("nofile".)
There are several options for running the Aerospike database. Which option to use depends upon whether the primary purpose is production deployment or software development.
The preferred method for running Aerospike in a production environment
is to build and install the Aerospike package appropriate for the target
Linux distribution (i.e., an ".rpm" or ".deb" file), and then to
control the state of the Aerospike daemon via systemctl on
e.g., systemctl start aerospike.
Please refer to the full documentation on the Aerospike web site,
https://docs.aerospike.com/, for more
detailed information about configuring and running the Aerospike
Database Server, as well as about the Aerospike client API packages
for popular programming languages.
No open issues yet, or sync has not completed.