Creating archive log storage for a new deployment of Db2 on Red Hat® OpenShift

You can dedicate a separate storage area for database archive logs when deploying Db2 on Red Hat OpenShift for the first time. This separate storage area can reduce I/O bottlenecks and improve performance.

About this task

The following procedure can be used with both the Db2uCluster custom resource (CR) or the Db2uInstance CR.

Procedure

In your Db2 CR definition, add the storage volume:
  • For the storage volume (name), enter archivelogs.
  • For storage type, enter "template" in the Db2uCluster CR, or "create" in the Db2uInstance CR.
  • For storageClassName, use the name of the storage class that you are using for data storage.
  • For type, enter ReadWriteOnce in the Db2uCluster CR or enter ReadWriteMany in the Db2uInstance CR.

Examples

The following example shows the syntax to specify a separate storage area for archivelogs for a Db2uCluster CR. The storage class used in the example is ocs-storagecluster-ceph-rbd for the OpenShift® Data Foundation.

apiVersion: db2u.databases.ibm.com/v1
kind: Db2uCluster
metadata:
  name: db2oltp-sample
spec:
...
  storage:
    - name: archivelogs
      type: "template"
      spec:
        storageClassName: "ocs-storagecluster-ceph-rbd"
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
The following example shows the syntax of the archivelogs storage area section of a Db2uInstance CR definition. Like the Db2uCluster CR, the definition uses ocs-storagecluster-cephfs for the OpenShift Data Foundation.
Note: When a separate archivelogs storage area is specified, the logarchmeth1 Db2 database configuration parameter must also be defined in the CR to the disk path /mnt/logs/archive. Ensure that you add the logarchmeth1 field to your specification before you create the CR. If this step is missed, see Fixing logarchmeth1 setting failure due to incorrect disk path value.
apiVersion: db2u.databases.ibm.com/v1
kind: <Db2uInstance>
metadata:
  name: <db2ucluster or db2uinstance>-sample
  spec:
  environment:
    databases:
    - dbConfig:
        LOGARCHMETH1: "DISK:/mnt/logs/archive"
  storage:
    - name: archivelogs
      type: "create"
      spec:
        accessModes:
          - ReadWriteMany
        resources:
          requests:
            storage: 10Gi
        storageClassName: ocs-storagecluster-cephfs