Skip to main content
Loading

Backing Up Indexes with ASMT

The Aerospike Shared-Memory Tool (AMST) backs up indexes that are stored in shared memory, which is a feature of Aerospike Database Enterprise Edition (EE).

note

Starting with version 2.1.0, ASMT requires one or more namespace names when performing a backup operation.

Prerequisites

  • Ensure that the asmt executable has write permission to the backup directory.
  • Stop the Aerospike daemon process (asd) after quiescing it. If the node is still running, asmt will fail.
  • Verify that the backup directory does not include files created by a previous backup operation, as asmt does not overwrite existing files. asmt will not start if the directory has a mix of blocks with different shared-memory keys.

Backup procedure

(Optional) Pre-run check

You can run asmt with the -a option to check whether the indexes can be backed up, without actually executing the backup operation.

sudo ./asmt -a -b -n <namespaces>

You must use the sudo command, so that asmt can run with uid and gid both set to 0.

Required optionDescription
-aAnalyze whether the indexes can be backed up without performing the backup operation.
-bSpecifies the backup operation.
-nOne or more namespaces to be backed up. Use a comma-separated list for multiple namespaces.

Back up the indexes

sudo ./asmt -b -v -p <path-to-backup-directory> -n <namespaces>
Required optionDescription
-bSpecifies the backup operation.
-pSpecifies the path in which to persist the indexes.
-nOne or more namespaces to be backed up. Use a comma-separated list for multiple namespaces.

See Options for ASMT for the complete list of options.

ASMT backs up the indexes from shared memory to the file system. The length of time to execute the operation depends on the size of the indexes. The backup directory contains files with a .dat extension, persisting the shared-memory blocks, with the file names corresponding to shared-memory keys. Compressed backup files have a .dat.gz extension. The base file for a namespace is never compressed, because ASMT must examine its contents prior to restoring the indexes.

What to do next

Reboot the server that hosts your Aerospike cluster node. After the server is rebooted, and before you restart the Aerospike node, run ASMT to restore the indexes. With the indexes in shared memory, the node can perform a warm start.