Target audience: Mid to Highly skilled Linux, DB2 and GCP admins.
Currently IBM DB2 is not one of the choices for an RDBS in GCP. This article describes how to stand up a simple HA DB2 instance using GCP components. This configuration is intended to be used as a POC or POT demonstration of DB2.
Application modernization is a growing area of focus for enterprises. If you’re considering this path to cloud adoption, this guide explores considerations for the best approach – cloud native or legacy migration – and more.
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.
Create the DB2 environment on GCP – 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 GCP.
- Create a VPC for DB2 that has a public subnet, Firewall rules and Routing Table. These GCP components will be created and configure to a client’s specifications. The firewall rules should include DB2 ports and should limit who can get to the DB2 from the internet.
- Create an instance of one of the GCP public images that meets the client’s virtual machine specification. Make sure that delete boot drive is unchecked.
- Create cloud storage shares for DB2.
- Mount the shares using FUSE.
- Put the remount commands in /etc/fstab
- Upload the DB2 software to it.
- Install DB2.
- Configure DB2 on the Compute Engine instance. Follow the IBM info center for these steps. Put all DB2 installation files on the GCP Storage FUSE mounted 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 stop the instance.
- 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 instance.
- Now create and image from the boot disk of the instance.
- Now create a template and use the image you just created.
- Now create an instance group from the template. The auto scaling group will be a scaling group of 1. Setup a health check for port 50000. Default DB2 port.
- Now create a load balancer and use the instance group.
- Test your configuration by shutting down the DB2. You should see the Auto Scaling destroy the current instance and spin up a new instance of DB2.
DB2 change host instructions: http://www-01.ibm.com/support/docview.wss?uid=swg21258834