Nav

About Backup and Recovery

This product was previously named Anypoint Platform On-Premises Edition. Beginning with the 1.5.1 release, it is named Anypoint Platform Private Cloud Edition.

Performing Backups

Scheduling hourly backups to external storage every hour is recommended to preserve your data. Make sure you copy the archive to an external reliable storage outside of the Anypoint cluster, using appropriate storage system used in your organization.

You must be performed backup on a master node. If you originally installed the platform with a 6 server configuration, then only three of the original servers should be master nodes, if you instead used a 1 or 3 server "flavour", then all servers should be master nodes.

To know which of your nodes are registered as master, run the following command on any node of the cluster:

kubectl get nodes -o yaml|grep master -A 5|grep hostname

You can launch the creation of a backup by running the commands below from any one of the servers registered as master nodes in the cluster:

  1. Enter the gravity utility through this command:

    sudo gravity enter
  2. Create the backup:

    gravity system backup gravitational.io/anypoint:0.0.0+latest /ext/share/backup.tar.gz

This will create an archive of the system state, stored in /var/lib/gravity/planet/share/backup.tar.gz.

After running the backup command, you may see the following error message:

Error from server: container "anypoint-backup" in pod "anypoint-backup-<pod-id>" is waiting to start: PodInitializing

This simply means that the Kubernetes pod that runs the backup job is not up and running yet. It should start in a couple seconds

Restoring the System

To restore a system from your backup, use the existing cluster or create a new fresh cluster with the same amount of servers as the restored version. In either case, you must do the following:

  1. Enter one of the nodes in your cluster, having root access.

  2. Place the ‘tar.gz` archive file in the location /var/lib/gravity/planet/share. You can transfer this file securely via the following command:

    scp /backup-path/to-restore.tar.gz your_username@remotehost.edu:/var/lib/gravity/planet/share
  3. Enter the gravity utility through this command:

    sudo gravity enter
  4. Run the command below:

    gravity system restore gravitational.io/anypoint:0.0.0+latest /ext/share/to-restore.tar.gz

    This command will restore your entire cluster from one of your backups.

  5. Then run this other command:

    ACCESS_KEY=$(kubectl get secret pithos-keys -o yaml | grep master.key | awk '{print $2}' | base64 -d) && SECRET_KEY=$(kubectl get secret pithos-keys -o yaml | grep master.secret | awk '{print $2}' | base64 -d) && \
    kubectl get secret hybrid-rest-cloudhub -o yaml | grep override.properties | awk '{print $2}' | base64 -d | sed "s/\(hybrid\.storage\.s3\.accessKey=\).*\$/\1${ACCESS_KEY}/" | sed "s/\(hybrid\.storage\.s3\.secretKey=\).*\$/\1${SECRET_KEY}/" | base64 | tr -d '\n' | { read a; kubectl patch secret hybrid-rest-cloudhub -p '{"data":{"override.properties":"'$a'"}}'; }

    This command manually updates a secret on Kubernetes. This step won’t be necessary in further releases.

  6. Restart all of the pods in your cluster to pull up the new secrets. You can do that through the following command:

    kubectl delete pods --all

    Kubernetes will take care of reinstancing every pod automatically, this will take a couple of minutes.

Applying Updates

Application updates will be provided to you as a .tar.gz archive file. To apply them, do the following:

  1. Copy the file to the server with scp (i.e. scp anypoint-update.tar.gz username@server:/home/username)

  2. SSH to the server

  3. Copy the update file to /var/lib/gravity/planet/share

  4. Enter the gravity utility through this command:

    sudo gravity enter
  5. Run the following command:

    gravity app import --ops-url=https://gravity-site.kube-system.svc.cluster.local:3009 --insecure /ext/share/anypoint-update.tar.gz
  6. Then run:

    gravity app export --ops-url=https://gravity-site.kube-system.svc.cluster.local:3009 --insecure gravitational.io/anypoint:<version>
  7. Finally, in the Site management UI in your browser. Click the ‘Update’ button on the new version now available on the ‘Updates’ screen.