How do I rename an existing namespace in an Aerospike cluster?


#1

How do I rename an existing namespace in a cluster?

Problem Description

I have a cluster that has a namespace called test. I intend to rename it to bar but I get a warning as follows when I try to start up Aerospike. I have already tried to delete/truncate the data from client application before renaming.

WARNING (drv_ssd): (drv_ssd.c:2446) read header: device /dev/sdb previous namespace test now bar, check config or erase device
FAILED ASSERTION (drv_ssd): (drv_ssd.c:3191) unable to read disk header /dev/sdb

Explanation

Aerospike server relies on the device header definitions when starting up. The warning means that the namespace header does not match the name in Aerospike configuration and thus, the server fails to start up.

Solution

  1. Take a backup of the cluster data. See documentation on asbackup for more details.
  2. Stop Aerospike on the server node(s). If this is the only namespace in the cluster, it would be easier to bring the entire cluster down. If there are multiple namespaces, you could potentially do this in a rolling manner (1 node at a time) for clusters running the new cluster protocol introduced in version 3.13 and above.
  3. Delete the stored data for storage-engine device configured in the namespace that needs to be renamed. Simply delete the file if using a file. For raw devices, use blkdiscard or dd. Refer to the Zeroize Multiple SSD Simultaneously knowledge base article.
  4. Update Aerospike configuration to reflect the new name.
  5. Bring up Aerospike service on the cluster nodes.
  6. Once all nodes are on the new configuration with the new namespace name, restore data back into the cluster under the new namespace using the -n flag in [asrestore].

Notes

Keywords

RENAME NAMESPACE CHANGE UPDATE NAME

Timestamp

06/19/2018