Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
IBM InfoSphere Replication Server and Data Event Publisher

You're reading from  IBM InfoSphere Replication Server and Data Event Publisher

Product type Book
Published in Aug 2010
Publisher Packt
ISBN-13 9781849681544
Pages 344 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
Pav Kumar-Chatterjee Pav Kumar-Chatterjee
Profile icon Pav Kumar-Chatterjee
Pav Kumar Chatterjee Pav Kumar Chatterjee
Profile icon Pav Kumar Chatterjee
View More author details

Table of Contents (12) Chapters

IBM InfoSphere Replication Server and Data Event Publisher
Credits
About the Author
About the Reviewer
1. Preface
1. Q Replication Overview 2. Q Replication Components 3. The DB2 Database Layer 4. WebSphere MQ for the DBA 5. The ASNCLP Command Interface 6. Administration Tasks 7. Monitoring and Reporting

Q replication constituent components


We like to think that the Q replication architecture is made up of three interconnected layers: the DB2 database layer, the WebSphere MQ layer, and finally the Q replication layer—each layer needs to be set up and tested before we move on to the next layer. An overview of the Q replication process is shown in the following diagram:

The basic operating architecture of a Q replication system involves:

  • An application processing a row in a table and DB2 logging this operation

  • A Q Capture program calling the DB2 log reader to "process" the DB2 log and place rows that have been committed and that it wants to replicate onto a WebSphere MQ queue

  • A Q Apply program "reading" from this queue and applying the row to the target table

In this setup, we have two components that need to be installed—the Q replication code and the WebSphere MQ code. We will discuss the installation of both of these in some detail.

With the current packaging, the Q replication code for homogeneous replication already comes bundled with the base code for DB2—all we have to install is a replication license key. The license for InfoSphere Replication Server is called isrs.lic and for InfoSphere Data Event Publisher the license is called isep.lic. Use the DB2 db2licm command to install the license key and to confirm that the license key has been successfully applied.

Turning to the WebSphere MQ component, we can use either WebSphere MQ V6 or V7 with DB2 replication.

The WebSphere MQ V6 Information Center can be found at http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp.

The WebSphere MQ V7 Information Center can be found at http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp.

For the procedure to install WebSphere MQ, consult the WebSphere MQ Information Center and search for install server. As an example, we will now take you through installing WebSphere MQ V6 on x86 64-bit Linux (which comes packaged as C87RUML.tar.gz). We need to perform the following tasks:

  1. 1. As root, use gunzip and tar to unpack the WebSphere MQ packages:

    # gunzip C87RUML.tar.gz
    # tar -xvf C87RUML.tar
  2. 2. As root, the first task we need to perform is accept the MQ license, as shown next:

    # ./mqlicense.sh
  3. 3. Now we can install the base packages. As root, issue the following commands:

    # rpm -U MQSeriesRuntime-6.0.1-0.x86_64.rpm
    # rpm -U MQSeriesServer-6.0.1-0.x86_64.rpm
    # rpm -U MQSeriesSDK-6.0.1-0.x86_64.rpm
  4. 4. If we want the WebSphere MQ sample programs, which include amqsput, amqsget, amqsgbr, amqsbcg, and so on (which we do!), then we have to install the following package:

    # rpm -U MQSeriesSamples-6.0.1-0.x86_64.rpm

For future reference, to uninstall WebSphere MQ, perform the following steps:

  1. 1. We can check which packages are installed using the following command:

    # rpm -q -a | grep MQSeries
  2. 2. We can check what version of WebSphere MQ we are running by using the following command:

    # dspmqver

    This should give us an output similar to the following:

    Name: WebSphere MQ
    Version: 6.0.0.0
    CMVC level: p000-L080610
    BuildType: IKAP - (Production)

On UNIX systems, if we are running on a 64-bit system, then we need to add the WebSphere MQ library to the LD_LIBRARY_PATH environment variable. If we do not do this, then when we try and start Q Capture (or Q Apply), we will see the following messages in the process log file:

2009-09-02-12.47.39.730985 <ASNMQLOD:MQCONN> ASN0584E "Q Capture" : "ASN" : "AdminThread" : An error occurred while the program was dynamically loading the WebSphere MQ library "libmqm_r.so". Error code: "0x90000076", "Cannot load the specified library". Environment variable ASNUSEMQCLIENT is set to "".

The ASN0584E message tells us to set the LD_LIBRARY_PATH environment variable. To check the current setting of this variable, we can either list the current values of all environment variables, using the env command, or we can list the value of this specific variable by using the echo command and prefixing the variable name with a dollar sign:

echo $LD_LIBRARY_PATH

We can temporarily set the value of this parameter (for the duration of the session in which the command was issued), using the following command:

LD_LIBRARY_PATH=/opt/mqm/lib64:$LD_LIBRARY_PATH

If we ever need to remove the packages, we would use the commands as shown:

#rpm -ev MQSeriesRuntime-6.0.1-0.x86_64.rpm
#rpm -ev MQSeriesServer-6.0.1-0.x86_64.rpm
#rpm -ev MQSeriesSDK-6.0.1-0.x86_64.rpm
#rpm -ev MQSeriesSamples-6.0.1-0.x86_64.rpm

The Q Capture and Q Apply programs are discussed in detail in Chapter 2, The Q Capture and Q Apply programs. Typically, these programs will be installed on different servers, in which case we have to pay attention to the machine clock time on the servers.

Note

The machine clock time on all servers involved in replication should be synchronized.

The times on all servers need to be synchronized, because each captured record has a timestamp associated with it, and Q Apply will not apply in the future. Therefore, if the Q Capture server is ahead of the Q Apply server, then Q Apply will wait until it has reached the timestamp in the replicated record before applying it. If the Apply server time is ahead of the Capture server time, then we will not hit the "Apply will not apply in the future" problem, but the latency figures will be out by the time difference.

In the next section, we will look at the different types of Q replication.

You have been reading a chapter from
IBM InfoSphere Replication Server and Data Event Publisher
Published in: Aug 2010 Publisher: Packt ISBN-13: 9781849681544
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}