Skip to main content
Loading

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:

  1. Stop the Aerospike service

    systemctl stop aerospike
  2. Update the aerospike.conf file

    Add or remove namespace contexts as needed.

  3. 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.

  1. Stop application traffic for the namespace to be renamed

  2. Back up the namespace to be renamed

    You can use asbackup and asrestore to perform on-demand cluster backup.

Perform the following steps on the cluster nodes one at a time:

  1. Stop the Aerospike service

    systemctl stop aerospike
  2. 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 or dd Linux utilities. The Zeroize Multiple SSDs Simultaneously Knowledge Base article has more information about deleting data from raw devices.

  3. Update the aerospike.conf file

    Update the namespace context with the desired name.

  4. Start the Aerospike service

    systemctl start aerospike
  5. 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.