OpenContrail 4.x: Create a backup schedule for a ZooKeeper database

OpenContrail 4.x: Create a backup schedule for a ZooKeeper databaseΒΆ

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:

  1. Log in to the Salt Master node.

  2. 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.

  3. 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.

  4. 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.

  5. Run the following command on the Salt Master node:

    salt '*' saltutil.refresh_pillar
    
  6. Apply the salt.minion state:

    salt -C 'I@zookeeper:backup:client or I@zookeeper:backup:server' state.sls salt.minion
    
  7. Refresh grains for the zookeeper client node:

    salt -C 'I@zookeeper:backup:client' saltutil.sync_grains
    
  8. Update the mine for the zookeeper client node:

    salt -C 'I@zookeeper:backup:client' mine.flush
    salt -C 'I@zookeeper:backup:client' mine.update
    
  9. Apply the following state on the zookeeper client node:

    salt -C 'I@zookeeper:backup:client' state.sls openssh.client,zookeeper.backup
    
  10. Apply the following state on the zookeeper server node:

    salt -C 'I@zookeeper:backup:server' state.sls zookeeper.backup