This section describes how to create a backup schedule for a MAAS PostgreSQL database using the Backupninja utility. By default, Backupninja runs daily at 1.00 AM.
To create a backup schedule for a MAAS PostgreSQL database:
Log in to the Salt Master node.
Add the following lines to cluster/infra/maas.yml
:
classes:
- system.backupninja.client.single
- system.openssh.client.root
parameters:
_param:
backupninja_backup_host: <IP>
root_private_key: |
<generate_your_keypair>
Note
The backupninja_backup_host
parameter is the backupninja
server that runs on any server, for example, on the Salt Master
node.
Include the following pillar to the node that runs the
backupninja
server and will store the database backups remotely:
classes:
- system.backupninja.server.single
parameters:
_param:
backupninja_public_key: <generate_your_keypair>
Optionally, override the default configuration of the backup schedule as described in Configure a backup schedule for a MAAS PostgreSQL database.
Apply the salt.minion
state:
salt -C 'I@backupninja:client or I@backupninja:server' state.sls salt.minion
Refresh grains for the backupninja
client node:
salt -C 'I@backupninja:client' saltutil.sync_grains
Update the mine for the backupninja
client node:
salt -C 'I@backupninja:client' mine.flush
salt -C 'I@backupninja:client' mine.update
Apply the backupninja
state on the backupninja
client node:
salt -C 'I@backupninja:client' state.sls backupninja
Applying this state creates two backup configuration scripts. By default,
the scripts are stored in the /etc/backup.d/
directory and will run
daily at 1:00 AM.
Refresh grains for the backupninja
server node:
salt -C 'I@backupninja:server' state.sls salt.minion.grains
Apply the backupninja
state on the backupninja
server node:
salt -C 'I@backupninja:server' state.sls backupninja