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. Stop the application traffic for the namespace which needs to be renamed.
  2. Take a backup of the cluster data. Refer to the asbackup documentation for further details.
  3. For clusters running the new cluster protocol introduced in version 3.13 and above, the following steps can be done in a rolling fashion, one node at a time, for older versions, the entire cluster should be brought down.
  4. Stop the asd daemon and 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.
  5. Update Aerospike configuration to reflect the new name.
  6. Bring up Aerospike service on the cluster nodes.
  7. 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].

XDR case

In case the cluster is XDR enabled, additional steps have to be taken, irrespective of the topology.

  1. Stop the application traffic for the namespace which needs to be renamed.
  2. Make sure the xdr_timelag is zero or is very close to, especially if there are other namespaces which have XDR enabled.
  3. For clusters running the new cluster protocol introduced in version 3.13 and above, the following steps can be done in a rolling fashion, one node at a time, for older versions, the entire cluster should be brought down.
  4. Take a backup of the cluster data. Refer to the asbackup documentation for further details.
  5. Stop the asd daemon and 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.
  6. Delete the log in xdr-digestlog-path.
  7. Make sure the other nodes in the cluster have finished failed processing for the node which is taken down by checking xdr_active_failed_node_sessions, this statistic should be zero on rest of the nodes.
  8. Update Aerospike configuration to reflect the new name.
  9. Bring up Aerospike service on the cluster nodes.
  10. 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