Upgrading the external etcd store created with the Db2 Warehouse etcd image

You can upgrade the external etcd store to use the latest etcd image packaged with Db2®.

Before you begin

Before upgrading, ensure that you have created an external etcd store with etcd that is packaged with Db2 Warehouse. See Deploying the etcd store that is packaged with the Db2 installation for more information.

About this task

The following steps in this procedure use a Db2uCluster resource as an example in the commands and code samples. However, you can perform this procedure on a Db2uInstance as well. Db2uInstance commands are provided where necessary in the steps.

Before you start the upgrade procedure, perform the rolling upgrade for your Db2uCluster or Db2uInstance resources in your HADR topology first. Ensure that Governor has been stopped on both the primary and standby deployments.

  1. Set environment variables for your deployments:
    DB2UCLUSTER_PRIMARY="db2-hadr-primary"
    DB2UCLUSTER_STANDBY="db2-hadr-standby"
    PROJECT_PRIMARY="zen"
    PROJECT_STANDBY="zen"
    
    Db2uCluster names can be obtained with the oc get db2ucluster command in the namespace where the deployments are located. For a Db2uInstance, you can obtain names with oc get db2uinstance. Primary and Standby are the current HADR primary and principal standby deployments respectively.
  2. Run the stop governor command on your deployments.
    Note: Governor does not run on auxiliary standbys. This step isn't necessary on auxiliary deployments.

    First, run the command on your principal standby deployment:

    oc exec -it c-${DB2UCLUSTER_STANDBY}-db2u-0 -n ${PROJECT_STANDBY} -- sv stop governor
    
    Then, run the command on your primary deployment:
    oc exec -it c-${DB2UCLUSTER_PRIMARY}-db2u-0 -n ${PROJECT_PRIMARY} -- sv stop governor
Note: The script will use the version of the provided Db2uCluster or Db2uInstance CR to determine the proper etcd image to use. If your Db2 Warehouse custom resource has not been upgraded yet, upgrade first and then come back to generate the latest specification.

Procedure

  1. Follow the steps in Deploying the etcd store that is packaged with the Db2 installation to generate the etcd service and statefulset YAML files. Ensure that you use the appropriate script based on the version of your Db2uCluster or Db2uInstance resource.
  2. Use oc apply -f ext_etcd.yaml to upgrade the etcd and statefulset to use the new image.
  3. The etcd pods in the statefulset will restart one at a time. You can monitor this restart process with the oc get po command. In the sample output below, the db2u-etcd-1 and db2u-etcd-2 pods have recently restarted with the new image:
    db2u-etcd-0                                                     1/1     Running     0          10d
    db2u-etcd-1                                                     0/1     Running     0          23s
    db2u-etcd-2                                                     1/1     Running     0          54s
  4. Note: Do not perform this step if you are in the process of performing an HADR rolling upgrade. Return to the HADR rolling upgrade steps to complete. Once the rolling upgrade is complete, follow this step to start Governor.
    Start Governor on the primary (current HADR primary) deployment, followed by the standby deployment.
    1. First, start Governor on the primary deployment:
      oc exec -it c-${DB2UCLUSTER_PRIMARY}-db2u-0 -n ${PROJECT_PRIMARY} -- su - db2inst1 -c "${HOME}/governor/governor.sh start"
      
    2. Start Governor on the standby deployment:
      oc exec -it c-${DB2UCLUSTER_STANDBY}-db2u-0 -n ${PROJECT_STANDBY} -- su - db2inst1 -c "${HOME}/governor/governor.sh start"