(Update Jan 22, 2011 – I’ve just reproduced all the steps below on a fresh Ubuntu 10.10 install)
Until IBM finally recognizes that Ubuntu is the most popular Linux distribution and starts offering WebSphere MQ DEBs to install, here’s a small HOWTO which will guide you through the installation process. I’m using Ubuntu 9.10 and MQ 7.0.1 (CZ4VEML), both 64-bits, but it’s something I’ve been using since at least Ubuntu 7.04 I think, so it will work reliably with other versions of Ubuntu and MQ as well.
Installation
First untar the CZ4VEML.tar.gz archive and then install rpm and sharutils packages:
dsuch$ sudo apt-get install rpm sharutils
Next try executing the ./mqlicense.sh script which will most probably fail horribly but that’s OK, we’ll work around it
dsuch$ sudo ./mqlicense.sh
Accept the license if it doesn’t end with an error such as the one below ..
Exception in thread "main" java.lang.UnsatisfiedLinkError: fontmanager
(libstdc++.so.5: cannot open shared object file: No such file or directory)
.. but if it does, just read the license carefully
dsuch$ less ./licenses/LA_en
I’m assuming the script has failed but if you take a look at it closely you’ll notice that all it does in the end is to create a /tmp/mq_license/license/status.dat file, so we’ll do the same ourselves a couple of times.
Now comes the runtime, preceded by the manual creation of the file which ./mqlicense.sh failed to create.
dsuch$ sudo mkdir -p /tmp/mq_license/license/
dsuch$ sudo touch /tmp/mq_license/license/status.dat
dsuch$ sudo rpm -iavh --nodeps --force-debian
./MQSeriesRuntime-7.0.1-0.x86_64.rpm
.. more RPMs to install ..
dsuch$ sudo mkdir -p /tmp/mq_license/license/
dsuch$ sudo touch /tmp/mq_license/license/status.dat
dsuch$ sudo rpm -iavh --nodeps --force-debian ./MQSeriesJava-7.0.1-0.x86_64.rpm
./MQSeriesClient-7.0.1-0.x86_64.rpm ./MQSeriesServer-7.0.1-0.x86_64.rpm
./MQSeriesSDK-7.0.1-0.x86_64.rpm ./MQSeriesSamples-7.0.1-0.x86_64.rpm
./MQSeriesTXClient-7.0.1-0.x86_64.rpm
.. and the last batch of RPMs ..
dsuch$ sudo mkdir -p /tmp/mq_license/license/
dsuch$ sudo touch /tmp/mq_license/license/status.dat
dsuch$ sudo rpm -iavh --nodeps --force-debian ./MQSeriesMan-7.0.1-0.x86_64.rpm
./MQSeriesKeyMan-7.0.1-0.x86_64.rpm
The newly created mqm user would sure like to use Bash by default
dsuch$ sudo usermod -s /bin/bash mqm
That’s all there is to installing, let’s send some messages now.
Verifying the installation
First change the user to mqm ..
dsuch$ sudo su - mqm
.. and create & start a QM01 queue manager:
mqm$ crtmqm QM01
mqm$ strmqm QM01
Let’s define a Q1 local queue for testing
mqm$ runmqsc QM01
Now cd to /opt/mqm/samp/bin/ which holds various precompiled utilities among which are amqsput and amqsget. By the way, the source code is in /opt/mqm/samp.
Send two messages to the Q1 queue on the QM01 queue manager and quit amsqput with Ctrl-C:
mqm$ ./amqsput Q1 QM01
Sample AMQSPUT0 start
target queue is Q1
123
zxc
^C
Now let’s use amqsget to get the messages off Q1 queue and quit with Ctrl-C again, as you can see, there are 2 messages sent there in the previous step:
mqm$ ./amqsget Q1 QM01
Sample AMQSGET0 start
message <123>
message <zxc>
^C
Removing WebSphere MQ
Use those three commands if for some reason you need to remove MQ from your system.
dsuch$ sudo rpm -qa | grep "MQSeries" | xargs sudo rpm -e --force-debian --noscripts
dsuch$ sudo rm -rf /var/mqm
dsuch$ sudo userdel mqm
That’s all folks, the rest is in the MQ documentation, using MQ on Ubuntu is in no way different to what RHEL has to offer, it’s simply Linux and everything works just fine. Except for the installer