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.
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.
echo 3 > /proc/sys/vm/drop_caches
echo 1048576 > /proc/sys/vm/min_free_kbytes
echo "vm.min_free_kbytes=1048576" >> /etc/sysctl.confDisable 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:
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.serviceNVMe 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:
vim /etc/security/limits.conf
# BEGIN ANSIBLE MANAGED BLOCK
root soft nofile 1000000
root hard nofile 10000003. AS Installation and Deployment
On CentOS 7 download the EL7 package, extract it, and run the installer:
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 brevity4. 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).
# 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
}
}5. Initialize Directories and Start Services
mkdir -p /home/aerospike/data/
mkdir -p /home/aerospike/logsStart Aerospike as the dedicated user:
su - aerospike
systemctl start aerospike.serviceAfter all three nodes are started, they automatically discover each other and form a three‑node cluster. Verify with the built‑in asadm tool:
Admin> info nodes
... (output showing three nodes) ...6. Basic AQL Operations
Use the aql console to insert and query data; sets are created on‑the‑fly.
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)
OK7. Install and Run AMC Monitoring
Download the latest AMC release and install required packages:
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.rpmStart the monitoring service: /etc/init.d/amc start 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).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
