Upgrading the external etcd store created with the Db2 etcd image

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

Before you begin

Create 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

Perform the rolling upgrade for your Db2uCluster resources in your HADR topology first. Confirm that Governor is no longer running on both the primary and standby deployments.
  1. Set environment variables for your deployments:
    DB2UCLUSTER_PRIMARY="db2wh-crd-hadr-primary"
    DB2UCLUSTER_STANDBY="db2wh-crd-hadr-standby"
    PROJECT_PRIMARY="zen"
    PROJECT_STANDBY="zen"
    
    Db2uCluster names can be obtained with the following command, in the namespace where the deployments are located:
    oc get db2ucluster
    Primary and Standby are the current HADR primary and principal standby deployments, respectively.
  2. Run the stop governor command on your deployments. Run the command on your principle standby deployment first, then your primary deployment.
    Note: Governor does not run on auxiliary standbys.
    1. Run the following command on your principal standby deployment:
      oc exec -it c-${DB2UCLUSTER_STANDBY}-db2u-0 -n ${PROJECT_STANDBY} -- sv stop governor
      
    2. Run the following command on your primary deployment:
      oc exec -it c-${DB2UCLUSTER_PRIMARY}-db2u-0 -n ${PROJECT_PRIMARY} -- sv stop governor
      

Procedure

  1. Refer the following steps to generate the etcd service and StatefulSet YAML files: Deploying the etcd store that is packaged with the Db2 installation. Use the appropriate script based on the version of your Db2uCluster resource.
    Note: The script uses the version of the provided Db2uCluster custom resource to determine the proper etcd image to use. If your Db2uCluster custom resource has not been upgraded, perform the upgrade and then come back to generate the latest specification.
  2. Use the following command to upgrade the etcd StatefulSet to use the new image:
    oc apply -f ext_etcd.yaml
  3. Monitor the etcd pods with the following command:
    oc get pod
    The etcd pods restart one at a time.
    In the following sample output, 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. Start Governor on the HADR deployments.
    Important: Do not perform this step if you are also performing an HADR rolling upgrade. Only start Governor when the rolling upgrade is complete.
    1. 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"