Skip to main content


An IBM DB2 Architecture Using AWS

Target audience: Mid to Highly skilled Linux, DB2 and AWS admins.

Currently IBM DB2 is not one of the choices for an RDBS in AWS. This article describes how to stand up a simple HA DB2 instance using AWS components. This configuration is intended to be used as a POC or POT demonstration of DB2.

Again high-level design and the details will need to be worked out with a specific client and IBM Best practices. Internet domains, SSL/TLS and certs are not cover, these items will also need to be incorporated to the client’s specifications.

The picture below depicts a MQ/IIB Active Passive HA configuration.

MQ/IIB Active Passive HA configuration.

Create the DB2 environment on AWS – Active Passive:

Other references for this design are listed below. Again, this article focuses on using just the IBM software and the tools available in AWS.

  1. Create a VPC for DB2 that has a public subnet, Internet Gateway, Security Group, Network ACLs and Routing Table. These AWS components will be created and configure to a client’s specifications. The Security Group and Network ACLs should include DB2 ports and should limit who can get to the DB2 from the internet.
  2. Create an instance of one of the AWS AMI’s that meets the client’s virtual machine speciation’s.
  3. Upload the DB2 software to it.
  4. Install DB2, do not define any DB2 instances
  5. Create an AWS EFS file system and mount it to the current AMI instance.
  6. Set up the /etc/fstab so the EFS NFSv4 file system mounts on bootup.
  7. Then save that AMI as a custom IBMDB2 base AMI. This will be the AMI you select as you model the DB2 Environment.
  8. Now configure DB2 on the EC2 server. Follow the IBM info center for these steps. Put all DB2 installation files on the AWS EFS file system.
  9. Now write a script.
    1. The script will execute at bootup. Call it DB2_startup.
    2. It will reconfigure DB2 to use the IP address of the current EC2 instance.
    3. It will start the DB2.
    4. Put DB2_startup script in /etc/init.d
    5. chmod 755 /etc/init.d/Db2_startup
    6. chkconfig –add DB2_startup
    7. chkconfig DB2_startup on
    8. Check it: chkconfig –list DB2_startup
  10. Now save this instance as your IBMDB2RT AMI.
  11. Now reboot the Instance to see your script work. If DB2 startup, then continue. Otherwise go back to step 9 and debug your script.
  12. Now delete the current IBMDB2RT instance.
  13. Now create a Launch Configuration/Auto Scaling Group and use the IBMDB2RT AMI for the instance.
  14. The auto scaling group will be a scaling group of 1.
  15. Start the Launch Configuration
  16. Now create an Elastic Load Balance for the IBMDB2RT instance.
  17. Add the IBMDB2RT Instance and have it monitor the DB2 Listener. This port numbers will vary if the client chooses not to use standard DB2 Listener port.
  18. Modify the Auto Scaling Group to use the Elastic Load Balancer as its health check.
  19. Test your configuration by shutting down the DB2. You should see the Auto Scaling Group destroy the current instance and spin up a new instance of the DB2.


IBM DB2 – change host instructions:



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Chuck Misuraca, Technical Architect

More from this Author

Follow Us