This section describes how to create a backup schedule for a ZooKeeper database on an OpenContrail 4.x cluster.
To create a backup schedule for a ZooKeeper database:
Log in to the Salt Master node.
Configure the zookeeper server role using the following parameters
in cluster/<cluster_name>/infra/backup/server.yml:
parameters:
zookeeper:
backup:
cron: true
server:
enabled: true
hours_before_full: 24
full_backups_to_keep: 5
backup_dir: /srv/volumes/backup/zookeeper
By default, ZooKeeper backup server keeps five full backups.
Configure the zookeeper client role by adding the following parameters
to cluster/<cluster_name>/infra/backup/client_zookeeper.yml:
parameters:
_param:
zookeeper_remote_backup_server: ${_param:infra_kvm_node03_address}
zookeeper:
backup:
cron: True
client:
enabled: true
full_backups_to_keep: 3
hours_before_full: 24
containers:
- opencontrail_controller_1
Caution
The zookeeper_remote_backup_server parameter
must contain the resolvable hostname of the host
on which the zookeeper server is running.
The ZooKeeper backup process keeps three complete backups
on the zookeeper client node. The rsync command moves
the backup files to Zookeeper server node.
If you customized the default parameters, verify that the
hours_before_full parameter of the zookeeper client in
cluster/<cluster_name>/infra/backup/client_zookeeper.yml
matches the same parameter of the zookeeper server
in cluster/<cluster_name>/infra/backup/server.yml.
Run the following command on the Salt Master node:
salt '*' saltutil.refresh_pillar
Apply the salt.minion state:
salt -C 'I@zookeeper:backup:client or I@zookeeper:backup:server' state.sls salt.minion
Refresh grains for the zookeeper client node:
salt -C 'I@zookeeper:backup:client' saltutil.sync_grains
Update the mine for the zookeeper client node:
salt -C 'I@zookeeper:backup:client' mine.flush
salt -C 'I@zookeeper:backup:client' mine.update
Apply the following state on the zookeeper client node:
salt -C 'I@zookeeper:backup:client' state.sls openssh.client,zookeeper.backup
Apply the following state on the zookeeper server node:
salt -C 'I@zookeeper:backup:server' state.sls zookeeper.backup