Remove Namespace: Removing Namespace


How do I remove a namespace from a cluster? We have one namespace which has been allocated space on the disk and we are not using it. We want to use that data for other namespaces. Can removal of namespace be done dynamically without taking the whole cluster down?

namespace ns1 {
    memory-size 21474836480
	replication-factor 2
	allow-versions false
	single-bin false
	default-ttl 2592000

    storage-engine device {
	    device /dev/sdb
		load-at-startup true
		data-in-memory false
		write-block-size 131072


For server versions (with updated clustering protocol) and above

Confirm that you have upgraded to the Paxos v5 clustering protocol. See [1] for reference.

Admin> show config like paxos-protocol
~~~~~~~~~~~~~~~~~~~~Service Configuration~~~~~~~~~~~~~~~~~~~~
NODE          :   192.168.100.yyy:3000   
paxos-protocol:   v5                     v5        

Removing (and adding) of a namespace can then be done by rolling restart of the Aerospike cluster nodes:

  1. Stop Aerospike service

sudo service aerospike stop

  1. Update Aerospike configuration by removing (or adding if relevant) the appropriate namespace configuration in the aerospike.conf file.

  2. Start Aerospike service.

  3. Repeat steps 1-3 on all nodes in the cluster keeping 5-10 second window between each nodes restarts to avoid any race condition on multiple nodes trying to join the cluster at the same time.

Workaround for server versions prior to

Unfortunately, there is no way to add or remove a namespace without taking the whole cluster down if you are running server versions prior to We would recommend upgrading to a newer version [1]. However, to avoid downtime, you should be able to change the namespace to data-in-memory and do a rolling restart to claim the space taken by the namespace. You could also make sure the namespace will not be used further by blocking all write requests against it by setting both allow-xdr-writes and allow-nonxdr-writes to false:

  1. Change the configuration of the namespace as such:

  2. Recommended configuration change is as follows:

     namespace ns1 {
         memory-size 1G
         allow-xdr-writes false
         allow-nonxdr-writes false
         storage-engine memory        
  3. Perform a rolling restart on your cluster.

  4. At a later time, when you can afford downtime, remove the above from all configs and do a full the cluster shutdown (stop all nodes, then restart all nodes).


[1] See here for upgrade instructions:



Is there any difference in the steps involved when removing a namespace with strong consistency?

namespace n_conf {
        replication-factor 2
        memory-size 1G
        default-ttl 0 
        migrate-order 4
        strong-consistency true

       storage-engine device {
               file /opt/aerospike/data/n_conf.dat
               filesize 1G
               max-write-cache 256M
               data-in-memory true 
© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.