You can run a patch command to add more memory and CPU to the Db2
Warehouse
service on IBM Software
Hub to support high-availability
or increase processing capacity.
About this task
Db2
Warehouse does not support the cpd scale
command, but you can use a provided script to scale up Db2
Warehouse to use any
increased operating system capacity.
Note: Proceed with the scaling up procedure only if your deployment is privileged (the default
deployment behavior).
Procedure
-
Run the following command to find the respective Db2uCluster or Db2uInstance resource names .
oc get db2ucluster,db2uinstance --all-namespaces
- Set the Db2uCluster or Db2uInstance custom resource
name to the DB2_CR_ID environment variable
DB2_CR_ID=<db2ucluster_cr_name/db2uinstance_cr_name>
- Run the following command for Db2uCluster or Db2uInstance to configure your namespace:
For Db2uCluster:
namespace=$(oc get db2ucluster --all-namespaces | grep ${DB2_CR_ID} | awk {'print $1'})
For
Db2uInstance:
namespace=$(oc get db2uinstance --all-namespaces | grep ${DB2_CR_ID} | awk {'print $1'})
- Use the following commands to patch the Red Hat®
OpenShift®
Db2uCluster or Db2uInstance custom resources for the Db2
Warehouse pod to set higher or lower memory and CPU limits.
In the following example, we patch the Db2uCluster or Db2uInstance custom resources with these entries to set CPU to 12 vCPU and memory to
36 Gi.
oc patch db2ucluster ${DB2_CR_ID} -n ${namespace} --type merge --patch '{"spec": {
"podConfig": {
"db2u": {
"resource": {
"db2u": {
"limits": {
"cpu": "12",
"memory": "36Gi"
}
}
}
}
}
}}'
oc patch db2uinstance ${DB2_CR_ID} -n ${namespace} --type merge --patch '{"spec": {
"podConfig": {
"db2u": {
"resource": {
"db2u": {
"limits": {
"cpu": "12",
"memory": "36Gi"
}
}
}
}
}
}}'
After the patch command, your Db2
Warehouse pod will restart. Wait for Ready
state to indicate 1/1 to confirm that your Db2
Warehouse pod is
ready for use.