Scaling Out/In a Db2 Warehouse installation

To modify the compute per partition of a Db2® Warehouse deployment, you can utilize the patch command to either increase or decrease the number of nodes. The scale out/in operation only accommodates changes to the number of nodes and not the number of multiple logical nodes (MLN).

About this task

Note: This procedure is only supported for a Db2uInstance CR.
Before deploying the Db2 Warehouse, the MLN number must be evenly distributed across all the nodes. Each node must have a minimum of one MLN. Therefore, the total number of MLNs specified prior to deployment determines the maximum number of nodes that can be scaled out to. It is essential to take this into account during the deployment planning process to ensure the even distribution of MLNs and optimal performance of the system.
The following is an example of how the "number of MLNs" and "number of nodes" configurations could be mapped:
Table 1. Mapping Options
Number of MLN's Number of Nodes
1 1
2 1 or 2
3 1 or 3
4 1 or 2 or 4
5 1 or 5
6 1 or 2 or 3 or 6
7 1 or 7
8 1 or 2 or 4 or 8
9 1 or 3 or 9
10 1 or 2 or 5 or 10

Procedure

  1. Obtain the name of the relevant Db2uInstance resource and create an environment variable to reference it:
    oc get db2uinstance --all-namespaces
    db2uinstance=db2uinstance_resource_name
  2. Configure the namespace variable by running the following command:
    namespace=$(oc get db2uinstance --all-namespaces | grep ${db2uinstance} | awk {'print $1'})
  3. To adjust the number of nodes in the OpenShift® Db2uInstance CR, use the patch command. This will increase or decrease the number of Db2 pods:
    oc patch db2uinstance ${db2uinstance} --type merge --patch '{"spec": {
    "nodes": 6}
    }'

    In the above example, the command patches the Db2uInstance custom resource to set the number of nodes to 6.

    After executing the patch command, the existing Db2 pod(s) will restart, and new Db2 pod(s) will start up in case of scaling out. Conversely, existing Db2 pod(s) will be deleted if scaling down until the number of Db2 pod(s) matches the new number of nodes specified. It is recommended to wait until all the Db2 pod(s) reach a Ready state of 1/1, which indicates that they are ready and operational.