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.
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.
- 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.
- Create an instance of one of the AWS AMI’s that meets the client’s virtual machine speciation’s.
- Upload the DB2 software to it.
- Install DB2, do not define any DB2 instances
- Create an AWS EFS file system and mount it to the current AMI instance.
- Set up the /etc/fstab so the EFS NFSv4 file system mounts on bootup.
- Then save that AMI as a custom IBMDB2 base AMI. This will be the AMI you select as you model the DB2 Environment.
- 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.
- Now write a script.
- The script will execute at bootup. Call it DB2_startup.
- It will reconfigure DB2 to use the IP address of the current EC2 instance.
- It will start the DB2.
- Put DB2_startup script in /etc/init.d
- chmod 755 /etc/init.d/Db2_startup
- chkconfig –add DB2_startup
- chkconfig DB2_startup on
- Check it: chkconfig –list DB2_startup
- Now save this instance as your IBMDB2RT AMI.
- Now reboot the Instance to see your script work. If DB2 startup, then continue. Otherwise go back to step 9 and debug your script.
- Now delete the current IBMDB2RT instance.
- Now create a Launch Configuration/Auto Scaling Group and use the IBMDB2RT AMI for the instance.
- The auto scaling group will be a scaling group of 1.
- Start the Launch Configuration
- Now create an Elastic Load Balance for the IBMDB2RT instance.
- 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.
- Modify the Auto Scaling Group to use the Elastic Load Balancer as its health check.
- 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.
References:
IBM DB2 – change host instructions:
http://www-01.ibm.com/support/docview.wss?uid=swg21258834