Aerospike is a distributed NoSQL database purposefully designed for high performance web scale applications. Aerospike supports key-value and document data models, and has multiple data types including List, Map, HyperLogLog, GeoJSON, and Blob. Aerospike's patented hybrid memory architecture delivers predictable high performance at scale and high data density per node.
- Getting Started
- Connecting to your Aerospike contianer
- Advanced Configuration
- Clustering
- Sending Performance Data to Aerospike
- Image Versions
- Reporting Issues
- License
Aerospike Community Edition supports the same developer APIs as Aerospike Enterprise Edition, and differs in ease of operation and enterprise features. See the product matrix for more.
Anyone can sign up to get an evaluation feature key file for a full-featured, single-node Aerospike Enterprise Edition.
docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server
You can use the latest aerospike-tools image to connect to your Aerospike container.
docker run -ti aerospike/aerospike-tools:latest aql -h $(docker inspect -f '{{.NetworkSettings.IPAddress }}' aerospike)
Seed: 172.17.0.2
User: None
Config File: /etc/aerospike/astools.conf /root/.aerospike/astools.conf
Aerospike Query Client
Version 5.0.1
C Client Version 4.6.17
Copyright 2012-2020 Aerospike. All rights reserved.
aql> show namespaces
+------------+
| namespaces |
+------------+
| "test" |
+------------+
[127.0.0.1:3000] 1 row in set (0.002 secs)
OK
aql> help
docker run -ti aerospike/aerospike-tools:latest asadm -h $(docker inspect -f '{{.NetworkSettings.IPAddress }}' aerospike)
Seed: [('172.17.0.2', 3000, None)]
Config_file: /root/.aerospike/astools.conf, /etc/aerospike/astools.conf
Aerospike Interactive Shell, version 2.0.1
Found 1 nodes
Online: 172.17.0.2:3000
Admin> info
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information (2021-04-20 01:57:37 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Node| Node ID| IP| Build|Migrations|~~~~~~~~~~~~~~~~~~Cluster~~~~~~~~~~~~~~~~~~|Client| Uptime
| | | | |Size| Key|Integrity| Principal| Conns|
172.17.0.2:3000|*BB9020011AC4202|172.17.0.2:3000|C-5.5.0.9| 0.000 | 1|3FA2C989BDC9|True |BB9020011AC4202| 4|00:06:54
Number of rows: 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Namespace Usage Information (2021-04-20 01:57:37 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Namespace| Node| Total|Expirations|Evictions| Stop|~~~~~~~~~~~Disk~~~~~~~~~~~|~~~~~~~~~~Memory~~~~~~~~~|~Primary~
| |Records| | |Writes| Used|Used%|HWM%|Avail%| Used|Used%|HWM%|Stop%|~~Index~~
| | | | | | | | | | | | | | Type
test |172.17.0.2:3000|0.000 | 0.000 | 0.000 |False |0.000 B | 0| 0| 99|0.000 B | 0| 0| 90|undefined
test | |0.000 | 0.000 | 0.000 | |0.000 B | | | |0.000 B | | | |
Number of rows: 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Namespace Object Information (2021-04-20 01:57:37 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Namespace| Node|Rack| Repl| Total|~~~~~~~~~~Objects~~~~~~~~~~|~~~~~~~~~Tombstones~~~~~~~~|~~~~Pending~~~~
| | ID|Factor|Records| Master| Prole|Non-Replica| Master| Prole|Non-Replica|~~~~Migrates~~~
| | | | | | | | | | | Tx| Rx
test |172.17.0.2:3000| 0| 1|0.000 |0.000 |0.000 | 0.000 |0.000 |0.000 | 0.000 |0.000 |0.000
test | | | |0.000 |0.000 |0.000 | 0.000 |0.000 |0.000 | 0.000 |0.000 |0.000
Number of rows: 1
The Aerospike CE Docker image has a default configuration file template that can be populated with individual configuration parameters. Alternatively, it can be replaced with a custom configuration file.
The following sections describe both advanced options.
You can inject parameters into the configuration template using container-side
environment variables with the -e
flag.
For example, to set the default namespace name to demo:
docker run -d --name aerospike -e "NAMESPACE=demo" -p 3000-3002:3000-3002 -v /my/dir:/opt/aerospike/etc/ aerospike/aerospike-server
Injecting configuration parameters into the configuration template isn't compatible with using a custom configuration file. You can use one or the other.
SERVICE_THREADS
- theservice_threads
. Default: Number of vCPUsLOGFILE
- thefile
param of thelogging
context. Default: /dev/null, do not log to file, log to stdoutSERVICE_ADDRESS
- the bindaddress
of thenetworking.service
subcontext. Default: anySERVICE_PORT
- theport
of thenetworking.service
subcontext. Default: 3000HB_ADDRESS
- thenetworking.heartbeat
address
for cross cluster mesh. Default: anyHB_PORT
- theport
fornetworking.heartbeat
communications. Default: 3002FABRIC_ADDRESS
- theaddress
of thenetworking.fabric
subcontext. Default: anyFABRIC_PORT
- theport
of thenetworking.fabric
subcontext. Default: 3001
The single preconfigured namespace is in-memory with filesystem persistence
NAMESPACE
- the name of the namespace. Default: testREPL_FACTOR
- the namespacereplication-factor
. Default: 2MEM_GB
- the namespacememory-size
. Default: 1, the unit is alwaysG
(GB)DEFAULT_TTL
- the namespacedefault-ttl
. Default: 30dSTORAGE_GB
- the namespace persistencefile
size. Default: 4, the unit is alwaysG
(GB)NSUP_PERIOD
- the namespacensup-period
. Default: 120 , nsup-period in seconds
You can override the use of the configuration file template by providing your own aerospike.conf, as described in Configuring Aerospike Database.
You should first -v
map a local directory, which Docker will bind mount.
Next, drop your aerospike.conf file into this directory.
Finally, use the --config-file
option to tell Aerospike where in the
container the configuration file is (the default path is
/etc/aerospike/aerospike.conf).
For example:
docker run -d -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server --config-file /opt/aerospike/etc/aerospike.conf
With Docker, the files within the container are not persisted past the life of
the container. To persist data, you will want to mount a directory from the
host to the container's /opt/aerospike/data using the -v
option:
For example:
docker run -d -v /opt/aerospike/data:/opt/aerospike/data -v /opt/aerospike/etc:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server
The example above uses the configuration template, where the single defined namespace is in-memory with file-based persistence. Just mounting the predefined /opt/aerospike/data directory enables the data to be persisted on the host.
Alternatively, a custom configuration file is used with the parameter
file
set to be a file in the mounted /opt/aerospike/data, such as in the
following config snippet:
namespace test {
# :
storage-engine device {
file /opt/aerospike/data/test.dat
filesize 4G
data-in-memory true
}
}
In this example we also mount the data directory in a similar way, using a custom configuration file
docker run -d -v /opt/aerospike/data:/opt/aerospike/data -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server --config-file /opt/aerospike/etc/aerospike.conf
Docker provides an ability to expose a host's block devices to a running container.
The --device
option can be used to map a host block device within a container.
Update the storage-engine device
section of the namespace in the custom
aerospike configuration file.
namespace test {
# :
storage-engine device {
device /dev/xvdc
write-block-size 128k
}
}
Now to map a host drive /dev/sdc to /dev/xvdc on a container
docker run -d --device '/dev/sdc:/dev/xvdc' -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server --config-file /opt/aerospike/etc/aerospike.conf
Upon restart, your Lua cache will become emptied. To persist the cache, you
will want to mount a directory from the host to the container's
/opt/aerospike/usr/udf/lua
using the -v
option:
docker run -d -v /opt/aerospike/lua:/opt/aerospike/usr/udf/lua -v /opt/aerospike/data:/opt/aerospike/data --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server
And Now for a Security Reminder that bad things can happen to good people.
Also see the knowledge base article How To secure Aerospike database servers.
In order for the Aerospike node to properly broadcast its address to the cluster
and applications, the access-address
configuration parameter needs to be set in the configuration file. If it is not
set, then the IP address within the container will be used, which is not
accessible to other nodes.
network {
service {
address any # Listening IP Address
port 3000 # Listening Port
access-address 192.168.1.100 # IP Address used by cluster nodes and applications
}
Mesh networking requires setting up links between each node in the cluster. This can be achieved in two ways:
- Add a configuration for each node in the cluster, as defined in Network Heartbeat Configuration.
- Use
asinfo
to send thetip
command, to make the node aware of another node, as defined in tip command in asinfo.
For more, see How do I get a 2 nodes Aerospike cluster running quickly in Docker without editing a single file?
Aerospike Telemetry is a feature that allows us to collect certain use data – not the database data – on your Aerospike Community Edition server use. We’d like to know when clusters are created and destroyed, cluster size, cluster workload, how often queries are run, whether instances are deployed purely in-memory or with Flash. Aerospike Telemetry collects information from running Community Edition server instances every 10 minutes. The data helps us to understand how the product is being used, identify issues, and create a better experience for the end user. More Info
These images are based on debian:strech-slim.
If you have any problems with or questions about this image, please contact us on the Aerospike Forums or open an issue in aerospike/aerospike-server.docker.
Refer to the license information in the aerospike/aerospike-server repository.