Sunday, 3 January 2016

Installing WebSphere MQ on Linux (RHEL)

IBM MQ  was originally called MQSeries, and was renamed WebSphere MQ in 2002 to join the suite of WebSphere products. In April 2014, it was renamed IBM MQ. IBM MQ, (often referred to as "MQ"), is IBM's Messaging solution for Enterprise and IBM's Message Oriented Middleware offering.

IBM MQ runs on a variety of platforms. The IBM MQ products enable programs to Communicate with each other across a network of unlike components, such as processors, subsystems, OS  and communication protocols.   

IBM MQ can be configured to provide assured delivery  of the messages. Assured delivery means that even if the hardware or software platform crashes the messages within the system will be delivered, once the platforms are brought back up.

IBM MQ message is simply a collection of data sent by one program and intended for another program. The message consists of control information and application specific data. The control information is required in order to route the message between the programs to some extent. A message can be classed as  persistent or non-persistent. A persistent message will survive a software or hardware crash /reboot,  once communicate to a queue manager, where as a non-persistent message will not survive.


The following post is showing the installation of IBM Webspere MQ version 7.5 on Redhat Enterprise Linux 5.5 (32 bit) platform. You can download the trial software from IBM Site

In this post:

  • Setup WebSphere user and Group
  • Kernel Configuration Parameters
  • Read and Accept License
  • Install WebSphere MQ Components
  • Post Installations
  • Verifying Installation
  • Start WebSphere MQ Explorer GUI


1. Setup WebSphere user and Group

On UNIX like systems, WebSphere MQ requires a user ID of the name mqm, with a primary group of mqm to own the directories and files of the product. WebSphere MQ installation will automatically create the user and group for you. However you may want to setup in advance
Login to the system as user root then create user and group as follow:

[root@middlewaretech MQM]#  groupadd mqm
[root@middlewaretech MQM]#  useradd -g mqm mqm
[root@middlewaretech MQM]#  passwd mqm
Changing password for user mqm.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@middlewaretech MQM]#

2. Kernel Configuration Parameters
To make the following kernel changes log as user with root authority. Open the file "/etc/sysctl.conf" then add or change the following entries to the values shown (if the existing values in file are greater than these values do not change)

kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.shmmax = 268435456
kernel.sem = 500 256000 250 1024
fs.file-max = 524288

net.ipv4.tcp_keepalive_time = 300

Then save and close the file. To load these sysctl values immediately, enter the following command:

/sbin/sysctl -p

If you do not issue the sysctl -p command, the new values are loaded when the system is rebooted.

Add the following information to the "/etc/security/limits.conf" file

mqm              hard    nofile          10240
mqm              soft    nofile          10240


3. Read and Accept License

Once unzip/untar the installation file below files will be extracted

[root@middlewaretech MQM]# ls
MQ_7.5.0.2_TRIAL_LNX_ON_X86_32_ML.tar.gz

root@middlewaretech MQM]# tar -zxvf MQ_7.5.0.2_TRIAL_LNX_ON_X86_32_ML.tar.gz 



While login as root set your current working directory to the installation files. Run the "./mqlicense.sh -text_only" command to read accept the license issues or run "./mqlicense.sh -accept" command to accept the license without displaying all text (You must accept the license compliances otherwise you won’t proceed with installation):


[root@middlewaretech MQM]# ./mqlicense.sh -text_only

Licensed Materials - Property of IBM
                
 5724-H72

 (C) Copyright IBM Corporation 1994, 2013 All rights reserved.

US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.


IMPORTANT: READ CAREFULLY

Two license agreements are presented below.

1. IBM International License Agreement for Evaluation of
Programs
2. IBM International Program License Agreement

If Licensee is obtaining the Program for purposes of
productive use (other than evaluation, testing, trial "try
or buy," or demonstration): By clicking on the "Accept"
button below, Licensee accepts the IBM International
Program License Agreement, without modification.

If Licensee is obtaining the Program for the purpose of

Press Enter to continue viewing the license agreement, or
enter "1" to accept the agreement, "2" to decline it, "3"
to print it, "4" to read non-IBM terms, or "99" to go back
to the previous screen.
1

Agreement accepted:  Proceed with install.

[root@middlewaretech MQM]#


4. Install WebSphere MQ Components

At minimum Webspere MQ server installation you must install MQSeriesRuntime and the MQSeriesServer components. However, this example show the minimum installation of the following components 


    MQSeriesRuntime
    MQSeriesServer
    MQSeriesClient
    MQSeriesSDK
    MQSeriesSample
    MQSeriesJava
    MQSeriesMan
    MQSeriesJRE
    MQSeriesExplorer

Log in as root, or switch to the superuser by using the su command. Set your current working directory to the installation files. To install to the default location, "/opt/mqm" use the "rpm –ivh" command to install each component as follow

[root@middlewaretech MQM]# rpm -ivh MQSeriesRuntime-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesRuntime        ########################################### [100%]
[root@middlewaretech MQM]# rpm -ivh MQSeriesServer-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesServer         ########################################### [100%]

After the installation has completed, run the '/opt/mqm/bin/mqconfig'
command, using the 'mqm' user ID.

For example, execute the following statement when running as the 'root' user:

    su mqm -c "/opt/mqm/bin/mqconfig"

The 'mqconfig' command validates that the system configuration satisfies the
requirements for WebSphere MQ, and ensures that the settings for the 'mqm'
user ID are suitably configured.  Other WebSphere MQ administrators in the
'mqm' group can run this command to ensure their user limits are also
properly configured to use WebSphere MQ.

If 'mqconfig' indicates that any of the requirements have not been met,
consult the installation section within the WebSphere MQ Information Center
for details about how to configure the system and user limits.

Run the su mqm -c "/opt/mqm/bin/mqconfig" command as suggested to validate configurations

[root@middlewaretech MQM]# su mqm -c "/opt/mqm/bin/mqconfig"
mqconfig: Analyzing Red Hat Enterprise Linux Server release 5.5 (Tikanga)
          settings for WebSphere MQ V7.5

System V Semaphores
  semmsl     (sem:1)  500 semaphores                     IBM>=500          PASS
  semmns     (sem:2)  10 of 256000 semaphores    (0%)    IBM>=256000       PASS
  semopm     (sem:3)  250 operations                     IBM>=250          PASS
  semmni     (sem:4)  3 of 1024 sets             (0%)    IBM>=1024         PASS

System V Shared Memory
  shmmax              2147483648 bytes                   IBM>=268435456    PASS
  shmmni              12 of 4096 sets            (0%)    IBM>=4096         PASS
  shmall              1061 of 2097152 pages      (0%)    IBM>=2097152      PASS

System Settings
  file-max            3712 of 6553600 files      (0%)    IBM>=524288       PASS
  tcp_keepalive_time  300 seconds                        IBM<=300          PASS

Current User Limits (mqm)
  nofile       (-Hn)  10240 files                        IBM>=10240        PASS
  nofile       (-Sn)  10240 files                        IBM>=10240        PASS
  nproc        (-Hu)  44 of 32768 processes      (0%)    IBM>=4096         PASS
  nproc        (-Su)  44 of 32768 processes      (0%)    IBM>=4096         PASS


If you encounter any FAIL go to IBM WebSphere MQ Information Center. Expands WebSphere MQ >Installing > Prepare your system > Addition settings > Linux. See how you can adjust kernel parameters before proceeding with installations.


Install other components


[root@middlewaretech MQM]#
[root@middlewaretech MQM]#  rpm -ivh MQSeriesClient-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesClient         ########################################### [100%]

 [root@middlewaretech MQM]# rpm -ivh MQSeriesSDK-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesSDK            ########################################### [100%]

[root@middlewaretech MQM]#  rpm -ivh MQSeriesSamples-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesSamples        ########################################### [100%]

[root@middlewaretech MQM]# rpm -ivh MQSeriesJava-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesJava           ########################################### [100%]

[root@middlewaretech MQM]# rpm -ivh MQSeriesMan-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesMan            ########################################### [100%]

[root@middlewaretech MQM]# rpm -ivh MQSeriesJRE-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesJRE            ########################################### [100%]

[root@middlewaretech MQM]# rpm -ivh MQSeriesExplorer-7.5.0-2.i386.rpm
Preparing...                ########################################### [100%]
   1:MQSeriesExplorer       ########################################### [100%]


5. Post Installations

If you have chosen this installation to be the primary installation on the system, set it as the primary installation.  Execute MQ_INSTALLATION_PATH/bin/setmqinst -i -p MQ_INSTALLATION_PATH where MQ_INSTALLATION_PATH represents the directory where WebSphere MQ is installed. Example

[root@middlewaretech MQM]# /opt/mqm/bin/setmqinst -i -p /opt/mqm/
87 of 87 tasks have been completed successfuly.
'Installation1' (/opt/mqm) set as the Primary Installation.


If you want to set up the environment to work with this installation use setmqenv command to set various environment variables for a particular installation of WebSphere MQ

[mqm@middlewaretech bin]$ cd /opt/mqm/bin/
[mqm@middlewaretech bin]$ . setmqenv -s

  
Check that the environment is set up correctly using dspmqver command as follow

[mqm@middlewaretech bin]$ dspmqver
Name:        WebSphere MQ
Version:     7.5.0.2
Level:       p750-002-130704.TRIAL
BuildType:   IKAP - (Production)
Platform:    WebSphere MQ for Linux (x86 platform)
Mode:        32-bit
O/S:         Linux 2.6.18-194.el5
InstName:    Installation1
InstDesc:   
Primary:     Yes
InstPath:    /opt/mqm
DataPath:    /var/mqm
MaxCmdLevel: 750
[mqm@middlewaretech bin]$


6. Verifying Installation
To verify installation configure the default queue manager, use the amqsput sample program to put a message on the queue, then use the amqsget sample program to get the message back from the queue

Log in as a user in the mqm group use command crtmqm to create a queue manager called QMA1 as follows


[mqm@middlewaretech bin]$  crtmqm QMA1
There are 90 days left in the trial period for this copy of WebSphere MQ.
WebSphere MQ queue manager created.
Directory '/var/mqm/qmgrs/QMA1' created.
The queue manager is associated with installation 'Installation1'.
Creating or replacing default objects for queue manager 'QMA1'.
Default objects statistics : 74 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
[mqm@middlewaretech bin]$

Use strmqm command to start the queue manager QMA1 as follow:

[mqm@middlewaretech QMA1]$ strmqm QMA1
There are 90 days left in the trial period for this copy of WebSphere MQ.
WebSphere MQ queue manager 'QMA1' starting.
The queue manager is associated with installation 'Installation1'.
5 log records accessed on queue manager 'QMA1' during the log replay phase.
Log replay for queue manager 'QMA1' complete.
Transaction manager state recovered for queue manager 'QMA1'.
WebSphere MQ queue manager 'QMA1' started using V7.5.0.2.

 Start MQSC to define a local queue called QUEUE1 then stop MQSC as follows

 [mqm@middlewaretech QMA1]$ runmqsc QMA1
5724-H72 (C) Copyright IBM Corp. 1994, 2011.  ALL RIGHTS RESERVED.
Starting MQSC for queue manager QMA1.


DEFINE QLOCAL (QUEUE1)
     1 : DEFINE QLOCAL (QUEUE1)
AMQ8006: WebSphere MQ queue created.

end
     2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.

Change into the MQ_INSTALLATION_PATH/samp/bin directory. Execute "./amqsput QUEUE1 QMA" command, type the message e.g. "hello middleware" then place enter twice

[mqm@middlewaretech bin]$ ./amqsput QUEUE1 QMA1
Sample AMQSPUT0 start
target queue is QUEUE1
hello middleware

Sample AMQSPUT0 end
[mqm@middlewaretech bin]$

Get the messages from the queue as follow:

[mqm@middlewaretech bin]$ ./amqsget QUEUE1 QMA1
Sample AMQSGET0 start
message <hello middleware>

no more messages
Sample AMQSGET0 end
[mqm@middlewaretech bin]$

7.Start WebSphere MQ Explorer GUI
Log in as a user in the mqm group then run MQExplorer command

[mqm@Lugaomqaq ~]$  MQExplorer

MQ Explorer: Using existing workspace: /home/mqm/IBM/WebSphereMQ/workspace-Installation1/ (MQ 7.5)
com.ibm.wmqfte.product.root=/opt/mqm/mqft






No comments: