Skip to main content
Loading

Restoring Indexes with ASMT

Before restarting the Aerospike node, you can run ASMT to restore the indexes. The length of time it takes to restore indexes depends on their size.

note

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

Prerequisites

  • Ensure that the Aerospike daemon process (asd) is not running.
  • Ensure that asmt has read permission to the backup files.

Restore procedure

(Optional) Pre-run check

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

sudo ./asmt -a -r -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 an indexes can be restored without performing the restore operation.
-rSpecifies the restore operation.
-nOne or more namespaces to be restored. Use a comma-separated list for multiple namespaces.

Restore the indexes

sudo ./asmt -r -v -p <path-to-backup-directory> -n <namespaces>
Required optionDescription
-rSpecifies the restore operation.
-pSpecifies the path to the directory containing the index backup files.
-nOne or more namespaces to be restored. Use a comma-separated list for multiple namespaces.

See Options for ASMT for the complete list of options.

After ASMT restores the indexes, the backup directory still contains backup files.

Troubleshooting

Do not restart the Aerospike daemon (asd) before ASMT finishes restoring the indexes. If you do so, both ASMT and asd will fail. If this happens, you must follow these steps:

  1. Delete any shared-memory segments that ASMT created before it failed. You can do so by running this command:
    # remove primary index shared memory segments
    ipcs | grep ^0xae | awk '{print $1}' | xargs -i sudo ipcrm -M {}
    # remove secondary index shared memory segments
    ipcs | grep ^0xa2 | awk '{print $1}' | xargs -i sudo ipcrm -M {}
  2. Run asmt again to restore the indexes.

What to do next

With the indexes restored to shared memory, the node can perform a warm start.