Monday, April 7, 2014

DB2 Q Replication setup for an active active solution PART 1

How to setup DB2 Q Replication

We are about a setup DB2 Q Replication that demonstrates active active solution. Active - Active  simply means changes happening at source should go to target and at same time changes happening at target should go to source.

High level steps:

1) Install DB2 9.7 on Fedora 18 OS - I'm Fedora OS as its free edition supported by REDHAT community.
2) Install Websphere MQ 7.1 for messaging system between 2 DB2 databases.
3) Create MQ objects needed for active active Q replication.
4) setup a replication for a sample table to demonstrate active active replication.

Below is the setup of two databases named TESTA and  TESTB for demonstration of active - active Q replication between two db2 databases. Below is how the setup look like.



Links to download the needed software's

1) Fedora 18 or above ( Free copy ) from here :- http://fedoraproject.org/en_GB/get-fedora-all

2) DB2 9.7 AESE ( trail 90 days ) from here https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_us&source=swg-dm-db297trial&S_CMP=web_dw_rt_swd

3) Websphere 7.1 (trail 90 days ) from here :- www.ibm.com/webspheremq/downloads

Installation procedure of DB2 9.7 on Fedora OS

After installing fedora and Vmware tools you will be able to copy the downloaded trails files to the host machine to proceed with installation. An advice here when you try to copy to host machine, Use the command with sudo access ( systemctl mask tmp.mount ), This will turn off any filesystem from being mounted on /tmp, forcing it to be on / instead. To turn it on again, run ( systemctl unmask tmp.mount )

1) Its always a best practice to do a prerequisite check before installing DB2

[db2inst1@fedorabox server]$ cd server/
[db2inst1@fedorabox server]$ sudo sh db2prereqcheck
[sudo] password for db2inst1:
WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
WARNING:
   The 32-bit library file libpam.so is not found on the system.

Above you can see that there is a warning that libpam.so is missing. Now lets install it from internet. run sudo yum install pam-devel.i686   in your terminal

Ok lets run the prereqcheck again and see.

[db2inst1@fedorabox server]$ sudo sh db2prereqcheck
[sudo] password for db2inst1: 
WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
above warning can be ignored.

2) now lets install the db2 using db2setup

[db2inst1@fedorabox server]$ sudo sh db2setup

we get a GUI prompt like ( shown below ) which will allow us to use various options for installation, Just go ahead proceed with all steps and at the end when you click finished , it will do the actual work of installing DB2 with the selected options 



When all the steps are completed lets set the db2profile in user home directory add below 3 lines to profile file of db2inst1 ( run vi .bash_profile )

if [ -f /home/db2inst1/sqllib/db2profile ]; then
        sh /home/db2inst1/sqllib/db2profile
fi

execute the profile file to take changes into effect 
run       . .bash_profile 

3) Now lets start the instance.

[db2inst1@fedorabox ~]$ db2start
04/07/2014 15:17:17     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.

That's it with DB2 Installation on Fedora OS and we can proceed to step 2 which will be preceded in the next post as PART 2

No comments:

Post a Comment