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
-
Launch an EC2 instance by performing the following substeps:
- Log in to the AWS Management Console.
- In the EC2 Dashboard, click Launch Instance.
- 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.
- Select one of the memory optimized instance types, such as the r4.16xlarge instance, and click Next: Configure Instance Details.
- 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.
- 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.
- Optional: Add tags.
- Click Next - Configure Security Group.
- Add a rule for at least HTTPS. By default, all incoming ports are blocked.
- Click Review and Launch.
- Review your choices and click Launch.
- Specify a new or existing key value pair and download it. You will use the key value pair to connect to the EC2 instance.
- Click Launch Instances.
- Click Connect.
- Follow the instructions to connect to the instance. You now have control of a Linux® server that is running in the AWS cloud.
-
Create a password for root by issuing the following command:
sudo passwd -
Install Docker by performing the following substeps:
- Issue the following commands:
yum update -y yum install -y docker service docker start - Review the Docker setup by issuing the following command:
docker info
- Issue the following commands:
-
Deploy Db2 Warehouse by performing the following substeps:
- Log in to Docker using your API
key:
whereecho <apikey> | docker login -u iamapikey --password-stdin icr.io<apikey>is the API key that you created as a prerequisite in Getting container images. - 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 - Confirm that the EBS volumes are mounted by issuing the following
command:
df -Th | grep clusterfs - 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
Optionally, you can specify the -e option=value option=value … parameter. For information about these options, see Configuration options.
- Log in to Docker using your API
key:
-
Check whether the deployment is progressing successfully by issuing the following
command:
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.docker logs --follow Db2wh - Exit the Docker or logs by pressing Ctrl+C.