Backing Up Indexes with ASMT
The Aerospike Shared-Memory Tool (ASMT) backs up indexes that are stored in shared memory, which is a feature of Aerospike Database Enterprise Edition (EE).
Prerequisites
- Ensure that the
asmtexecutable has write permission to the backup directory. - Stop the Aerospike daemon process (
asd) after quiescing it. If the node is still running,asmtwill fail. - Verify that the backup directory does not include files created by a previous backup operation, as
asmtdoes not overwrite existing files.asmtwill 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 option | Description |
|---|---|
-a | Analyze whether the indexes can be backed up without performing the backup operation. |
-b | Specifies the backup operation. |
-n | One 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 option | Description |
|---|---|
-b | Specifies the backup operation. |
-p | Specifies the path in which to persist the indexes. |
-n | One 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 command 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.