|
| 1 | +[#backup-restore-obs] |
| 2 | += Backing up and restoring Observability service |
| 3 | + |
| 4 | +Backup and restore the Observability service to keep data safe and to support continuity during the hub cluster migration or backup. To help with disruption in metric data collection, use the same S3-compatible object store for both the primary and backup hub clusters. |
| 5 | + |
| 6 | +.Prerequsites |
| 7 | + |
| 8 | +- Ensure that you can run a restore operation for backup types by completing the xref:../business_continuity/backup_restore/backup_restore.adoc#restoring-backup-restore-operation[Using the restore operation for backup types] process. |
| 9 | +
|
| 10 | +.Procedure |
| 11 | + |
| 12 | +Complete the following steps to backup and restore the Observability service: |
| 13 | + |
| 14 | +. To ensure the Observability service recognizes the hub cluster as the `local-cluster`, a managed hub cluster, change the `spec.disableHubSelfManagement` parameter in the `MultiClusterHub` custom resource to `false`. |
| 15 | + |
| 16 | ++ |
| 17 | +*Note:* If you change the default name of your `local-cluster` to another value, the results appear within the changed local cluster name. |
| 18 | + |
| 19 | +. To preserve the tenant ID of the `observatorium` resource as you manually back up and restore the `observatorium` resource, run the following command: |
| 20 | + |
| 21 | ++ |
| 22 | +[source,bash] |
| 23 | +---- |
| 24 | +oc get observatorium -n open-cluster-management-observability -o yaml > observatorium-backup.yaml |
| 25 | +---- |
| 26 | + |
| 27 | +. To backup the `observability` deployment, run the following command: |
| 28 | + |
| 29 | ++ |
| 30 | +[source,bash] |
| 31 | +---- |
| 32 | +oc get mco observability -o yaml > mco-cr-backup.yaml |
| 33 | +---- |
| 34 | + |
| 35 | +. Shut down the Thanos compactor on your primary hub cluster by running the following command: |
| 36 | + |
| 37 | ++ |
| 38 | +[source,bash] |
| 39 | +---- |
| 40 | +oc scale statefulset observability-thanos-compact -n open-cluster-management-observability --replicas=0 |
| 41 | +---- |
| 42 | + |
| 43 | +.. Verify the compactor is not active by running the following command: |
| 44 | + |
| 45 | ++ |
| 46 | +[source,bash] |
| 47 | +---- |
| 48 | +oc get pods observability-thanos-compact-0 -n open-cluster-management-observability |
| 49 | +---- |
| 50 | + |
| 51 | +. Restore the `backup` resources such as the automatically backed-up ConfigMaps and Secrets listed in the backup and restore configuration for Observability. |
| 52 | + |
| 53 | +. To preserve the tenant ID for maintaing continuity in the metrics ingestion and querying, restore the `observatorium` resource to the backup hub cluster. Run the following command: |
| 54 | + |
| 55 | ++ |
| 56 | +[source,bash] |
| 57 | +---- |
| 58 | +oc apply -f observatorium-backup.yaml |
| 59 | +---- |
| 60 | + |
| 61 | +. Apply the backed up `MultiClusterObservability` custom resource to start the Observability service on the new restored hub cluster. Run the following command: |
| 62 | + |
| 63 | ++ |
| 64 | +[source,bash] |
| 65 | +---- |
| 66 | +oc apply -f mco-cr-backup.yaml |
| 67 | +---- |
| 68 | ++ |
| 69 | +The operator starts the Observability service and detects the existing `observatorium` resource, reusing the preserved tenant ID instead of creating a new one. |
| 70 | + |
| 71 | +. Verify that the Observability service runs on your new hub cluster. Run the following command: |
| 72 | + |
| 73 | ++ |
| 74 | +[source,bash] |
| 75 | +---- |
| 76 | +oc get pods -n open-cluster-management-observability |
| 77 | +---- |
| 78 | + |
| 79 | +. Verify that the `observability-controller` `managedclusteraddon` does not have a status in the `DEGRADED` column, and that the `PROGRESSING` status is not set to `False`. Run the following command: |
| 80 | + |
| 81 | ++ |
| 82 | +[source,bash] |
| 83 | +---- |
| 84 | +oc get managedclusteraddons -A | awk 'NR==1 || /observability-controller/ |
| 85 | +---- |
| 86 | + |
| 87 | +. Verify metrics collection from your managed clusters by accesing Grafana. |
| 88 | + |
| 89 | +. Verify that your managed clusters are connected to your new hub cluster by checking for the `Available` status for each managed cluster. |
| 90 | + |
| 91 | +. Shut down the Observability service on your previous hub cluster by removing the resources. Run the following command: |
| 92 | + |
| 93 | ++ |
| 94 | +[source,bash] |
| 95 | +---- |
| 96 | +oc delete mco observability |
| 97 | +---- |
| 98 | + |
0 commit comments