Amol’s Weblog

Things, the way I see them…

Configuring Websphere MQ

Posted by Amol Chaudhari on November 9, 2008

Ok.. I am back again.. this time posting something technical..

I had a very hard time configuring the Wesphere MQ on our server (Ubuntu) and my laptop (WinXP) as well. Though, installing MQ is not a rocket science, somehow it took me several hours to make the basic configuration work. May be i am very dumb and this post is for people like me… :)

After being successful, I had decided to create a simple document which will explain the steps involved in the basic configuration of MQ. And this post is the result of that….

Installing WebSphere MQ on Windows XP:

1. Launch the Websphere MQ Server installation launchpad.

2. You should see the following welcome screen.

clip_image002

3. Click on the Software Requirements option in the left menu and check if you have all the required softwares installed.

clip_image004

4. If you want to configure Websphere MQ through UI, installing Websphere Eclipse Platform version 3.0.1 is necessary. You can install it from the <Setup>\Prereqs\IES directory or from the launchpad for the MQ Server by clicking on the CD-ROM option.

5. Choose all the default options and install the Websphere Eclipse Platform.

6. Then proceed to install the Websphere MQ Server by clicking on the Websphere MQ Installation option in the left menu. Select the language and click on the Launch Websphere MQ Installer button.

clip_image006

7. Choose all the default options and complete the installation.

Note: if you get the error message saying Unable to launch application gsk7win.exe, ignore it.

Installing Websphere MQ on Linux (Ubuntu)

This document outlines the basic steps necessary for installing and configuring Websphere MQ. In case advanced configuration is need to be done, please refer to the Websphere MQ documentation.

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.amqtac.doc/wq11280_.htm

1. Create the directory /opt/mqm if not present already.

2. Create the directory /var/mqm if not present already.

3. Ensure that the group and user for mqm are present. To check this login as root and check the following files:

a. /etc/passwd – contains user information. If the user “mqm” is not present add the following line to the file:

mqm:x:1001:1001::/var/mqm:/bin/bash

b. /etc/group – contains group information. If the group “mqm” is not present add the following line to the file:

mqm:x:1001:somedescription

4. Copy the installation files to /home/mq_install/ directory and navigate to that directory.

5. To install the Websphere MQ you first need to accept the license agreement. Run the following command to accept the license:

./mqlicense.sh -accept

Enter the number corresponding to the language and press enter. Enter 1 and press enter to accept the license agreement.

6. Install the necessary Websphere MQ packages with the following command:

rpm -ivh IBMJava2-142-ia32-SDK-1.4.2-1.0.i386.rpm MQSeriesRuntime-6.0.1-0.x86_64.rpm MQSeriesServer-6.0.1-0.x86_64.rpm MQSeriesJava-6.0.1-0.x86_64.rpm –nodeps

clip_image002[4]

Configuring Websphere MQ on Windows and Linux:

The configuration steps are almost the same for Windows and Linus systems.

1. Windows: Navigate to the Websphere MQ bin directory on the console.

Linux: Login as user “mqm”

2. Create the Queue Manager by using the following command:

crtmqm <Queue Manager Name>

clip_image004[4]

3. Start the Queue Manager with the following command:

strmqm <Queue Manager Name>

clip_image006[4]

4. To stop the Queue Manger you can use the following command:

endmqm <Queue Manager Name>

5. To delete the Queue Manager you can use the following command:

dltmqm <Queue Manager Name>

6. Now, you need to create the channels and queues. For that start the MQ scripting console by entering the following command at the command prompt:

runmqsc <Queue Manager Name>

clip_image008

7. Now create the channel using the following command:

DEFINE CHANNEL (CHANCLI1) CHLTYPE(SVRCONN) TRPTYPE(TCP) DESCR(‘ ‘) HBINT(300) MAXMSGL(4194304) RCVDATA(‘ ‘) RCVEXIT(‘ ‘) SCYDATA(‘ ‘) SCYEXIT(‘ ‘) SENDDATA(‘ ‘) SENDEXIT(‘ ‘) REPLACE

For Linux OS just the user name needs to be added to the above command, as follows:

DEFINE CHANNEL (CHANCLI1) CHLTYPE(SVRCONN) TRPTYPE(TCP) DESCR(‘ ‘) HBINT(300) MAXMSGL( 4194304) MCAUSER(‘mqm’) RCVDATA(‘ ‘) RCVEXIT(‘ ‘) SCYDATA(‘ ‘) SCYEXIT(‘ ‘) SENDDATA(‘ ‘) SENDEXIT(‘ ‘) REPLACE

clip_image010

8. Create the local queue using the following command:

DEFINE QLOCAL (INPTQ) REPLACE

clip_image012

You can also define the Tranmission Queue and Remote Queue using the following commands if needed.

DEFINE QLOCAL (TRANSQ) DESCR(‘Transmission Queue’) USAGE(XMITQ) TRIGGER TRIGTYPE(FIRST) TRIGDPTH(1) TRIGDATA(‘QM’) INITQ(‘SYSTEM.CHANNEL.INITQ’) REPLACE

DEFINE QREMOTE (OUTPTQ) XMITQ(‘TRANSQ’) RNAME(‘WMQ2InputQ’) RQMNAME(‘WMQ2QM’) REPLACE

9. Exit the MQ Scripting console using the following command:

end

10. Now start the MQ Listener using the following command:

runmqlsr -m QM -p 1414 -t TCP &

clip_image014

Note: Windows uses the default user or may be no user at all. When configuring your IMS component to use MQInputAdapter or MQOutputAdapter, you do not have to specify any username and password. Just leave them blank. In case you face any issues, ensure that you have not specified the username while creating your channel or may be the queue.

To be very frank, I almost faint when i need to work on Linux. I do not have any idea of how things work on Linux. So to create this document, i had to uninstall the already installed MQ server on our server and as i do not have any idea of Linux, have to google a bit to understand how one can uninstall the stuff. So i noted down the uninstallation steps as well….

Uninstalling Websphere MQ on Linux system:

  1. Before starting to uninstall, end all WebSphere MQ activity.
    • Log in as root.
    • Use the dspmq command to display the state of all the queue managers on the system.
    • Use the endmqm command to stop all running queue managers.
    • Stop any listeners associated with the queue managers, using the command: endmqlsr -m QMgrName
    • To check that you have stopped all of the necessary WebSphere MQ processes, type: ps -ef | grep mq
    • Check that there are no processes listed that are running command lines beginning amq or runmq. Ignore any that start with amqi.
  2. Before you uninstall WebSphere MQ for Linux you must find out the names of the packages (components) currently installed on your system. To list all the packages with their version information, enter the following:
    1. rpm -q -a | grep MQSeries
    2. rpm -q -a | grep gsk
  3. If you have applied maintenance to the install, remove these maintenance packages before removing the base install.
  4. Some of the installed packages are dependent on others. The rpm command will not remove a package if others are dependent on it. For this reason you must uninstall the packages in such an order that each one you uninstall has no dependencies from other packages. To list all of the packages on which a named package (for example MQSeriesServer) depends, enter the following:
    1. rpm -q –requires MQSeriesServer (modify the names as per the installed versions)
  5. Alternatively, remove all the components at the same time by appending all the package names to the command arguments. For example, to remove the runtime, Server and SDK components, enter the following:
    1. rpm -ev MQSeriesRuntime MQSeriesServer MQSeriesSDK (modify the names as per the installed versions)
  6. After uninstalling, you might want to delete the contents of /var/mqm, which is not removed by the uninstallation. Only do this if you do not need your queue manager data. For example, do not delete the content if you plan to migrate to a later version of WebSphere MQ.
  7. To delete the contents along with the directory run the following command:
    1. rm -rf /var/mqm
  8. You have now uninstalled WebSphere MQ.

One Response to “Configuring Websphere MQ”

  1. [...] Installing MQ in SuSe 10 Fixpack 2 is easy. The part that I forgot is that there is configuration that needs to occur after that. Learning of commands like runmqlsr or  strmqm took awhile. [...]

Comments are closed.