How do I update the file size for my file-backed namespace?


#1

Summary

This article covers the steps to increase and decrease the filesize configuration on an Aerospike cluster.

Solution

To update the filesize configuration, follow the steps in this article.

A sample configuration for a namespace that is backed up by device looks like this:

namespace <namespace-name> {
    memory-size <SIZE>G             # Maximum memory allocation for data and
                                    # primary and secondary indexes.
    storage-engine device {         # Configure the storage-engine to use
                                    # persistence. Maximum size is 2 TiB
    file /opt/aerospike/<filename>  # Location of data file on server.
    # file /opt/aerospike/<another> # (optional) Location of data file on server.
    filesize <SIZE>G                # Max size of each file in GiB.
    data-in-memory true             # Indicates that all data should also be
                                    # in memory.
    }
}

Here is the documentation reference for the configuration filesize: http://www.aerospike.com/docs/reference/configuration#filesize

Increase filesize

  1. Change the filesize in the config file. Ensure that the relevant partition has required free disk space left. To add a new file to the configuration, ensure that it’s added as the last entry in the Aerospike storage configuration.

    Note: You do not have to delete and recreate the file when increasing the configured size of the file.

  2. Restart aerospike

/etc/init.d/aerospike restart)
  1. Wait for port 3000 to open and for the node to rejoin the cluster.
cat /var/log/aerospike/aerospike.log | grep -i 'cake'
  1. Proceed with other nodes in the cluster one by one , repeat above steps. To avoid any data inconsistency, we recommend waiting for migrations to complete between each restart.

Decrease filesize

Decreasing the size of the files with an Aerospike service restart will potentially end up deleting random data which can results in unexpected behavior on the Aerospike cluster due to the truncation, maybe even landing into low available percentage on the node. Thus, you would need to delete the file itself and let the data be migrated from the other nodes in the cluster.

  1. Stop Aerospike server.
  2. Delete the file and update the configuration with the new filesize.
  3. Start Aerospike server.