Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section describes the standard upgrade procedure for upgrading Usage Engine on Oracle Cloud Infrastructure. This procedure should be used to ensure that configurations, persisted data (in the file system or database), and system properties are properly migrated. Workflows will be interrupted shortly at the restart of the ECDs. These instructions will also describe how the timing of the restart of ECDs running non-scalable real-time workflows can be controlled by enabling manual upgrade.

Insert excerpt
Preparations for Upgrade
Preparations for Upgrade
nopaneltrue

Preparing ECDs

Insert excerpt
Upgrade Excerpts for Cloud (4.3)
Upgrade Excerpts for Cloud (4.3)
namePreparingECDsForUpgrade
nopaneltrue
Insert excerpt
Preparations for Upgrade
Preparations for Upgrade
namebackup-db
nopaneltrue

Backup the database by following these steps:

  1. List the databases and locate the one used for Usage Engine:

Code Block
oci psql db-system-collection list-db-systems --compartment-id <compartment_OCID> --all
  1. Perform a backup of the database by running the following command:

Code Block
oci psql backup create --compartment-id <compartment_OCID> --db-system-id <db_system_OCID> --display-name <backup_display_name>
  1. Check if the backup was created successfully by running this command:

Code Block
oci psql backup-collection list-backups --compartment-id <compartment_OCID> --display-name <backup_display_name> --all
  1. Get details about a backup by running this command:

Code Block
oci psql backup get --backup-id <backup_OCID>

The next step is to do a backup of the file system used.

Note

Note!

If there are standalone ECs that are still running and writing their logs to the same file system, events happening after the backup has been initiated will not be included in the backup.

Code Block
oci fs snapshot create --file-system-id <file_system_OCID> --name "<snapshot_name>" --expiration-time <2023-09-15T20:30Z>

After creation, snapshots are accessible under the root directory of the file system at .snapshot/<snapshot_name>.

Insert excerpt
Upgrade Excerpts for Cloud (4.3)
Upgrade Excerpts for Cloud (4.3)
nameActualUpgrade
nopaneltrue

Insert excerpt
Upgrade Excerpts for Cloud (4.3)
Upgrade Excerpts for Cloud (4.3)
nameAfterUpgrade
nopaneltrue

Insert excerpt
Upgrade Excerpts for Cloud (4.3)
Upgrade Excerpts for Cloud (4.3)
nameECDsAfterUpgrade
nopaneltrue

Insert excerpt
Preparations for Upgrade
Preparations for Upgrade
nameRollback
nopaneltrue

Restore Database Backup

To restore the backup, run these commands:

Code Block
oci psql db-system restore --db-system-id <db_system_OCID> --backup-id <backup_OCID>

Restore File System Snapshot

To restore a file system snapshot you need to access the snapshots via a Kubernetes Pod.

You must know the mount target IP address prior to mounting the file system onto the Pod. Before running the Pod, retrieve the mount target IP address from PV output:

Code Block
 kubectl get pv <pv-name> -o jsonpath='{.spec.csi.volumeHandle}'|awk -F: '{print $2}'

Ensure to save the IP address as it will be used as input to mount the file system onto the Pod later.

To run a Kubernetes Pod, run this command:

Code Block
kubectl run nfscli --rm --tty -i --restart='Never' --namespace uepe --image oraclelinux --privileged=true --command -- bash

You will see the command prompt if the Pod created and running. The command prompt indicates that you have logged in to the Pod successfully.

Code Block
user1@user1-MacBook-Pro ~ % kubectl run nfscli --rm --tty -i --restart='Never' --namespace uepe --image oraclelinux --privileged=true --command -- bash
If you don't see a command prompt, try pressing enter.
[root@nfscli /]# 
[root@nfscli /]# 

On the pod, download and install nfs-utils. These are libraries and executables needed to access the File System Storage.

Code Block
[root@nfscli /]# yum -y install nfs-utils 

On the pod, create the mount directory. This is the directory where the mounted file system is located.

Code Block
[root@nfscli /]# mkdir -p /mnt/uepe

On the pod, mount the file system with the mount target IP address that you retrieved and saved prior to running the pod.

Code Block
[root@nfscli /]# mount -o nolock <IP address of the mount target>:/uepe /mnt/uepe

On the pod, list the mount directory.

Code Block
[root@nfscli /]# ls -al /mnt/uepe/
total 3
drwxrwsr-x. 9 root 6000  7 Aug 14 06:51 .
drwxr-xr-x. 1 root root 18 Aug 15 02:34 ..
drwxrwsr-x. 5 root 6000  3 Aug 15 02:34 .snapshot
drwxrwsr-x. 2 6000 6000  0 Aug 14 03:43 3pp
drwxrwsr-x. 3 6000 6000  1 Aug 15 02:00 backup
drwxrwsr-x. 2 6000 6000  0 Aug 14 03:43 jni
drwxrwsr-x. 2 root 6000  0 Aug 14 03:43 keys
drwxrwsr-x. 5 6000 6000  3 Aug 14 06:57 log
drwxrwsr-x. 3 6000 6000  1 Aug 14 05:12 pico-cache
drwxrwsr-x. 2 6000 6000  0 Aug 14 03:43 storage

On the pod, list the available snapshots. These directories listed under .snapshot/ are the <snapshot_name> provided during backup of the file system in previous section.

Code Block
[root@nfscli /]# ls -al /mnt/uepe/.snapshot/
total 3
drwxrwsr-x. 5 root 6000 3 Aug 15 02:35 .
drwxrwsr-x. 9 root 6000 7 Aug 14 06:51 ..
drwxr-xr-x. 2 root 6000 1 Aug  8 07:26 snapshot-aug-1
drwxr-xr-x. 2 root 6000 2 Aug  8 10:01 snapshot-aug-2
drwxrwsr-x. 9 root 6000 7 Aug 14 06:51 snapshot-aug-3

To restore these snapshots within the Pod, copy these snapshots to the destination directory.

Code Block
[root@nfscli /]# cp -rp /mnt/uepe/.snapshot/<snapshot_name>/* <destination_directory_name>

For example, to restore “snapshot-aug-3“ snapshot to platform volume mount directory, follow these steps:

  1. Clean up the existing platform volume mount directory.

Code Block
[root@nfscli /]# rm -rf /mnt/uepe/*
  1. Copy data from “snapshot-aug-3“ to platform volume mount directory.

Note!

Always double check the file permission when you copy or move these snapshots. You want to preserve the file permission when you copy or move

Code Block
[root@nfscli /]# cp -rp /mnt/uepe/.snapshot/snapshot-aug-3/* /mnt/uepe/
  1. Unmount the file system if restore completed successfully.

    Code Block
    [root@nfscli /]# umount /mnt/uepe/
  2. Exit the Pod

Code Block
[root@nfscli /]# exit

Insert excerpt
Preparations for Upgrade
Preparations for Upgrade
nameRollback command
nopaneltrue