Multiple asd Instances
It is possible to run multiple, independent Aerospike Daemon instances on
a single node. One use case for running multiple Aerospike
instances is to leverage the
auto-pin numa
configuration option which requires the asd
process to be pinned to a
non-uniform memory access (NUMA) node.
Use the following procedure to run multiple asd
instances:
Create a custom service file with parameter
By default, the Aerospike service file is located at
/usr/lib/systemd/system/aerospike.service
. Move the original to another location. Create a new file in the formatSERVICE-NAME@.service
in the/usr/lib/systemd/system
directory. For the remainder of this procedure, we will use a file namedaerospike_X@.service
.The following is an example of a custom service file located at
/usr/lib/systemd/system/aerospike_X@.service
:[Unit]
Description=Aerospike Server %I
After=network.target
Wants=network.target
[Service]
LimitNOFILE=100000
TimeoutSec=15
User=root
Group=root
EnvironmentFile=/etc/sysconfig/aerospike
PermissionsStartOnly=True
ExecStartPre=/usr/bin/asd-systemd-helper
ExecStart=/usr/bin/asd $ASD_OPTIONS --config-file /etc/aerospike/aerospike%i.conf --fgdaemon --instance %i
[Install]
WantedBy=multi-user.targetCopy configuration files
By default, the Aerospike configuration file is located at
/etc/aerospike/aerospike.conf
. Create a copy for eachasd
instance you intend to run:cp /etc/aerospike/aerospike.conf /etc/aerospike/aerospike1.conf
cp /etc/aerospike/aerospike.conf /etc/aerospike/aerospike2.confSet the
mod-lua
path on each of those files to the new locationsFor
aerospike1.conf
:mod-lua {
user-path /opt1/aerospike/usr/udf/lua/
}For
aerospike2.conf
:mod-lua {
user-path /opt2/aerospike/usr/udf/lua/
}Modify the work-directory paths
The
work-directory
parameter in each configuration file should point to a different location:work-directory /opt1/aerospike
and
work-directory /opt2/aerospike
Modify port settings to be unique
By default, the Aerospike configuration file specifies port 3000 for Aerospike's use. In each of the new configuration files, ensure that the service port is unique.
Validate the instances
Run the following commands to verify that
systemctl
can find the services.systemctl status aerospike_X@1.service
systemctl status aerospike_X@2.serviceExpected output:
aerospike_X@1.service - Aerospike Server 1 Loaded: loaded (/lib/systemd/system/aerospike_X@.service; disabled; vendor> Active: inactive (dead)
Enable the new services
systemctl enable aerospike_X@1.service
systemctl enable aerospike_X@2.serviceStart the new services
systemctl start aerospike_X@1.service
systemctl start aerospike_X@2.service
We recommend that you enable rack awareness
when running multiple asd
instances on a physical host. asd
instances on the same host should be part of the same rack.