FAQ - Aerospike on Docker

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

FAQ - Aerospike on Docker

Detail

FAQ on running Aerospike on Docker for either the Aerospike Community Edition (CE) or the Enterprise Edition (EE)

Where can I find the Dockerfile?

The basic config for a docker container is the Dockerfile. This file contains the install steps for the Aerospike server and path to its configs.

This file can be found at the following locations:

Can I deploy on Docker Swarm?

Using a custom Dockerfile and Docker Compose file, it is possible to deploy Aerospike to a Docker Swarm environment. An overlay network may be needed to help node clustering and allow for different services to access the containers across multiple physical hosts.

More details can be found on the aerospike-docker-swarm git repo.

How do I deploy AMC on Docker?

In order to run AMC on Docker the first step is to create a custom Dockerfile that includes the AMC install commands for the relevant base OS.

Save AMC Dockerfile to a folder:

FROM ubuntu:bionic

ENV AMC_VERSION 4.0.25 

# Install AMC server 

RUN \
  apt-get update -y \
  && apt-get install -y wget python python-argparse python-bcrypt python-openssl logrotate net-tools iproute2 iputils-ping \
  && wget "https://www.aerospike.com/artifacts/aerospike-amc-community/${AMC_VERSION}/aerospike-amc-community-${AMC_VERSION}_amd64.deb" -O aerospike-amc.deb \
  && dpkg -i aerospike-amc.deb \
  && apt-get purge -y

EXPOSE 8081 

# Execute the run script in foreground mode
ENTRYPOINT ["/opt/amc/amc"]

CMD [" -config-file=/etc/amc/amc.conf -config-dir=/etc/amc"]

Build the AMC image:

docker build -t my-amc .

Start AMC container and server:

docker run --rm -tid  --name amc -p 8081:8081 my-amc

Access your AMC container:

http://localhost:8081

Enter a node’s IP address at the prompt. Ensure that the AMC container is able to connect to the Aerospike servers over the configured service ports (3000). In case of an Aerospike cluster running on a Docker overlay network, ensure that the AMC container is also a member of that overlay network.

Common errors:

DETAIL (config): (features_ee.c:154) feature key /etc/aerospike/features.conf with size 9223372036854775807

If the docker container volume mount point for the feature-key file is pointing to a file instead of an absolute path, aerospike server will halt with an error message showing in the Detail log-level for the config module. The log line above will show a huge file size for the feature-key file. The fix is to mount the container’s volume correctly and point to a directory.

Notes

The example AMC Dockerfile above can be used as a template to create a Dockerfile for any service.

Keywords

DOCKER AMC

Timestamp

July 2019

1 Like