Important: IBM Cloud Pak for Data
Version 4.6 will reach end of support (EOS) on 31 July, 2025. For more information, see the
Discontinuance of service announcement for
IBM Cloud Pak for Data Version 4.X.
Upgrade to IBM Software Hub Version
5.1 before IBM Cloud Pak for Data Version 4.6 reaches end of
support. For more information, see Upgrading IBM Software Hub in the IBM Software Hub Version 5.1
documentation.
Before you can run the db2 backup or db2 restore
commands, you need to identify the Db2
Warehouse catalog node and data nodes of the database
deployment.
Procedure
-
To identify the Db2
Warehouse containers, run the following command on any node in your
cluster:
kubectl get pods -n ${PROJECT_CPD_INSTANCE} | grep db2u
This command returns a list of one or more nodes for the Db2
Warehouse database
configuration. A symmetric multiprocessing (SMP) configuration has only one physical node. A
massively parallel processing (MPP) configuration has a container on each physical node in the
deployment.
A sample SMP configuration:
db2wh-1556786589-db2u-0 1/1 Running 0 3h54m
A
sample MPP configuration with three physical
nodes:
db2wh-1557883508-db2u-0 1/1 Running 0 3h26m
db2wh-1557883508-db2u-1 1/1 Running 0 3h26m
db2wh-1557883508-db2u-2 1/1 Running 0 3h26m
- To identify which container node is the Db2
Warehouse catalog node:
For
a single node configuration, the catalog node is always the same as physical node.
For a
configuration with two or more nodes, you need to identify which physical node is the catalog node
by reading the db2nodes.cfg file.
- Open a shell to any container
node:
kubectl exec -it -n ${PROJECT_CPD_INSTANCE} db2wh-container-name -- bash
Replace
db2wh-container-name
with the node name of any of the containers found the previous step.
- Read the db2nodes.cfg file on the container node:
cat ~db2inst1/sqllib/db2nodes.cfg
Here is a sample
db2nodes.cfg file that shows six multiple logical nodes
(MLN) over three physical nodes:
0 db2wh-1557883508-db2u-0 0
1 db2wh-1557883508-db2u-1 1
2 db2wh-1557883508-db2u-2 2
3 db2wh-1557883508-db2u-0 0
4 db2wh-1557883508-db2u-1 1
5 db2wh-1557883508-db2u-2 2
The first node that is listed is the catalog node. In
this example,
db2wh-1557883508-db2u-0 is the catalog node.
- Exit that bash shell and open a new shell to the catalog node.
kubectl exec -it -n ${PROJECT_CPD_INSTANCE} db2wh-catalog-name bash
Replace
db2wh-catalog-name
with the name of the catalog node that you found in the previous step.
What to do next
After you open a bash shell on the catalog node, you can proceed
with backing up or restoring.