Deploying IBM Db2 Warehouse SMP on Amazon Web Services manually

Manually deploying Db2® Warehouse in an SMP environment on Amazon Web Services (AWS) includes launching an EC2 instance and installing Docker before issuing a docker run command.

Before you begin

Ensure that you meet the prerequisites described in Getting container images.

Procedure

  1. Launch an EC2 instance by performing the following substeps:
    1. Log in to the AWS Management Console.
    2. In the EC2 Dashboard, click Launch Instance.
    3. On the page for choosing an Amazon Machine Image (AMI), select any AMI. The AMI contains the software configuration that you require for launching the instance.
    4. Select one of the memory optimized instance types, such as the r4.16xlarge instance, and click Next: Configure Instance Details.
    5. Specify at least the following instance information:
      • In the Number of instances field, enter 1, which corresponds to the single node of an SMP deployment.
      • From the Tenancy list, select Dedicated host - Launch this instance on a Dedicated host.
      Click Next: Add Storage.
    6. Specify storage as follows:
      • For the root volume, change the size to at least 50 GiB.
      • Add one or more EBS volumes for the /mnt/clusterfs file system. For example, you could add three volumes with the names /dev/sdb, /dev/sdc, and /dev/sdd. You will specify these volumes later, when you deploy Db2 Warehouse.
      Click Next - Add Tags.
    7. Optional: Add tags.
    8. Click Next - Configure Security Group.
    9. Add a rule for at least HTTPS. By default, all incoming ports are blocked.
    10. Click Review and Launch.
    11. Review your choices and click Launch.
    12. Specify a new or existing key value pair and download it. You will use the key value pair to connect to the EC2 instance.
    13. Click Launch Instances.
  2. Click Connect.
  3. Follow the instructions to connect to the instance. You now have control of a Linux® server that is running in the AWS cloud.
  4. Create a password for root by issuing the following command:
    sudo passwd
  5. Install Docker by performing the following substeps:
    1. Issue the following commands:
      yum update -y
      yum install -y docker
      service docker start
    2. Review the Docker setup by issuing the following command:
      docker info
  6. Deploy Db2 Warehouse by performing the following substeps:
    1. Log in to Docker using your API key:
      echo <apikey> | docker login -u iamapikey --password-stdin icr.io
      where <apikey> is the API key that you created as a prerequisite in Getting container images.
    2. Mount the EBS volumes that you created. To mount the volumes, modify the following sample script for your environment and run the script. The sample script is based on having three volumes.
      # create mount point directory
      mkdir /mnt/clusterfs
      mkdir /mnt/clusterfs1
      mkdir /mnt/clusterfs2
      # create ext4 filesystem on new volume
      mkfs -t ext4 /dev/sdb
      mkfs -t ext4 /dev/sdc
      mkfs -t ext4 /dev/sdd
      # add an entry to fstab to mount volume during boot
      echo "/dev/sdb       /mnt/clusterfs   ext4    defaults,nofail 0       2" >> /etc/fstab
      echo "/dev/sdc       /mnt/clusterfs1   ext4    defaults,nofail 0       2" >> /etc/fstab
      echo "/dev/sdd       /mnt/clusterfs2   ext4    defaults,nofail 0       2" >> /etc/fstab
      # mount the volume on current boot
      mount -a
    3. Confirm that the EBS volumes are mounted by issuing the following command:
      df -Th | grep clusterfs
    4. Pull, create, and initialize the latest Db2 Warehouse container by issuing the following docker run or command. The basic command is as follows:
      docker run -d -it --privileged=true --net=host --name=Db2wh -v /mnt/clusterfs:/mnt/bludata0 -v /mnt/clusterfs:/mnt/blumeta0 icr.io/obs/hdm/db2wh_ee:v11.5.7.0-cn5-db2wh-linux
    If you have more than one volume, specify a -v /mnt/volume:/mnt/storage/volume parameter for each of those additional volumes. For example, if you have three volumes that are called clusterfs, clusterfs1, and clusterfs2, you would specify the -v /mnt/clusterfs1:/mnt/storage/clusterfs1 and -v /mnt/clusterfs2:/mnt/storage/clusterfs2 parameters for the second and third volumes.

    Optionally, you can specify the -e option=value option=value parameter. For information about these options, see Configuration options.

  7. Check whether the deployment is progressing successfully by issuing the following command:
    docker 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 or logs by pressing Ctrl+C.