Databases 11 min read

Deploy Aerospike in 10 Minutes: Step‑by‑Step Installation and Tuning Guide

This tutorial walks you through installing the Aerospike NoSQL database, tuning Linux system parameters, configuring a three‑node cluster, performing basic AQL operations, and setting up AMC monitoring, all within roughly ten minutes of setup time.

Xiaolei Talks DB
Xiaolei Talks DB
Xiaolei Talks DB
Deploy Aerospike in 10 Minutes: Step‑by‑Step Installation and Tuning Guide

Aerospike (AS) is a NoSQL distributed database. This article shows how to set up a test instance in about ten minutes.

1. Environment and AS Version

2. System Parameter Tuning Before Installation

The following parameters are useful not only for Aerospike but also for other databases such as Redis or TiDB; understand each setting to adjust it for different DB workloads.

SSD write mode: use ext4 file system (default) or raw device for higher performance.

Prepare a zero‑filled block device: dd if=/dev/zero of=/dev/sdb bs=1M

min_free_kbytes : reserve free memory; set to 1.1‑1.25 GB via sysctl. <code>echo 3 > /proc/sys/vm/drop_caches echo 1048576 > /proc/sys/vm/min_free_kbytes echo "vm.min_free_kbytes=1048576" >> /etc/sysctl.conf</code>

Disable swap: echo 0 > /proc/sys/vm/swappiness and add vm.swappiness=0 to /etc/sysctl.conf .

Disable Transparent Huge Pages (THP) with a systemd service: <code>cat <<EOF > /etc/systemd/system/disable-transparent-huge-pages.service [Unit] Description=Disable Transparent Huge Pages [Service] Type=oneshot ExecStart=/bin/bash /etc/init.d/disable-transparent-hugepages start [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable disable-transparent-huge-pages.service</code>

NVMe partitioning: split a single disk into four partitions or use four 500 GB disks.

Increase vm.max_map_count for container or Kubernetes environments.

Raise max open file limits: <code>vim /etc/security/limits.conf # BEGIN ANSIBLE MANAGED BLOCK root soft nofile 1000000 root hard nofile 1000000</code>

3. AS Installation and Deployment

On CentOS 7 download the EL7 package, extract it, and run the installer:

<code>wget -O aerospike-server-community.tgz 'http://aerospike.com/download/server/latest/artifact/el7'

tar -zxvf aerospike-server-community.tgz
cd aerospike-server-community-5.2.0.2-el7/
./asinstall

# Installation output omitted for brevity</code>

4. Cluster Configuration

After installing on each node, edit /etc/aerospike/aerospike.conf . Aerospike supports two heartbeat modes: multicast (default) and mesh (IP‑based). The example below configures a three‑node mesh cluster with two namespaces (ns_mem and ns_ssd).

<code># Aerospike database configuration file for deployments using raw storage with systemd.

service {
    paxos-single-replica-limit 1
    proto-fd-max 100000
}

logging {
    file /home/aerospike/logs/aerospike.log {
        context any info
    }
}

network {
    service {
        address any
        port 3000
    }
    heartbeat {
        mode mesh
        port 3002
        mesh-seed-address-port 192.168.1.1 3002
        mesh-seed-address-port 192.168.1.2 3002
        mesh-seed-address-port 192.168.1.3 3002
        interval 250
        timeout 10
    }
    fabric { port 3001 }
    info { port 3003 }
}

namespace ns_mem {
    memory-size 40G
    replication-factor 2
    high-water-memory-pct 80
    stop-writes-pct 90
    allow-ttl-without-nsup true
    default-ttl 1d
    storage-engine memory
}

namespace ns_ssd {
    replication-factor 2
    memory-size 40G
    storage-engine device {
        file /home/aerospike/data/ns_ssd.data
        filesize 500G
        scheduler-mode noop
        write-block-size 256K
    }
}</code>

5. Initialize Directories and Start Services

<code>mkdir -p /home/aerospike/data/
mkdir -p /home/aerospike/logs</code>

Start Aerospike as the dedicated user:

<code>su - aerospike
systemctl start aerospike.service</code>

After all three nodes are started, they automatically discover each other and form a three‑node cluster. Verify with the built‑in asadm tool:

<code>Admin> info nodes
... (output showing three nodes) ...</code>

6. Basic AQL Operations

Use the aql console to insert and query data; sets are created on‑the‑fly.

<code>aql> INSERT INTO ns_ssd.demo (PK, foo, bar) VALUES ('key1', 123, 'abc');
OK, 1 record affected.

aql> select * from ns_ssd.demo where PK='key1';
+-----+-------+
| foo | bar   |
+-----+-------+
| 123 | "abc" |
+-----+-------+
1 row in set (0.001 secs)
OK</code>

7. Install and Run AMC Monitoring

Download the latest AMC release and install required packages:

<code>yum -y install gcc
yum -y install python-devel

unzip aerospike-amc-enterprise-4.0.27-1.x86_64.rpm.zip
rpm -ivh aerospike-amc-enterprise-4.0.27-1.x86_64.rpm</code>

Start the monitoring service:

<code>/etc/init.d/amc start</code>

Access the UI at http://<host>:8081/ :

8. Summary

The guide demonstrates a quick ten‑minute deployment of Aerospike for testing purposes; for an even faster “out‑of‑the‑box” experience, consider using the Docker deployment method (link provided).

monitoringNoSQLCluster SetupAerospikeLinux TuningDatabase Installation
Xiaolei Talks DB
Written by

Xiaolei Talks DB

Sharing daily database operations insights, from distributed databases to cloud migration. Author: Dai Xiaolei, with 10+ years of DB ops and development experience. Your support is appreciated.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.