This section describes how to create a backup schedule for a Cassandra database for your OpenContrail 4.x cluster.
To create a backup schedule for a Cassandra database:
Log in to the Salt Master node.
Configure the cassandra
server role.
By default, the Cassandra backup server keeps five full backups.
You can change the default settings by specifying the following parameters
in cluster/<cluster_name>/infra/backup/server.yml
:
parameters:
_param:
...
cassandra:
backup:
cron: true
server:
enabled: true
hours_before_full: 24
full_backups_to_keep: 5
backup_dir: /srv/volumes/backup/cassandra
Enable the scheduler backup process and configure
the cassandra
client role:
Add the following parameters to
cluster/<cluster_name>/opencontrail/control_init.yml
:
parameters:
_param:
...
cassandra:
backup:
cron: True
By default, the Cassandra backup procedure keeps three complete backups
on the cassandra
client node.
The rsync command moves the backup files
to the Cassandra backup server.
Optional. Change the default settings by specifying
the following parameters in
cluster/<cluster_name>/opencontrail/control_init.yml
:
parameters:
_param:
...
cassandra:
backup:
cron: True
client:
enabled: true
cleanup_snaphots: true
full_backups_to_keep: 3
hours_before_full: 24
...
Note
Mirantis recommends setting true
for the cleanup_snaphots
parameter so that
the backup script removes all previous database snapshots
once the current database backup is done.
Verify or add the specified host as the Cassandra backup server in
cluster/<cluster_name>/infra/backup/client_cassandra.yml
file:
parameters:
_param:
cassandra_remote_backup_server: ${_param:infra_kvm_node03_address}
The cassandra_remote_backup_server
parameter must contain
the resolvable hostname of the host
on which the cassandra
server is running.
If you customized the default parameters, verify that the
hours_before_full
parameter of the cassandra
client in
cluster/<cluster_name>/opencontrail/control_init.yml
matches the same parameter of the cassandra
server
in cluster/<cluster_name>/infra/backup/server.yml
.
Refresh pillars:
salt '*' saltutil.refresh_pillar
Apply the salt.minion
state:
salt -C 'I@cassandra:backup:client or I@cassandra:backup:server' state.sls salt.minion
Refresh grains for the cassandra
client node:
salt -C 'I@cassandra:backup:client' saltutil.sync_grains
Update the mine for the cassandra
client node:
salt -C 'I@cassandra:backup:client' mine.flush
salt -C 'I@cassandra:backup:client' mine.update
Apply the following state to add a Cassandra user:
salt -C 'I@cassandra:backup:server' state.apply linux.system
Apply the following state on the cassandra
client nodes:
salt -C 'I@cassandra:backup:client' state.sls openssh.client,cassandra.backup
Apply the following state on the cassandra
server nodes:
salt -C 'I@cassandra:backup:server' state.sls cassandra