Back up data with Aerospike Backup Service
For the complete documentation index see: llms.txt
All documentation pages available in markdown.
This page describes how to create a backup routine, run backups, and verify them with Aerospike Backup Service (ABS). For architecture concepts, see Routines and policies. For YAML field detail, see Configure ABS.
Applies to
- Product: Aerospike Backup Service (ABS) 3.7.x.
- Audience: database administrators and operators who schedule, trigger, and verify backups.
- Outcome: the backup job finishes, and
GET /v1/backups/fulllists a new backup whoserecord-countmatches the records you expected.
Set BASE_URL to your ABS listen address:
export BASE_URL=http://localhost:8080Before you start
Verify that you meet the following prerequisites:
- ABS is installed and can reach the Aerospike Database cluster. See Install ABS.
- The Database user has
readprivilege or higher on the namespaces you back up. See Privileges. - Storage credentials can create objects in the backup destination.
Create a routine
A routine names the cluster, storage, policy, namespaces, and schedule. This example backs up the app namespace daily, with incremental backups every two hours.
aerospike-clusters: prod: seed-nodes: - host-name: 10.0.1.10 port: 3000 credentials: user: backup-user password: secrets:cluster-creds:password secret-agent-name: secret-agent
secret-agents: secret-agent: address: secret-agent.example.com port: 3005 connection-type: TCP
storage: s3-backups: s3-storage: bucket: company-as-backups path: prod s3-region: us-east-1 min-part-size: 52428800
backup-policies: daily: parallel: 8 parallel-write: 8 file-limit: 1000 compression: mode: ZSTD level: 3 incr-mode: differential retention: full: 14 incremental: 7
backup-routines: app-daily: interval-cron: "@daily" incr-interval-cron: "0 0 0/2 * * ? *" source-cluster: prod storage: s3-backups backup-policy: daily namespaces: ["app"]Cron expressions are in Quartz format (Seconds Minutes Hours Day-of-Month Month Day-of-Week, optional Year).
@hourly, @daily, @weekly, @monthly, and @yearly are also valid.
Cron fields follow schedule-timezone and fall back to UTC if omitted.
The on-demand delay and the from and to list filters are in milliseconds, and schedule-timezone does not convert them.
See Quartz schedules.
namespaces: [] backs up every namespace in the cluster.
Optional set-list and bin-list restrict the backup to named sets or bins.
Omit incr-mode or set it to differential unless you want cumulative incrementals.
Choose a retention policy
The retention setting on a backup policy limits how many backups ABS keeps in storage.
If you omit retention, ABS keeps every backup and storage use grows without bound.
Use these guidelines to size it:
retention.fullis the number of full backups to keep. The minimum is1, which means each new full backup deletes the previous one and leaves a single restore point.retention.incrementalis the number of most recent full backups for which ABS keeps incremental backups. It can’t exceedfull. A value of0deletes all earlier incremental backups after each full backup. If you set onlyfull, ABS applies the same count to incrementals.- Set
fullto cover your recovery point objective. For example, with a daily full backup,full: 14lets you restore to any full backup from the last 14 days. Incremental backups let you restore to points between those full backups. You usually need them only for the most recent full backups, so a smallerincrementalvalue saves storage. - ABS applies retention in the background after each successful full backup. It doesn’t delete backups when an incremental backup completes, and it never deletes preemptively. Provision storage for at least one more full backup than
full, because the new backup exists before ABS removes the oldest one. - An on-demand full backup also triggers retention, so it can remove older backups sooner than the schedule would.
backup-policies: daily: retention: full: 14 # Keep 14 full backups incremental: 3 # Keep incrementals for the 3 latest full backupsSee retention in the configuration reference.
Filter records with an expression
The filter-exp field on a routine applies an Aerospike filter expression during the backup query.
Only matching records are written to the backup.
filter-exp takes a Base64-encoded expression, not text such as age > 25.
Build the expression with an Aerospike client library, encode it as Base64, and paste that string into the routine.
filter-exp is mutually exclusive with a multi-set set-list.
Use one set, or omit set-list to include all sets.
import as "github.com/aerospike/aerospike-client-go/v8"
exp, err := as.ExpGreater(as.ExpIntBin("age"), as.ExpIntVal(25)).Base64()// exp == "kwOTUQKjYWdlGQ=="import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.Expression;
Expression filter = Exp.build(Exp.gt(Exp.intBin("age"), Exp.val(25)));System.out.println(filter.getBase64());// prints "kwOTUQKjYWdlGQ=="from aerospike_helpers.expressions import GT, IntBin
# Assuming client is an active aerospike.Client connectionfilter_exp = GT(IntBin("age"), 25).compile()b64 = client.get_expression_base64(filter_exp)print(b64)# prints "kwOTUQKjYWdlGQ=="The following routine backs up records in the users set whose age is greater than 25:
backup-routines: adultsBackup: interval-cron: "@daily" source-cluster: prod storage: s3-backups backup-policy: daily namespaces: ["test"] set-list: ["users"] filter-exp: "kwOTUQKjYWdlGQ==" # age > 25After the job finishes, compare record-count on GET /v1/backups/full with the number of records you expected the expression to select.
Apply configuration
Save your changes to the configuration file that ABS loads, then apply them.
For Linux packages, the default file is /etc/aerospike-backup-service/aerospike-backup-service.yml.
To apply changes without restarting ABS:
curl -X POST "$BASE_URL/v1/config/apply"A 200 OK response means ABS applied the configuration.
Restart ABS when you change anything in the service section, such as the HTTP or HTTPS listener, logging, or service.backup settings:
systemctl restart aerospike-backup-serviceTo confirm that ABS restarted, run systemctl status aerospike-backup-service.
The output shows Active: active (running).
Jobs that are already running keep the configuration they started with. New jobs use the applied configuration.
You can also change clusters, storage, policies, and routines through the configuration API (PUT/POST under /v1/config/...).
GET responses redact literal secrets as "[secret]".
Leave "[secret]" in place when you PUT an unchanged secret. See API usage examples.
Confirm the routine is loaded
curl -s "$BASE_URL/v1/config/routines"curl -s "$BASE_URL/v1/config/clusters"The routine name in those responses is the name you pass to backup and restore endpoints.
Trigger an on-demand backup
Full backup:
curl -X POST "$BASE_URL/v1/backups/full/app-daily"Incremental backup (requires a completed full backup):
curl -X POST "$BASE_URL/v1/backups/incremental/app-daily"A 202 Accepted response means ABS scheduled the job.
An optional delay query parameter waits that many milliseconds before the job starts.
POST /v1/backups/schedule/ROUTINE_NAME is a legacy endpoint that triggers a full backup.
Use /v1/backups/full/ instead.
Watch a running backup
curl -s "$BASE_URL/v1/backups/currentBackup/app-daily"While a full backup runs, the response includes a full object with total-records, done-records, percentage-done, and metrics.pipeline. After the job finishes, full is omitted and last-full is updated.
metrics.pipeline is a REST field on this status object, not a Prometheus metric. Use it when tuning throughput. See Performance tuning.
List backups
curl -s "$BASE_URL/v1/backups/full"curl -s "$BASE_URL/v1/backups/incremental"Optional from and to query parameters filter by Unix epoch time in milliseconds.
The list contains only backups in the storage configured for the routine. After a storage change, historical objects in the old destination do not appear here.
A successful list entry includes key (the storage path of the backup), record-count, namespace, created, and finished. Copy key when you restore from a path. See Restore data.
Verify a backup
- Confirm HTTP
202on the trigger request. - Wait until
GET /v1/backups/currentBackup/ROUTINE_NAMEno longer includesfullorincremental. - Confirm
GET /v1/backups/fullshows a new entry whoserecord-countmatches the namespace. - Optionally confirm
aerospike_backup_service_backup_events_total{outcome="success"}increased. See Monitor ABS.
If the job never appears, ABS might have skipped it.
ABS skips an incremental backup when no full backup has completed.
Unless the policy sets concurrent-incremental to true, ABS also skips an incremental backup when another backup is running or a full backup is scheduled for the same time.
ABS skips a full backup when another full backup is running.
See Monitor ABS.
A disabled routine does not produce skip events, because ABS does not schedule it. On-demand triggers still run a disabled routine.
Pause and resume a routine
Disable scheduling without deleting the routine. Disabling also cancels a backup that is running for the routine:
curl -X PUT "$BASE_URL/v1/config/routines/app-daily/disable"Enable it again:
curl -X PUT "$BASE_URL/v1/config/routines/app-daily/enable"You can also set disabled: true on the routine in the YAML file and apply the configuration.
This stops future scheduled runs but does not cancel a running backup.
interval-cron is required, so do not comment it out.
Cancel a running backup
curl -X POST "$BASE_URL/v1/backups/cancel/app-daily"ABS stops running full and incremental jobs for that routine.
Canceling does not delete the partial backup files.
ABS writes metadata.yaml for each namespace when that namespace finishes.
The folder of a namespace that was still running stays in storage without metadata.yaml, so ABS doesn’t list it and timestamp restore skips it.
A path restore that points at that folder still runs, and restores only the records written before the cancel.
Retention also skips folders without metadata.yaml, so delete the folder yourself if you don’t need it.
In a routine with several namespaces, the namespaces that finished before the cancel stay listed and restorable.
Cancel has no effect until every namespace in the run has started. A cancel sent earlier is ignored, and the backup runs to completion.
With concurrent-incremental: true, cancel stops only the most recently started incremental backup.
Prometheus records outcome="canceled" when the scrape sees the event.