Sun Cluster Data Service for WebSphere Message Broker Guide for Solaris OS

Appendix A Deployment Example: Installing WebSphere Message Broker in Zones

This appendix presents a complete example of how to install and configure a WebSphere Message Broker in zones. It presents a single node cluster configuration. If you need to install the application in any other configuration, refer to the general-purpose procedures presented elsewhere in this manual.

Target Cluster Configuration

This example uses a single node cluster with the following node and zone names:

Vigor5

The physical node, which owns the file system.

Vigor5:z1

A whole root zone named z1.

Vigor5:z2

A whole root zone named z2.

Software Configuration

This deployment example uses the following software products and versions:

This example assumes that you have already installed and established your cluster. It illustrates the installation and configuration of the data service application only.

Assumptions

The instructions in this example were developed with the following assumptions:

Installing and Configuring WebSphere Message Broker


Note –

This deployment example is designed for a single node cluster. It is provided simply as a concise guide to help you if you need to refer to an installation and configuration of WebSphere Message Broker.

This deployment example is not meant to be a precise guide to install and configure WebSphere Message Broker.

If you need to install WebSphere Message Broker in any other configuration, refer to the general purpose procedures elsewhere in this manual.


The instructions with this deployment example assumes that you are using the WebSphere Message Broker v6 Solaris x86–64 platform and will configure WebSphere Message Broker on a ZFS highly available local file system.

The cluster resource group has already be configured to failover between two zones on a single node cluster.

This deployment examples assumes that you have completed the Deployment Example: Installing WebSphere MQ in Zones from the Sun Cluster Data Service for WebSphere MQ Guide.

The tasks you must perform to install and configure WebSphere Message Broker in the zones are as follows:

ProcedureExample: Prepare the Cluster for WebSphere Message Broker

Perform all steps within this example in the global zone.

  1. Install and configure the cluster as instructed in Sun Cluster Software Installation Guide for Solaris OS.

    Install the following cluster software components.

    • Sun Cluster core software

    • Sun Cluster HA for WebSphere Message Broker data service


    Note –

    This deployment example assumes that WebSphere MQ has been installed into zones z1 and z2 and that the Sun Cluster for WebSphere MQ data service has been installed and configured.

    This deployment example further assumes that the Deployment Example: Installing WebSphere MQ in Zones, from the Sun Cluster Data Service for WebSphere MQ Guide, was used to create the resource group wmq1-rg and zones z1 and z2.

    Within this deployment example a GDS resource is used to create and register a DB2 resource.


  2. Install and configure a Zettabyte file system.

    Create a ZFS pool.


    Note –

    The following zpool definitions represent a very basic configuration for deployment on a single node cluster.

    You should not consider this example for use within a productive deployment, instead it is a very basic configuration for testing or development purposes only.



    Vigor5# zpool create -m /ZFSwmb1 HAZpool3 c1t5d0
    

ProcedureExample: Configure zones z1 and z2 for WebSphere Message Broker

  1. Import the ZFS pool into zone z1.

    Perform this step in the global zone only.


    Vigor5# zpool export -f HAZpool3
    Vigor5# zpool import -R /zones/z1/root HAZpool3
    
  2. Create some directories and a symbolic link for the WebSphere Message Broker and DB2 software.

    Perform this step in the global zone only.


    Vigor5# zlogin z1 mkdir /ZFSwmb1/mqsiuser /ZFSwmb1/db2user /ZFSwmb1/mqsi
    Vig0r5# zlogin z1 touch /ZFSwmb1/mqsiuser/.profile
    Vig0r5# zlogin z1 touch /ZFSwmb1/db2user/.profile
    Vigor5# zlogin z1 mkdir /opt/mqsi
    Vigor5# zlogin z2 mkdir /opt/mqsi
    Vigor5# zlogin z1 ln -s /ZFSwmb1/mqsi /var/mqsi
    Vigor5# zlogin z2 ln -s /ZFSwmb1/mqsi /var/mqsi
    
  3. Create the WebSphere Message Broker and DB2 userid in the zones.

    Perform this step from the global zone and repeat for zone z2.


    Vigor5# zlogin z1
    # groupadd -g 2000 mqbrkrs
    # useradd -u 2000 -G mqm,mqbrkrs -d /ZFSwmb1/mqsiuser -s /usr/bin/ksh mqsiuser
    # groupadd -g 3000 dba
    # useradd -u 3000 -G dba -d /ZFSwmb1/db2user -s /usr/bin/ksh db2user
    # passwd mqsiuser
    New Password: mqsiuser
    Re-enter new Password: mqsiuser
    # passwd db2user
    New Password: db2user
    Re-enter new Password: db2user
    # exit
    
  4. Setup file permissions in the ZFS pool.

    Perform this step in zone z1 only.


    Vigor5# zlogin z1
    # cd /ZFSwmb1
    # chown db2user:dba db2user
    # chown mqm:mqbrkrs mqsi
    # chown mqsiuser:mqbrkrs mqsiuser
    # exit
    

ProcedureExample: Install WebSphere Message Broker in the zones


Caution – Caution –

The steps within this procedure are not precise steps to install WebSphere Message Broker or DB2. Refer to the relevant IBM documentation for complete information.


  1. Mount the WebSphere Message Broker software in the zones.

    Perform this step in the global zone only.

    In this example, the WebSphere Message Broker software and DB2 software has been copied to node Vigor5 in directories /export/software/ibm/wmbv6 and /export/software/ibm/db2v8.


    Vigor5# zlogin z1 mkdir -p /var/tmp/software
    Vigor5# zlogin z2 mkdir -p /var/tmp/software
    Vigor5# mount -F lofs /export/software /zones/z1/root/var/tmp/software
    Vigor5# mount -F lofs /export/software /zones/z2/root/var/tmp/software
    
  2. Install the DB2 software in zone z1.

    Perform this step from the global zone for zone z1.


    Vigor5# zlogin z1
    # cat > /var/tmp/db2_response <<-EOF
    PROD           = ENTERPRISE_SERVER_EDITION
    INSTALL_TYPE   = TYPICAL
    LIC_AGREEMENT  = ACCEPT
    EOF
    # cd /var/tmp/software/ibm/db2v8
    # ./db2setup -r /var/tmp/db2_response
    

    Comment out chk_kernel_conf in /opt/IBM/db2/V8.1/instance/db2iutil as indicated by ->.

        # Check that kernel parameters are updated
     -> # chk_kernel_conf
        # Set the value of vars INSTHOME and INSTPGRP
        # and check their validity

    # vi /opt/IBM/db2/V8.1/instance/db2iutil
    # exit
    
  3. Install the WebSphere Message Broker software in zone z1.

    Perform this step from the global zone for zone z1 which can be performed at the same time you are installing the DB2 software.


    Vigor5# zlogin z1
    # cat > /var/tmp/install.opt <<-EOF
    -W setupTypes.selectedSetupTypeId=typical
    -P installLocation=/opt/IBM/mqsi/6.0
    -P brokerFeature.active=true
    -P transformationServicesFeature.active=true
    -p unsFeature.active=true
    -P configManagerFeature.active=true
    EOF
    # cd /var/tmp/software/ibm/wmbv6/messagebroker_runtime1
    # ./setupsolarisx86 -options /var/tmp/install.opt -silent
    # exit
    
  4. Relocate the ZFS pool to zone z2.

    Perform this step in the global zone.


    Vigor5# zpool export -f HAZpool3
    Vigor5# zpool import -R /zones/z2/root HAZpool3
    
  5. Install the DB2 software in zone z2.

    Perform this step from the global zone for zone z2.


    Vigor5# zlogin z2
    # cat > /var/tmp/db2_response <<-EOF
    PROD           = ENTERPRISE_SERVER_EDITION
    INSTALL_TYPE   = TYPICAL
    LIC_AGREEMENT  = ACCEPT
    EOF
    # cd /var/tmp/software/ibm/db2v8
    # ./db2setup -r /var/tmp/db2_response
    

    Comment out chk_kernel_conf in /opt/IBM/db2/V8.1/instance/db2iutil as indicated by ->.

        # Check that kernel parameters are updated
     -> # chk_kernel_conf
        # Set the value of vars INSTHOME and INSTPGRP
        # and check their validity

    # vi /opt/IBM/db2/V8.1/instance/db2iutil
    # exit
    
  6. Install the WebSphere Message Broker software in zone z2.

    Perform this step from the global zone for zone z2 which can be performed at the same time you are installing the DB2 software.


    Vigor5# zlogin z2
    # cat > /var/tmp/install.opt <<-EOF
    -W setupTypes.selectedSetupTypeId=typical
    -P installLocation=/opt/IBM/mqsi/6.0
    -P brokerFeature.active=true
    -P transformationServicesFeature.active=true
    -p unsFeature.active=true
    -P configManagerFeature.active=true
    EOF
    # cd /var/tmp/software/ibm/wmbv6/messagebroker_runtime1
    # ./setupsolarisx86 -options /var/tmp/install.opt -silent
    # exit
    
  7. Relocate the ZFS pool back to zone z1.

    Perform this step in the global zone.


    Vigor5# zpool export -f HAZpool3
    Vigor5# zpool import -R /zones/z1/root HAZpool3
    

ProcedureExample: Verify WebSphere Message Broker

  1. Create the Broker database.

    Perform this step in the global zone for zone z1.


    Vigor5# zlogin z1
    # cd /opt/IBM/db2/V8.1/instance
    # ./db2icrt -u db2user db2user
    # su - db2user
    $ db2start
    $ db2 create database BROKERDB
    $ db2 connect to BROKERDB
    $ db2 bind ./sqllib/bnd/@db2cli.lst grant public CLIPKG 5
    $ db2 update database configuration for BROKERDB using dbheap 900
    $ chmod 644 /ZFSwmb1/db2user/sqllib/db2nodes.cfg
    $ cat > /ZFSwmb1/db2user/sqllib/db2nodes.cfg <<-EOF
    0 db2user 0
    EOF
    $ chmod 444 /ZFSwmb1/db2user/sqllib/db2nodes.cfg
    $ exit
    
  2. Update /etc/hosts with db2user on both zones.

    Perform this step in zones z1 and z2.


    # vi /etc/hosts
    

    The following listing shows db2user that has been added to /etc/hosts on z1.

    127.0.0.1		localhost	loghost	z1	db2user
  3. Create the Broker, Configuration Manager and UserNameServer.

    Perform this step in zone z1 only.


    Note –

    The broker queue manager and broker database must be running before you perform this step.

    Ensure that DB2 is started and resource group wmq1-rg is online on Vigor5:z1.

    Deployment Example: Installing WebSphere MQ in Zones, from the Sun Cluster Data Service for WebSphere MQ Guide, was used to create the resource group wmq1-rg.



    # cat > /ZFSwmb1/mqsiuser/.profile <<-EOF
    . /ZFSwmb1/db2user/sqllib/db2profile
    . /opt/IBM/mqsi/6.0/bin/mqsiprofile
    EOF
    # su - mqsiuser
    $ mqsicreatebroker brk \
    > -i mqsiuser -a mqsiuser -q qmgr1 -n BROKERDB -u db2user -p db2user
    $ mqsicreateconfigmgr cmg \
    > -i mqsiuser -a mqsiuser -q qmgr1
    $ mqsicreateusernameserver \
    > -i mqsiuser -a mqsiuser -q qmgr1 
    $ exit
    
  4. Start the Broker, Configuration Manager and UserNameServer.

    Perform this step in zone z1.


    # su - mqsiuser
    $ mqsistart brk
    $ mqsistart cmg
    $ mqsistart UserNameServer
    
  5. Verify that the Broker, Configuration Manager and UserNameServer have been created and are running.

    Perform this step in zone z1.


    # su - mqsiuser
    $ mqsilist
    BIP8099I: ConfigMgr: cmg  -  qmgr1
    BIP8099I: UserNameServer: UserNameServer  -  qmgr1
    BIP8099I: Broker: brk  -  qmgr1
    
    BIP8071I: Successful command completion.
    $ exit
    # ptree mqsiuser
    2608  zsched
      15573 bipservice brk
        15574 bipbroker brk
          15590 biphttplistener brk
      15594 bipservice cmg
        15595 bipconfigmgr cmg
      15665 bipservice UserNameServer
        15666 bipuns UserNameServer
  6. Stop the Broker, Configuration Manager and UserNameServer.

    Perform this step in zone z1.


    # su - mqsiuser
    $ mqsistop -i brk
    $ mqsistop -i cmg
    $ mqsistop -i UserNameServer
    $ exit
    
  7. Stop the Broker database.

    Perform this step in zone z1.


    # su - db2user
    $ db2stop force
    $ exit
    # exit
    
  8. Failover the WebSphere MQ resource group to the other zone.

    Perform this step in the global zone.


    Vigor5# clrg switch -n Vigor5:z2 wmq1-rg
    
  9. Relocate the ZFS pool to the other zone.

    Perform this step in the global zone.


    Vigor5# zpool export -f HAZpool3
    Vigor5# zpool import -R /zones/z2/root HAZpool3
    
  10. Setup /etc/services and start the Broker database.

    Perform this step in zone z2.


    Note –

    The port list entries for db2user should be the same as those on zone z1.



    Vigor5# z2
    # cat >> /etc/services <<-EOF
    DB2_db2user     60000/tcp
    DB2_db2user_1   60001/tcp
    DB2_db2user_2   60002/tcp
    DB2_db2user_END 60003/tcp
    EOF
    # su - db2user
    $ db2start
    $ exit
    
  11. Start the Broker, Configuration Manager and UserNameServer.

    Perform this step in zone z2.


    # su - mqsiuser
    $ mqsistart brk
    $ mqsistart cmg
    $ mqsistart UserNameServer
    $ exit
    
  12. Verify that the Broker, Configuration Manager and UserNameServer are running.

    Perform this step in zone z2.


    # su - mqsiuser
    $ mqsilist
    BIP8099I: ConfigMgr: cmg  -  qmgr1
    BIP8099I: UserNameServer: UserNameServer  -  qmgr1
    BIP8099I: Broker: brk  -  qmgr1
    
    BIP8071I: Successful command completion.
    $ exit
    # ptree mqsiuser
    2614  zsched
      6658 bipservice brk
        6659 bipbroker brk
          6681 biphttplistener brk
      6674 bipservice cmg
        6675 bipconfigmgr cmg
      6691 bipservice UserNameServer
        6692 bipuns UserNameServer
  13. Stop the Broker, Configuration Manager and UserNameServer.

    Perform this step in zone z2.


    # su - mqsiuser
    $ mqsistop -i brk
    $ mqsistop -i cmg
    $ mqsistop -i UserNameServer
    $ exit
    
  14. Stop the Broker database.

    Perform this step in zone z2.


    # su - db2user
    $ db2stop force
    $ exit
    # exit
    
  15. Export the ZFS pool.

    Perform this step in the global zone.


    Vigor5# zpool export -f HAZpool3
    

ProcedureExample: Configure Cluster Resources for WebSphere Message Broker

Perform all steps within this example in the global zone.

  1. Create the HAStoragePlus resource in the wmq1-rg resource group.


    Vigor5# clresource create -g wmq1-rg -t SUNW.HAStoragePlus \
    > -p Zpools=HAZpool3 wmq1-ZFSbrokerhas
    

    Alternatively, you can simply add HAZpool3 to the existing wmq1-ZFShas resource.

    Deployment Example: Installing WebSphere MQ in Zones, from the Sun Cluster Data Service for WebSphere MQ Guide, was used to create the wmq1-ZFShas resource..


    Vigor5# clresource set -p Zpools=HAZpool1,HAZpool2,HAZpool3 wmq1-ZFShas
    
  2. Enable the resource.

    This step is only required is you created the wmq1-ZFSbrokerhas resource.


    Vigor5# clresource enable wmq1-ZFSbrokerhas
    

ProcedureExample: Enable the WebSphere Message Broker Software to Run in the Cluster

Perform all steps within this example in the global zone.

  1. Create and enable the DB2 cluster resource.


    Note –

    At the time of writing this deployment example, an IBM DB2 agent for Sun Cluster 3.2 was not available. Instead to provide high availability for DB2 the following GDS resource was used.



    Vigor5# z2
    # cat > /ZFSwmb1/db2user/ha-db2probe <<-EOF
    if su - db2user -c "db2gcf -s -i db2user -p 0" > /dev/null
    then
       rc=0
    else
       su - db2user -c "ipclean -a"
       rc=100
    fi
    return ${rc}
    EOF
    # chmod 755 /ZFSwmb1/db2user/ha-db2probe
    # exit
    Vigor5# clresource create -g wmq1-rg -t SUNW.gds \
    -p Start_command='/usr/bin/su - db2user -c "db2start"' \
    -p Stop_command='/usr/bin/su - db2user -c "db2stop force"' \
    -p Probe_command='/usr/bin/ksh /ZFSwmb1/db2user/ha-db2probe' \
    -p Network_aware=false wmq1-db2
    Vigor5# clresource enable wmq1-db2
    
  2. Create the Broker configuration file.

    Either cat the following into /var/tmp/brk_config or edit /opt/SUNWscmqi/sib/util/sib_config and execute /opt/SUNWscmqi/sib/util/sib_register.

    Within this step HAS_RS=wmq1-ZFShas is specified, if you created resource wmq1-ZFSbrokerhas you must specify HAS_RS=wmq1-ZFSbrokerhas.


    Vigor5# cat > /var/tmp/brk_config <<-EOF
    RS=wmq1-brk
    RG=wmq1-rg
    QMGR=qmgr1
    LH=wmq1-lh
    HAS_RS=wmq1-ZFShas
    SC3_IN=NONE
    SC3_OUT=NONE
    MQSI_ID=mqsiuser
    BROKER=brk
    QMGR_RS=wmq1-qmgr
    RDBMS_RS=
    START_CMD=
    STOP_CMD=
    EOF
    
  3. Register and enable the Broker resource.


    Vigor5# /opt/SUNWscmqi/sib/util/sib_register -f /var/tmp/brk_config
    Vigor5# clresource enable wmq1-brk
    
  4. Create the Configuration Manager configuration file.

    Either cat the following into /var/tmp/cmg_config or edit /opt/SUNWscmqi/sib/util/sib_config and execute /opt/SUNWscmqi/sib/util/sib_register.

    Within this step HAS_RS=wmq1-ZFShas is specified, if you created resource wmq1-ZFSbrokerhas you must specify HAS_RS=wmq1-ZFSbrokerhas.


    Vigor5# cat > /var/tmp/cmg_config <<-EOF
    RS=wmq1-cmg
    RG=wmq1-rg
    QMGR=qmgr1
    LH=wmq1-lh
    HAS_RS=wmq1-ZFShas
    SC3_IN=NONE
    SC3_OUT=NONE
    MQSI_ID=mqsiuser
    BROKER=cmg
    QMGR_RS=wmq1-qmgr
    RDBMS_RS=
    START_CMD=
    STOP_CMD=
    EOF
    
  5. Register and enable the Configuration Manager resource.


    Vigor5# /opt/SUNWscmqi/sib/util/sib_register -f /var/tmp/cmg_config
    Vigor5# clresource enable wmq1-cmg
    
  6. Create the UserNameServer configuration file.

    Either cat the following into /var/tmp/uns_config or edit /opt/SUNWscmqi/siu/util/siu_config and execute /opt/SUNWscmqi/siu/util/siu_register.

    Within this step HAS_RS=wmq1-ZFShas is specified, if you created resource wmq1-ZFSbrokerhas you must specify HAS_RS=wmq1-ZFSbrokerhas.


    Vigor5# cat > /var/tmp/uns_config <<-EOF
    RS=wmq1-uns
    RG=wmq1-rg
    QMGR=qmgr1
    LH=wmq1-lh
    HAS_RS=wmq1-ZFShas
    MQSI_ID=mqsiuser
    QMGR_RS=wmq1-qmgr
    START_CMD=
    STOP_CMD=
    EOF
    
  7. Register and enable the UserNameServer resource.


    Vigor5# /opt/SUNWscmqi/siu/util/siu_register -f /var/tmp/uns_config
    Vigor5# clresource enable wmq1-uns
    

ProcedureExample: Verify the Sun Cluster HA for WebSphere Message Broker Resource Group

Perform this step in the global zone.

    Switch the WebSphere MQ resource group between the two zones.


    Vigor5# for node in Vigor5:z2 Vigor5:z1
    do
       clrg switch -n $node wmq1-rg
       clrs status wmq1-brk
       clrs status wmq1-cmg
       clrs status wmq1-uns
       clrg status wmq1-rg
    done