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

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

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:

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.