Skip to main content
Version: Develop

Properties

This document describes the supported properties for the a9s Backup Service.

Regular Backup Cycle

The Backup Manager is creating backups in a regular cycle to ensure your data is saved. To configure the time when a full backup should be created, the full_backup_repeat property can be set. The configuration works similar to a cronjob but has limited functionality. Only stars, numbers and intervals are allowed.

The default value is:

"30 1 * * *"

Description: '(Minute) (Hour) (Day of the month) (Month) (Day of the week)'

Example:

properties:
anynines-backup-manager:
full_backup_repeat: "30 */4 * * *"

You can exclude specific Service Instances from this Backup cycle by changing the instance config with the a9s Service Dashboard API V1 (see Service-Dashboard)

Retention Policy

It is possible to configure a custom retention policy to match your expectations. Therefore, the following properties can be set.

Regular Backup Deletion

note

To configure the retention policy, it is important to understand the following routines of the backup deletion cycle:

  • First Routine: This routine marks the Service Instance backups as "deleted" in the Backup Manager database depending on the current Service Instance state in the a9s Service Broker. Be aware that, the backups still exist but in a "deleted" state. The process is governed by the delete_backup_repeat property which sets the frequency of the routine.

  • Second Routine: This routine permanently deletes the backup records from the Backup Manager database and removes all related data. By default, it runs every hour. This clean-up is based on the min_backups_per_instance and min_backup_age for active Service Instances, and the retention_time_for_backups_of_a_deleted_instance for deleted Service Instances.

It is worth noting that, due to the backup deletion cycle, the "deleted" backup metrics may fluctuate, increasing or decreasing based on the routines mentioned above.

Like backup creation, the Backup Manager also deletes backups in a regular cycle. The delete_backup_repeat property can be set to configure when the deletion starts. This only starts the process of deletion then it will take some time until every backup that can be deleted is completely deleted. The configuration works similarly to a cronjob but has limited functions. Only stars, numbers and intervals are allowed.

The default value is:

"30 1 * * *"

Description: '(Minute) (Hour) (Day of the month) (Month) (Day of the week)'

Example:

properties:
anynines-backup-manager:
delete_backup_repeat: "30 */12 * * *"

Minimum Amount of Backups

The minimum amount of backups, for any instance, before a backup is deleted can be set with the min_backups_per_instance property. If there are fewer backups for a Service Instance present, backups will not be removed. If you have more backups than the configured value, it is still possible that no backup is removed because they might not have reached the min_backup_age value. Backups are only getting deleted if both values are reached.

Default: 5

Example:

properties:
anynines-backup-manager:
min_backups_per_instance: 5

Minimum Age of Backups

The minimum age, in days, of a backup before it is allowed to be deleted can be set with the min_backup_age property. If you have older backups than the configured value, it is still possible that no backup is removed because they might not have reached the min_backups_per_instance value. Backups are only getting deleted if both values are reached.

Default: 7

Example:

properties:
anynines-backup-manager:
min_backup_age: 7

Retention Policy for Deleted Service Instances

To ensure that backups are getting deleted when a Service Instance is deleted the retention_time_for_backups_of_a_deleted_instance property can be set. This property defines how many days to wait until all backups of this Service Instance should be deleted. Before that date is reached the normal retention policy is used. If it is set to 0, the backups of a deleted Service Instance will be deleted with the next run of the "delete old backups" job.

Example:

properties:
anynines-backup-manager:
retention_time_for_backups_of_a_deleted_instance: 30

Database Configuration

The database can be configured in the a9s Backup Manager by setting the anynines-backup-manager.database BOSH property.

Example:

properties:
anynines-backup-manager:
database:
encoding: utf8
database_name: backupmanager
user_name: backupmanager
password: backupmanager-password
host: backupmanager-host
port: 5432
pool: 10

The properties encoding, port, and pool are optional and they use the values from above as default values.

Service Broker Configuration

The a9s Service Brokers can be configured in the a9s Backup Manager by setting the anynines-backup-manager.service_brokers BOSH property. We have included Ops files in anynines-deployment to add the service specific a9s Service Brokers to the configuration.

Furthermore, you can extend this configuration to set a limit on the amount of backups running in parallel, as seen in the example below. This is a per Data Service limit which is higher in hierarchy than the default global limit (shared_parallel_backup_tasks), and takes precedence over it. This parameter is optional and its accepted values are integers > 0, or -1 to deactivate the limit which is the default value. For more information on this property please refer to a9s Backup Manager BOSH Properties.

For example it looks like this for the a9s PostgreSQL Service Broker:

properties:
anynines-backup-manager:
service_brokers:
postgresql:
api_endpoint: 'http://postgresql-service-broker.service.dc1.((iaas.consul.domain)):3000'
username: admin
password: brokersecret
parallel_backups_limit: 5

a9s PostgreSQL Specific

Lock Wait Timeout

Logical backups use the tool pg_dumpall to create backups. We set the --lock-wait-timeout command line argument for pg_dumpall to 1 hour by default.

A failed backup attempt will be repeated a few times. Therefore a failed backup because of locking issues can take a multitude of 1 hour.

The default value (in milliseconds) can be changed via the BOSH property backup-agent.plugins.input.postgresql.local.pg_dumpall_lock_wait_timeout.

To change the value for example to 20 seconds, you could apply the following change to the a9s PostgreSQL service manifest:

...
properties:
template-uploader:
template-custom-ops: |
- type: replace
path: /instance_groups/name=pg/jobs/name=backup-agent/properties/backup-agent/plugins/input/postgresql?/local?/pg_dumpall_lock_wait_timeout?
value: 20000
...