Loading

MuleSoft Anypoint Platform Private Cloud Edition (Anypoint Platform PCE) Backup and Restore Procedure

Data pubblicazione: Apr 3, 2025
Descrizione

This knowledge article outlines the detailed procedure for backing up and restoring a MuleSoft Private Cloud Edition (PCE) with Anypoint Monitoring and Visualization (AMV) on PCE 3.2.x for testing purposes. 
The process involves creating a new PCE cluster for backup, performing the backup, and then restoring the backup to another new PCE cluster.
The above ensures data integrity and operational continuity in the event of system failures or migrations within our internal infrastructure.

Please follow the below steps for the whole Backup Procedure of your PCE Cluster

Backup Procedure steps:

  1. Cluster Setup:

    1. New Cluster Creation:

      • Provision a new PCE cluster to serve as the source for the backup.

    2. DNS Configuration:

    3. Within customer DNS platform( Example: AWS Route 53)

      • Create a new record:

        • Specify a descriptive name (e.g., pce325.pce.mulesoft.com).

        • Point the A-Record or CNAME alias to the load balancer associated with the new PCE cluster.

        • Ensure the DNS is resolving to the correct 3.2.5 PCE version.

      • Save the record.

    4. Access Management UI Verification:

      • Update the DNS configuration within the PCE Access Management UI to match the DNS record.

      • Update the cert within Access Management to match the CN/SAN. Contact your PCE Managed Services architect or partner if you need help with this step.
      • Verify successful login using the configured DNS (e.g., pce325.pce.mulesoft.com) and the appropriate credentials for the 3.2.5 version.

    5. Hybrid Server Setup:

      • Configure any necessary hybrid servers required for your environment.

    6. Application Deployment and Configuration:

      • API Development and Publication:

        • Create a sample API in Design Center.

        • Publish the API to Exchange.

      • API Manager Configuration:

        • Create a new API instance in API Manager, utilizing the API published from Exchange.

      • Application Deployment:

        • Deploy any required applications to the PCE environment.

      • API Activation Verification:

        • Confirm that the API in API Manager transitions to the "Active" state.

      • Traffic Generation:

        • Initiate traffic to the deployed API to generate runtime data.

      • Custom Dashboard Creation:

        • Create custom dashboards in Anypoint Monitoring to visualize key metrics.

      • Alert Setup:

        • Configure alerts in Anypoint Monitoring to monitor critical system events.

      • Alert Monitoring:

        • Verify that alerts are triggered as expected.

  2. Backup Execution:

    1. Backup Types:

      • This procedure focuses on two backup types:

        • Gravity Backup (for system state).

        • InfluxDB Backup (for monitoring data).

    2. Gravity Backup:

      • Log in to any node within the PCE cluster.

      • Execute the following command:
         
        sudo gravity backup
        /var/lib/gravity/planet/share/backup.tar.gz

  1. InfluxDB Backup:
  • InfluxDB data is crucial for monitoring. To back it up:

    • Log into a node that has the InfluxDB pod running.

    • Execute the following command to create a backup directory:

mkdir /var/lib/gravity/planet/share/influxdb_backup

sh /var/lib/gravity/site/packages/unpacked/gravitational.io/anypoint/3.2.0*/resources/kubernetes/amv-backup-restore/amv-backup-restore.sh -d /var/lib/data/influxdb/backup -a backup -f influxdb_backup.tar.gz

#(use sh -x if you want more debugging).
#The point release version should match your Anypoint PCE version.

#The file /var/lib/gravity/planet/share/influxdb_backup.tar.gz now contains the influxDB backup.

Risoluzione

Please follow the below steps for the Restore Procedure of your PCE Cluster

Restore Procedure steps:

  1. Cluster Preparation:

    • New Cluster Creation: Provision a new PCE cluster for the restore operation.

  2. Secret Capture:

    • Crucially, capture all necessary secrets from the source cluster before initiating the restore. Missing secrets can lead to failure.

#take backup of secrets for reference ( optional )
for SECRET in $(kubectl get secrets -n dias | awk '{print $1}')

do 

kubectl get secret $SECRET -o yaml -n dias > /tmp/$SECRET.yaml

done

  1. DNS Configuration:

    • Update the DNS configuration in Route 53 and the Access Management UI to match the DNS used during the backup process (e.g., pce325.pce.mulesoft.com).

  2. Backup File Transfer:

    • Transfer the backup.tar.gz and influxdb_backup.tar.gz files to a directory accessible by the target restore cluster (e.g., /var/lib/gravity/planet/share on an AMV Node). Use scp for secure transfer:

scp /backup-path/to-restore.tar.gz your_username@remotehost.edu:/var/lib/gravity/planet/share

scp /backup-path/influxdb_backup.tar.gz your_username@remotehost.edu:/var/lib/gravity/planet/share

  1. Restore Execution:

    • Pod Deletion (Dias Namespace):

      • To ensure new pods are created based on the restored state, delete the existing pods in the dias namespace
        NOTE: This ensures that the correct platform certificate gets propagated to the Monitoring service ingestor. 

kubectl get pods --no-headers -n dias | grep dias-prov-k8s-amr-ingestor-router-comp | xargs kubectl delete pod -n dias

#List pods (optional)
kubectl get pods -n dias

#Delete specific amr-ingestor-router-comp pods:

kubectl delete pod -n dias dias-prov-k8s-am-ingestor-comp-0  dias-prov-k8s-am-ingestor-comp-1 dias-prov-k8s-am-ingestor-comp-2 --force --grace-period=0

#verify the pod deletions :
kubectl get pods -n dias

  • Attaching Sample Screenshots before running the Restore job
    Secrets before restore Job 


  1. InfluxDB Restore will be performed first then will work on Gravity restore:

    • Log into an AMV node that has the InfluxDB pod running.

    • Create a restore directory

mkdir /var/lib/gravity/planet/share/influxdb_restore

sudo tar -xzvf /var/lib/gravity/planet/share/influxdb_backup.tar.gz -C /var/lib/gravity/planet/share/influxdb_restore

sh /var/lib/gravity/site/packages/unpacked/gravitational.io/anypoint/3.2.0*/resources/kubernetes/amv-backup-restore/amv-backup-restore.sh -f /var/lib/data/influxdb/backup/influxdb_backup.tar.gz -va restore

#(use sh -x if you want more debugging)
#The point release version should match your Anypoint PCE version.

 

  1. Gravity Restore:

    • Log in to the node you copied the backup to in the restore target cluster.

    • Execute the restore command

sudo gravity restore /var/lib/gravity/planet/share/to-restore.tar.gz

#Note: The restore process typically takes 40-60 minutes.

  • Attaching Sample Screenshots during Restore job process
    New secret files are generated, Upon restoration, the aforementioned secrets are deleted and subsequently recreated.




We can observe the above highlighted secrets will get deleted and get created in the process

 

  1. NFS Restore (If Applicable):

    • If you are not reusing the original NFS, manually restore the NFS files.

    • NFS Mounting Example (AWS EFS):

mkdir nfs_mount_folder

#Replace ${NFS} with the appropriate NFS version, copy the backup files to the mounted directory.

sudo mount -t nfs4 -o rw,vers=${NFS}:/ /home/ec2-user/nfs_mount_folder

cp backup-3x-dd-mm-yy.tar.gz nfs_mount_folder/

  1. Post-Restore Verification:

    • Application Functionality:

      • Test the deployed applications to ensure they are functioning correctly.

      • Restart the mule server for restore to work correctly 

    • API Activation:

      • Verify that the APIs in API Manager are in the "Active" state.

      • Restart the mule server for restore to work correctly 

  • Dashboard and Alert Verification:

    • Confirm that custom dashboards and alerts are restored and functioning as expected.

  • Data validation:

    • Check for data consistency and completeness, especially InfluxDB data that we have merged.

 

Risorse aggiuntive

For More Information on Anypoint PCE, refer to https://docs.mulesoft.com/private-cloud/latest/

Numero articolo Knowledge

004633482

 
Caricamento
Salesforce Help | Article