Porting IBM Db2 Warehouse (Linux)

Moving your Db2 Warehouse deployment, whether single node (SMP) or multinode (MPP), is a simple process that requires you to copy your data to the target system and then issue a few docker commands.

Before you begin

Ensure that your Linux® system meets the prerequisites described in Getting container images.

About this task

You can move your deployment to another system or cluster. You can also move your deployment as part of expanding and upgrading your cluster. In addition, you can use the procedure in this topic as a disaster recovery method if your original cluster is down but your data is still intact.

Be aware of the following requirements and restrictions:
  • You cannot port from one platform to another, such as from x86 to POWER® LE or vice versa.
  • You cannot port an SMP deployment to an MPP cluster.
  • The Db2 Warehouse image on the target system cannot be an earlier version. However, you can port to a system with a newer version of Db2 Warehouse.
  • The target system or cluster cannot have any content in the /mnt/clusterfs directory. To delete any content, use the docker rm -rf /mnt/clusterfs or podman rm -rf /mnt/clusterfs command.
  • The target system or cluster cannot have any existing Db2 Warehouse containers. To delete any containers, use the docker rm Db2wh or podman rm Db2wh command.
  • You can port your deployment to a target system or cluster with more or fewer resources than the original deployment had (that is, scale up or down) if it meets the minimum hardware requirements for a Db2 Warehouse deployment.
  • An MPP target cluster does not need to have the same topology as an MPP source cluster, but the target cluster must have one head node and at least two data nodes. The maximum number of nodes is either 24 (one head node and 23 data nodes) or 60 (one head node and 59 data nodes). The maximum depends on the number of data partitions that were allocated when you deployed Db2 Warehouse. For more information, see Scaling your IBM Db2 Warehouse deployment.

To do this task, you require root authority.

To pull a Db2 Warehouse container image, see Getting container images.

Procedure

  1. On the source system, stop the Db2 Warehouse services by issuing the following command. For MPP deployments, issue this command on the head node.
    docker exec -it Db2wh stop
    or
    podman exec -it Db2wh stop
  2. Copy all of the contents of the source system's /mnt/clusterfs directory (with the original user permissions, ownership, and mode intact) to the target system's /mnt/clusterfs directory by using a method such as tar or rsync.
  3. On the target system, ensure that the /mnt/clusterfs directory has all of the data and correct user permissions.
  4. (MPP only) On the target system, modify the nodes file to reflect the new nodes' roles, short host names, and IP addresses.
  5. Log in to Docker/Podman on each node host in the target system by using your API key:
    echo <apikey> | docker login -u iamapikey --password-stdin icr.io
    echo <apikey> | podman login -u iamapikey --password-stdin icr.io
    where <apikey> is the API key that you created as a prerequisite in Getting container images.
  6. On each node host in the intended cluster, pull, create, and initialize the Db2 Warehouse container by issuing the following command:
    docker run -d -it --privileged=true --net=host --name=Db2wh -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 <tag>
    or
    podman run -d -it --privileged=true --net=host --name=Db2wh -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 <tag>
    For the <tag> variable, specify the same container that you used in the source deployment or a newer container than the one that you used in the source deployment. For the latest version of the container, specify one of the following tags.
    • For a container for POWER LE hardware:
      icr.io/obs/hdm/db2wh_ee:v11.5.7.0-cn5-db2wh-ppcle
      
    • For a container for z Systems® hardware:
      icr.io/obs/hdm/db2wh_ee:v11.5.7.0-cn5-db2wh-s390x
    • For a container for x86 hardware:
      icr.io/obs/hdm/db2wh_ee:v11.5.7.0-cn5-db2wh-linux
    If you do not want to deploy the latest version of the container, see the naming convention information in IBM Db2 Warehouse containers.
  7. Check whether the deployment is progressing successfully or is complete by issuing the following command. For an MPP deployment, issue the command on the head node.
    docker logs --follow Db2wh
    or
    podman logs --follow Db2wh
    After the deployment finishes, you should see a message that tells you that you successfully deployed Db2 Warehouse, along with the console URL and login information.
  8. Exit the Docker/Podman logs by pressing Ctrl+C.
  9. On the head node host, log in to the web console by using the web console URL that was provided after the successful completion messages. The URL is https://head_node_IPaddress:8443.