Managing Namespaces
Aerospike database clusters contain one or more namespaces, similar to tablespaces in an RDBMS. Namespaces segregate data with different storage requirements, allowing users to optimize performance by keeping different kinds of data on different kinds of storage hardware.
Namespaces are defined in the main Aerospike
configuration file. You can add, remove, or
rename namespaces by editing aerospike.conf
. Namespaces
can be configured for optimal
performance in a variety of use cases by specifying a
storage engine, a
data retention policy, and
other parameters.
The Aerospike server reads the configuration file when the server starts. You need to stop the server, edit the configuration file, and restart the server for changes to take effect. You can perform a rolling restart of cluster nodes to prevent server downtime.
We recommend that you back up your cluster before performing namespace alterations.
Add or remove a namespace
Perform the following steps on the cluster nodes one at a time:
Stop the Aerospike service
systemctl stop aerospike
Update the
aerospike.conf
fileAdd or remove
namespace
contexts as needed.Start the Aerospike service
systemctl start aerospike
Rename an existing namespace
It's not possible to rename an existing namespace in place, but you can create a new namespace with the desired name and move data from an existing namespace into it.
Stop application traffic for the namespace to be renamed
Back up the namespace to be renamed
You can use
asbackup
andasrestore
to perform on-demand cluster backup.
Perform the following steps on the cluster nodes one at a time:
Stop the Aerospike service
systemctl stop aerospike
Delete stored data for the namespace to be renamed
If your data is stored in a file, delete the file. For raw devices, use the
blkdiscard
ordd
Linux utilities. The Zeroize Multiple SSDs Simultaneously Knowledge Base article has more information about deleting data from raw devices.Update the
aerospike.conf
fileUpdate the namespace context with the desired name.
Start the Aerospike service
systemctl start aerospike
Restore the old namespace's data
When all the cluster nodes have restarted with the new namespace configuration, restore data back into the cluster, using the
-n
flag to specify the new namespace.
When the backup process is complete, the new namespace is ready to use.