|
home /
infca /
mq /
mq_linux
(navigation links)
|
La vida es una canción ...
que yo tarareo ...
Luz Casal
|
MQ under Linux
Quick beginnings
for Linux
Download
405.270.871 C8472ML.tar.gz WebSphere MQ for Linux (x86) V6.0
152.378.420 C84CJML.tar.gz WebSphere MQ V6.0 Linux x86 Client
121.508.035 C87S2ML.tar.gz WebSphere MQ Documentation V6.0.1 (Linux)
475.661.810 CZ4VDML_WebSphere MQ V7.0.1 for Linux on x86 32-bit Multilingual.tar.gz
487.608.600 CZ4VEML_WebSphere MQ V7.0.1 for Linux on x86-64 Multilingual.tar.gz
215.499.609 CZ4VFML_WebSphere MQ V7.0.1 for Linux on POWER Multilingual.tar.gz
203.685.106 CZ4VGML_WebSphere MQ V7.0.1 for Linux on System z 64-bit Multilingual.tar.gz
Supported distributions
System reqs
x86 :
RH v4 + v5 + v6,
SLES v9 + v10 + v11,
NLPOS9 FP1, IRES v2, Red Flag Data Centre v5.
x86-64 :
RH v4 + v5 + v6,
SLES v9 + v10 + v11 ;
Parmetros de Kernel de Linux para MQ
La configuración mínima para WebSphere MQ es:
kernel.msgmni = 1024
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.shmmax = 268435456 # echo 268435456 > /proc/sys/kernel/shmmax
# Order: semmsl, semmns, semopm, semni
# semmsl value must be 128 or greater
# semmns value must be 16384 or greater
# semopm value must be 5 or greater
# semmni value must be 1024 or greater
kernel.sem = 500 256000 250 1024 # cat /proc/sys/kernel/sem
fs.file-max = 524288 # cat /proc/sys/fs/file-max
net.ipv4.tcp_keepalive_time = 300
kernel.pid_max = 120000 {nadav}
kernel.threads-max = 48000 {nadav}
Se visualizan con el comando ipcs -l, y se modifican editando el fichero /etc/sysctl.conf y lanzando luego el mandato sysctl -p.
url
Com s'incrementen aquestos valors per cada nou gestor ?
How to configure UNIX and Linux systems for WebSphere MQ -
donde entre otros puntos, se recomienda usar el script mqconfig.
Hoy en das las máquinas disponen de recursos suficientes (semáforos, handles, etc) como para que podamos permitirnos sobredimensionar los recursos asignados a MQ.
Parmetros de usuario
Modificar el fitxer /etc/security/limits.conf (RH v6, nadav)
mqm hard nofile 10240
mqm soft nofile 10240
mqm hard nproc 4090
mqm soft nproc 4090
mbadmin hard nofile 20480
mbadmin soft nofile 20480
mbadmin hard nproc 8192
mbadmin soft nproc 8192
SuSE 10
Instalació
Follow the steps outlined in this section to install WebSphere MQ 5.3.0.2
For more information, you can refer to the WebSphere MQ for Linux for Intel document
1. Extract the WebSphere MQ 5.3.0.2 RPMs using the following commands:
rm -rf /tmp/mq5.3.0.2-install
mkdir /tmp/mq5.3.0.2-install
tar xzf C48UBML.tar.gz -C /tmp/mq5.3.0.2-install
tar xf /tmp/mq5.3.0.2-install/MQ53Server_LinuxIntel.tar -C /tmp/mq5.3.0.2-install
Here, C48UBML.tar.gz is the installation image file for WebSphere MQ.
2. Set the kernel level:
export LD_ASSUME_KERNEL=2.4.19
3. Replace the Java runtime environment (JRE) that comes with WebSphere MQ with the IBM 1.4.2 JDK JRE:
mv /tmp/mq5.3.0.2-install/lap/jre /tmp/mq5.3.0.2-install/lap/jre.mq
ln -s /opt/IBMJava2-142/jre /tmp/mq5.3.0.2-install/lap/jre
4. Accept the license:
/tmp/mq5.3.0.2-install/mqlicense.sh -accept -text_only
5. Install the WebSphere MQ RPMs: {as we use RPMs, it means RH and SLES only, no Debian-style}
rpm -Uvh /tmp/mq5.3.0.2-install/MQSeriesRuntime-5.3.0-2.i386.rpm
rpm -Uvh /tmp/mq5.3.0.2-install/MQSeriesSDK-5.3.0-2.i386.rpm
rpm -Uvh /tmp/mq5.3.0.2-install/MQSeriesServer-5.3.0-2.i386.rpm
rpm -Uvh /tmp/mq5.3.0.2-install/MQSeriesClient-5.3.0-2.i386.rpm
rpm -Uvh /tmp/mq5.3.0.2-install/MQSeriesSamples-5.3.0-2.i386.rpm
rpm -Uvh /tmp/mq5.3.0.2-install/MQSeriesJava-5.3.0-2.i386.rpm
rpm -Uvh /tmp/mq5.3.0.2-install/MQSeriesMan-5.3.0-2.i386.rpm
6. Clean up:
rm -rf /tmp/mq5.3.0.2-install/
MQ (HA) 5.3 installation under Linux
[1]
[2]
what starts when we start a qmgr
sebas@p9111-520:~/cmds/mq> cat /etc/issue
Welcome to SUSE Linux Enterprise Server 10 (ppc) - Kernel \r (\l).
sebas@p9111-520:~/cmds/mq> dspmqver
Name: WebSphere MQ
Version: 7.0.1.4
sebas@p9111-520:~/cmds/mq> strmqm P9111
WebSphere MQ queue manager 'P9111' starting.
9 log records accessed on queue manager 'P9111' during the log replay phase.
Log replay for queue manager 'P9111' complete.
Transaction manager state recovered for queue manager 'P9111'.
WebSphere MQ queue manager 'P9111' started.
sebas@p9111-520:~/cmds/mq> ps -ef | grep amq
mqm 26952 1 0 19:51 ? 00:00:00 amqzxma0 -m P9111
mqm 26957 26952 0 19:51 ? 00:00:00 /opt/mqm/bin/amqzfuma -m P9111
mqm 26961 26952 0 19:51 ? 00:00:00 amqzmuc0 -m P9111
mqm 26977 26952 0 19:51 ? 00:00:00 amqzmur0 -m P9111
mqm 26978 26952 0 19:51 ? 00:00:00 amqzmuf0 -m P9111
mqm 26987 26952 0 19:51 ? 00:00:00 /opt/mqm/bin/amqrrmfa -m P9111 -t2332800 -s2592000 -p2592000 -g5184000 -c3600
mqm 26988 26952 0 19:51 ? 00:00:00 /opt/mqm/bin/amqzdmaa -m P9111
mqm 27001 26952 0 19:51 ? 00:00:00 /opt/mqm/bin/amqzmgr0 -m P9111
mqm 27011 26952 0 19:51 ? 00:00:00 amqzlaa0 -mP9111 -fip0
mqm 27013 27001 0 19:51 ? 00:00:00 /opt/mqm/bin/amqpcsea P9111
mqm 27035 26978 0 19:51 ? 00:00:00 amqfqpub -mP9111
mqm 27048 27035 0 19:51 ? 00:00:00 amqfcxba -m P9111
sebas 27064 26899 0 19:51 pts/0 00:00:00 grep amq
HACMP
Cool Solutions - Setting up Heartbeat for Apache High Availability on SLES 10
SuSE is the choice distribution for HA-Linux (Heartbeat) binaries
and is included with SLES 10.
This article describes the process for setting up Apache
in a passive/active cluster using Heartbeat.
It is assumed that there is a common disk device for the web server.
Apache uses
HeartBeat
MQ v7 under SuSE 10
Go to V7 page.
Interesting problem : FDCs every minute
- had /var/mqm/errors filled up with FDCs
- AMQERR01.LOG was pointing to amqzmur0 thread
- ps -ef | grep amqzmur0 displayed changing timestamp => thread restarting
- did a MQ trace that showed
12:14:25.529793 10597.6 : Opening log file '/var/mqm/qmgrs/P9111/errors/AMQERR01.LOG' with flags 0x2, permissions 0x1B0
12:14:25.529816 10597.6 : ---}! xeeOpenFiles rc=xecP_E_ACCESS_DENIED
- and here is the reason :
p9111-520:/var/mqm/qmgrs/P9111/errors # ls -l
total 4
-rw-r--r-- 1 sebas mqm 2 Feb 2 10:55 AMQERR01.LOG
- and here the solution :
p9111-520:/var/mqm/qmgrs/P9111/errors # chown mqm:mqm AMQERR01.LOG
- mr Exerc pointed : "Check the bottom of the FDC that has the XC022001 probe. There should be a file listed that the open is failing on..."
| Probe Id :- XC022001 |
. . .
+ + +
-} xeeOpenFiles rc=xecP_E_ACCESS_DENIED
-{ xeeCallWriteMsgProgram
-} xeeCallWriteMsgProgram rc=xecF_E_FAIL
-{ xcsFreeMemFn
-} xcsFreeMemFn rc=OK
} xcsDisplayMessage rc=xecF_E_FAIL
{ xcsBuildDumpPtr
-{ xcsGetMemFn
-} xcsGetMemFn rc=OK
} xcsBuildDumpPtr rc=OK
{ xcsFFST
xeeFileContext
0xffffff31410 FFFFFFFF 000001B0 00000002 00000000 ................
0xffffff31420 00000000 00040000 50393131 31000000 ........P9111...
0xffffff31430 00000000 00000000 00000000 00000000 ................
0xffffff31440 to 0xffffff31450 suppressed, 2 lines same as above
0xffffff31460 00000000 00000000 2F766172 2F6D716D ......../var/mqm
0xffffff31470 2F716D67 72732F50 39313131 2F657272 /qmgrs/P9111/err
0xffffff31480 6F727300 00000000 00000000 00000000 ors.............
0xffffff31490 00000000 00000000 00000000 00000000 ................
MQ at Red Hat Enterprise edition v4
Install RH
-
Allocate all disk space now ( 4 GB )
-
Red Hat Enterprise Linux v4.0, "Red Hat Desktop"
- escollim
anaconda ( RHEL system installer )
grub ( boot loader )
gnome ( desktop environment )
-
root/kui,
sebastia/sg02,
mqm/mq2k7,
-
/sda
install size = 1,522 MB
/root/install.log
/root/anaconda-ks.cfg
-
codi : /opt/mqm
data : /var/mqm
usr/grp : mqm/mqm (abans de instalar)
Install VMware Tools for Linux Guests
-
Power on the virtual machine.
-
After the guest operating system has started, prepare your virtual machine to install VMware Tools.
Choose File > Install VMware Tools.
The remaining steps take place inside the virtual machine.
-
Be sure the guest operating system is running in text mode. You cannot install VMware Tools while X is running.
-
As root (su -), mount the VMware Tools virtual CD-ROM image,
change to a working directory (for example, /tmp),
uncompress the installer, then unmount the CD-ROM image.
mount /dev/cdrom /mnt
cd /tmp
tar zxf /mnt/vmware-linux-tools.tar.gz
umount /mnt
-
Run the VMware Tools installer.
cd vmware-tools-distrib
./vmware-install.pl
-
Log out of the root account.
-
Start X and your graphical environment.
-
In an X terminal, launch the VMware Tools background application.
vmware-toolbox &
Starting VMware Tools Automatically
You may find it helpful to configure your guest operating system
so VMware Tools starts when you start your X server.
For example, in a Red Hat Linux 7.1 guest using GNOME, follow these steps.
-
Open the Startup Programs panel in the GNOME Control Center.
Main Menu (click the foot icon in the lower left corner of the screen)
> Programs > Settings > Session > Startup Programs
-
Click Add.
-
In the Startup Command field, enter vmware-toolbox.
-
Click OK, click OK again, then close the GNOME Control Center.
The next time you start X, VMware Tools starts automatically.
Activar xarxa VMware
Seguim aquesta seqüencia :
/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
depmod -a
modprobe vmxnet
/etc/init.d/network start
Device eth0 has different MAC address than expected, ignoring.
In my understanding this messages comes
when interfece is initialised and
/etc/sysconfig/network-scripts/ifcfg-ethX
does have HWADDR set there and it's different.
Easy test would be to comment HWADDR out.
Install MQ v6 at RH
The installation directory for the MQ product code is /opt/mqm.
Working data is stored in /var/mqm.
You cannot change these locations.
MQ Server :
-
Log in as root.
-
If you are installing from the Server CD-ROM, mount the CD-ROM file system.
-
Install JRE, provided in the JDK, available in SDK :
rpm -ivh IBMJava2-AMD64-142-SDK-1.4.2-0.0.x86_64.rpm
rpm -qa | grep IBM
Ens cal rt.jar i i18n.jar
-
Run the mqlicense.sh script.
If you want to view a text-only version of license,
which can be read by a screen-reader, type:
./mqlicense.sh -text_only
The license is displayed.
If want to accept the license without it being displayed,
you can run the script with the -accept option.
./mqlicense.sh -accept
You must accept the license agreement
before you can proceed with the installation.
Requirement : libXp.so.6
rpm --query --whatprovides 'libXp.so.6'
El error que surt es :
java.lang.UnsatisfiedLinkError: awt (libXp.so.6: no such file)
Use "text_only" or "accept" !
-
mkdir /opt/mqm
&
mkdir /var/mqm
&
mkdir /var/mqm/log
-
crear usuario mqm y grupo mqm
-
comprobar cat /proc/sys/kernel/sem : "1" > 128 & "3" > 5.
-
Use the rpm -ivh command to install each component that you require.
This example shows a minimum installation,
rpm -ivh MQSeriesRuntime-6.0.0-0.i386.rpm MQSeriesServer-6.0.0-0.i386.rpm
Install RunTime, Server, Client, Man pages, Samples.
-
Verify installation :
-
log as MQM
-
crtmqm -q venus.queue.manager
-
strmqm
-
runmqsc + "define qlocal (ORANGE.QUEUE)" + end
-
/opt/mqm/samp/bin/amqsput ORANGE.QUEUE
-
/opt/mqm/samp/bin/amqsget ORANGE.QUEUE
-
Start MQ Explorer : strmqcfg
MQ Client :
- rpm -ivh MQSeriesRuntime-6.0.0-0.i386.rpm MQSeriesClient-6.0.0-0.i386.rpm
- export MQSERVER='CHANNEL1/TCP/server-hostname(port)'
Updates :
To find out which packages are installed on your machine,
enter the following:
rpm -q -a | grep MQSeries
Installing the Information Center :
rpm -ivh MQSeriesHelpSys-6.0.0-0.i386.rpm MQSeriesInfoCen-6.0.0-0.i386.rpm
To start the Information Center,
issue the command strmqinf
Install MQ v7 at RH
url.
RH 6.1 64-bit and MQ
We start on a v6.1 RH:
[sebas@rhv6 ~]$ cat /etc/issue
Red Hat Enterprise Linux Server release 6.1 (Santiago)
It is a 64-bit kernel:
[sebas@rhv6 ~]$ uname -m
x86_64
We need C compiler for samples:
[root@rhv6 ~]# yum install gcc
Loaded plugins: product-id, refresh-packagekit, rhnplugin, subscription-manager
Updating Red Hat repositories.
Error: The SSL certificate /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT failed verification.
Maybe we have to
configure yum:
yum --nogpgcheck install http://rpm.livna.org/livna-release.rpm
http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
Fichero de configuración:
[sebas@rhv6 ~]$ cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=0
plugins=1
installonly_limit=3
sslverify=false
Otro:
[sebas@rhv6 ~]$ cat /etc/sysconfig/rhn/up2date
Solucio:
[root@rhv6 yum.repos.d]# rpm -e rhn-org-trusted-ssl-cert
Compte : aquesta acció esborra el fitxer "/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT"
i ara mateix no se com obtenir-ne un altre de vàlid !
[root@rhv6 rhn]# wget https://rtp.rhn.linux.ibm.com/XMLRPC/pub/RHN-ORG-TRUSTED-SSL-CERT
--2012-09-27 14:26:26-- https://rtp.rhn.linux.ibm.com/XMLRPC/pub/RHN-ORG-TRUSTED-SSL-CERT
Resolving rtp.rhn.linux.ibm.com... 9.37.253.154
Connecting to rtp.rhn.linux.ibm.com|9.37.253.154|:443... connected.
ERROR: cannot verify rtp.rhn.linux.ibm.com's certificate, issued by '/C=US/O=International Business Machines Corporation/CN=IBM INTERNAL INTERMEDIATE CA'
Self-signed certificate encountered.
To connect to rtp.rhn.linux.ibm.com insecurely, use '--no-check-certificate'.
Reposo el certificat i torno a tenir el error original:
[root@rhv6 yum.repos.d]# yum search gcc
Loaded plugins: product-id, refresh-packagekit, rhnplugin, subscription-manager
Updating Red Hat repositories.
. . .
File "/usr/share/rhn/up2date_client/rpcServer.py", line 174, in getServer
raise up2dateErrors.SSLCertificateFileNotFound(msg)
up2date_client.up2dateErrors.SSLCertificateFileNotFound: ERROR: can not find RHNS CA file: /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
rhn_register
It appears this system has already been set up for software updates:
Red Hat Network Location: https://rtp.rhn.linux.ibm.com/XMLRPC
Login: mayli@ca.ibm.com
System ID: ID-1000514133
Are you sure you would like to continue?
Then we can:
[sebas@rhv6 ~]$ yum list available // display available packages
[sebas@rhv6 ~]$ yum install package name // install a specific package
[sebas@rhv6 ~]$ yum update package name // update a specific package
[sebas@rhv6 ~]$ yum update // update all your software
[sebas@rhv6 ~]$ yum check-update // see what updates are available
[sebas@rhv6 ~]$ yum search word // search for a package
Instalació via RPM
[root@mdmdemo software]# rpm -i --test -f /home/sebas/software/dvd/Packages/gcc-4.4.5-6.el6.x86_64.rpm
error: Failed dependencies:
cloog-ppl >= 0.15 is needed by gcc-4.4.5-6.el6.x86_64
cpp = 4.4.5-6.el6 is needed by gcc-4.4.5-6.el6.x86_64
glibc-devel >= 2.2.90-12 is needed by gcc-4.4.5-6.el6.x86_64
[root@mdmdemo software]# rpm -i --test -f /home/sebas/software/dvd/Packages/cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
error: Failed dependencies:
libppl.so.7()(64bit) is needed by cloog-ppl-0.15.7-1.2.el6.x86_64
libppl_c.so.2()(64bit) is needed by cloog-ppl-0.15.7-1.2.el6.x86_64
[root@mdmdemo software]# rpm -i --test -f /home/sebas/software/dvd/Packages/cpp-4.4.5-6.el6.x86_64.rpm
error: Failed dependencies:
libmpfr.so.1()(64bit) is needed by cpp-4.4.5-6.el6.x86_64
[root@mdmdemo software]# rpm -i --test -f /home/sebas/software/dvd/Packages/glibc-devel-2.12-1.25.el6.x86_64.rpm
error: Failed dependencies:
glibc = 2.12-1.25.el6 is needed by glibc-devel-2.12-1.25.el6.x86_64
glibc-headers is needed by glibc-devel-2.12-1.25.el6.x86_64
glibc-headers = 2.12-1.25.el6 is needed by glibc-devel-2.12-1.25.el6.x86_64
[root@mdmdemo software]# rpm -i --test -f /home/sebas/software/dvd/Packages/glibc-2.12-1.25.el6.x86_64.rpm
error: Failed dependencies:
glibc-common = 2.12-1.25.el6 is needed by glibc-2.12-1.25.el6.x86_64
[root@mdmdemo software]# rpm -Uvh --test -f /home/sebas/software/dvd/Packages/glibc-common-2.12-1.25.el6.x86_64.rpm
error: Failed dependencies:
glibc = 2.12-1.25.el6 is needed by glibc-common-2.12-1.25.el6.x86_64
[root@mdmdemo software]# rpm -Uvh --nodeps -f /home/sebas/software/dvd/Packages/glibc-common-2.12-1.25.el6.x86_64.rpm
Preparing... ########################################### [100%]
package glibc-common-2.12-1.25.el6_1.3.x86_64 (which is newer than glibc-common-2.12-1.25.el6.x86_64) is already installed
[root@mdmdemo software]#
[root@mdmdemo software]# rpm -Uvh --nodeps -f /home/sebas/software/dvd/Packages/glibc-2.12-1.25.el6.x86_64.rpm
Preparing... ########################################### [100%]
package glibc-2.12-1.25.el6_1.3.x86_64 (which is newer than glibc-2.12-1.25.el6.x86_64) is already installed
package glibc-2.12-1.25.el6_1.3.i686 (which is newer than glibc-2.12-1.25.el6.x86_64) is already installed
[root@mdmdemo software]#
Instalació neta
Reinstalem RH v6.1 de nou i tenim:
[sebas@rhv6-64b software]$ ls -l
total 375592
-rwx------. 1 sebas sebas 451379310 Oct 5 14:23 WS_MQ_FOR_LNX_ON_X86_64_V7.5_EIMG.tar.gz
Descomprimim:
[sebas@rhv6-64b software]$ mkdir mqv75/
[sebas@rhv6-64b software]$ cd mqv75/
[sebas@rhv6-64b mqv75]$
[sebas@rhv6-64b mq_v75]$ tar -xvf ../WS_MQ_FOR_LNX_ON_X86_64_V7.5_EIMG.tar.gz
Acceptem la llicencia:
[root@rhv6-64b mq_v75]# ./mqlicense.sh
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.
Que
instalar ?
Instalem:
[root@rhv6-64b mq_v75]# rpm -ivh MQSeriesRuntime-7.5.0-0.x86_64.rpm
MQSeriesServer-7.5.0-0.x86_64.rpm
MQSeriesClient-7.5.0-0.x86_64.rpm
MQSeriesSamples-7.5.0-0.x86_64.rpm
MQSeriesSDK-7.5.0-0.x86_64.rpm
Preparing... ########################################### [100%]
Creating group mqm
Creating user mqm
1:MQSeriesRuntime ########################################### [ 20%]
2:MQSeriesServer ########################################### [ 40%]
3:MQSeriesClient ########################################### [ 60%]
4:MQSeriesSamples ########################################### [ 80%]
5:MQSeriesSDK ########################################### [100%]
[root@rhv6-64b mq_v75]#
Intentem fer coses:
[root@rhv6-64b ~]# su - mqm
-bash-4.1$ dspmq
-bash: dspmq: command not found
-bash-4.1$ dspmqver
AMQ8594: WebSphere MQ commands are no longer available in /usr/bin.
In order to run MQ commands you must manage your path configuration as
described in the WebSphere MQ product documentation. In particular review the
topic on "Choosing a primary installation".
-bash-4.1$
InfoCenter,
Choosing a primary installation:
On UNIX and Linux platforms, the first installation onto a system
must be manually configured to be the primary installation.
Set the primary installation using the setmqinst command.
-bash-4.1$ /opt/mqm/bin/setmqinst
Usage: setmqinst (-n InstName | -p InstPath) (-i | -x | -d Text)
-d Descriptive text.
-i Set this installation as the primary installation.
-n Installation name.
-p Installation path.
-x Unset this installation as the primary installation.
Compte : use the setmqinst command to change the installation description of an installation,
or to set or unset an installation as the primary installation.
This command updates information contained in the mqinst.ini file.
Per exemple, si volem crear una altra instalacio de MQ (???), fem:
[root@rhv6-64b ~]# /opt/mqm/bin/crtmqinst -n MQ64 -p /home/sebas/mqinst
Entry created successfully.
[root@rhv6-64b ~]# /opt/mqm/bin/dltmqinst -n MQ64
Entry deleted successfully.
Mostrem el que ja hi ha:
-bash-4.1$ /opt/mqm/bin/dspmqinst
InstName: Installation1
InstDesc:
Identifier: 1
InstPath: /opt/mqm
Version: 7.5.0.0
Primary: No
State: Available
I la fem primaria:
[root@rhv6-64b ~]# /opt/mqm/bin/setmqinst -n Installation1 -i
114 of 114 tasks have been completed successfuly.
'Installation1' (/opt/mqm) set as the Primary Installation.
Posem el usuari "sebas" al grup "mqm" i modifiquem /home/sebas/.bash_profile per contenir
PATH=$PATH:/opt/mqm/bin
export PATH
Ara ja tot es visualitza be:
[root@rhv6-64b ~]# su - mqm
-bash-4.1$ dspmqver
Name: WebSphere MQ
Version: 7.5.0.0
Level: p000-L120604
BuildType: IKAP - (Production)
Platform: WebSphere MQ for Linux (x86-64 platform)
Mode: 64-bit
O/S: Linux 2.6.32-131.0.15.el6.x86_64
InstName: Installation1
InstDesc:
InstPath: /opt/mqm
DataPath: /var/mqm
Primary: No
MaxCmdLevel: 750
Configuració
RH fa servir /etc/profile i després /etc/bashrc and then /etc/profile.d/custom.sh
[sebas@rhv6-64b mq]$ cat ru.sh
clear
echo "Let run."
IP="9.137.165.129"
export MQSERVER="QMM1.GRP1.SVRCONN/tcp/${IP}(2411)"
QMGRN="QMM1"
QNM="QDLQ"
echo "MQCHLLIB is {" $MQCHLLIB "}."
echo "MQCHLTAB is {" $MQCHLTAB "}."
echo "MQDATA is {" $MQDATA "}."
echo "MQSERVER is {" $MQSERVER "}."
echo "Queue Manager name is {" $QMGRN "}."
echo "Queue name is {" $QNM "}."
/home/sebas/cmds/mq/inqqdc $QNM $QMGRN
I el resultat és espectacular:
[sebas@rhv6-64b mq]$ ./ru.sh
Let run.
MQSERVER is { QMM1.GRP1.SVRCONN/tcp/9.137.165.129(2411) }.
MQCHLLIB is { }.
MQCHLTAB is { }.
MQDATA is { }.
Queue Manager name is { QMM1 }.
Queue name is { QDLQ }.
Sample INQQD start, v 3.0.1.a, 20120928.
>>> Param - Queue name = {QDLQ}.
>>> Param - Queue Manager name = {QMM1}.
>>> MQCONN. QMN = {QMM1}.
>>> MQOPEN. QN = {QDLQ}.
>>> MQINQ.
+++ Current depth [0].
Sample INQQD end - RC [0].
MQTT now has its own
page !
How to compile samples
To have headers and libraries, install MQSeriesSDK-7.0.1-0.x86_64.rpm
To have sample code, install MQSeriesSamples-7.0.1-0.x86_64.rpm
LABSS2
[sebas@labss2 reply]$ cat co.sh
#!/bin/bash
clear
FN="amqsecha"
FN="inqqd"
FNI=$FN'.c'
FNOS=$FN
FNOC=$FN'c'
echo "1 = esborrar vell."
rm -f $FNOS
rm -f $FNOC
ls *
echo "2 = compilar {" $FNI "}. Sortides {" $FNOS "} i {" $FNOC "}."
gcc -o $FNOS -I/opt/mqm/inc -Wl,-rpath=/opt/mqm/lib -lmqm_r $FNI
gcc -o $FNOC -I/opt/mqm/inc -Wl,-rpath=/opt/mqm/lib -lmqic_r $FNI
echo "3 = mostrar."
ls *
Veiem que funciona:
[sebas@labss2 reply]$ cat ru.sh
#!/bin/bash
clear
IP="99.137.165.129"
MQSERVER="QMM1.GRP1.SVRCONN/tcp/${IP}(2411)"
QMGRN="QMM1"
QNM="QDLQ"
echo "MQSERVER is {" $MQSERVER "}."
echo "Queue manager name is {" $QMGRN "}."
echo "Queue name is {" $QNM "}."
inqqdc $QNM $QMGRN
[sebas@labss2 reply]$ ./ru.sh
MQSERVER is { QMM1.GRP1.SVRCONN/tcp/99.137.165.129(2411) }.
Queue manager name is { QMM1 }.
Queue name is { QDLQ }.
Sample INQQD start, v 2.0.1.a, 01112011.
>>> Param - Queue name = {QDLQ}.
>>> Param - Queue Manager name = {QMM1}.
>>> MQCONN. QMN = {QMM1}.
>>> MQOPEN. QN = {QDLQ}.
>>> MQINQ.
+++ Current depth [0].
Sample INQQD end - RC [0].
[sebas@labss2 reply]$
Pend : verificar que no cal posar el gestor :
{mqjeff} The QM name is entirely optional
p7029 / p9111
sebas@p7029-6E3:~/eines/wlg> cat co.sh
#!/bin/bash
clear
FN=wlg
FNC=$FN".c"
echo "Compilem" $FN
gcc -o $FN $FNC -I/opt/mqm/inc -lmqm_r
ls -al wlg*
sebas@p7029-6E3:~/eines/inqQ> cat co.sh
#!/bin/bash
clear
FN=inqqd
FNC=$FN".c"
echo "Compilem" $FN
gcc -o $FN $FNC -I/opt/mqm/inc -lmic_r
ls -al i*
64-bit
[sebas@rhv6-64b mq]$ cat co.sh
clear
FNIN=inqqd.c
echo "Compile {" $FNIN "}."
gcc -m64 -o inqqdc -I/opt/mqm/inc -Wl,-rpath=/opt/mqm/lib -lmqic_r $FNIN
ls *
[sebas@rhv6-64b mq]$ file inqqdc
inqqdc: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
Mind "64" libraries:
CC=gcc
INC=-I/opt/mqm/inc -I.
LIB=-L/opt/mqm/lib64 -lmqmc
all: mqcapture
mqcapture: mqcapture.o qsubs.o comsubs.o
$(CC) ${INC} -o mqcapture mqcapture.o qsubs.o comsubs.o ${LIB}
Eines : saveQmgr @ linux
Ens baixem MS03 i configurem:
$ vi makefile.linux
# This Makefile makes the saveqmgr executables on linux (ms03)
# Set the suffix for the target files
EXESUF = linux
# CC defines the compiler
CC = gcc
# LC defines the linker
LC = $(CC)
# MQM library directory (32-bit)
MQMLIB = /opt/mqm/lib
# set LIBS to list all the libraries ms03 should link with.
LIBS = -lm -lmqm
LIBC = -lm -lmqic
# set INCS to list all the header the compiler needs
INCS = -I. -I/opt/mqm/inc
# Set CCOPTS - the compiler options
CCOPTS = -c -DUNIX -Wall -o $*.$(OBJSUF)
CCOPTC = -c -DUNIX -DUSEMQCNX -Wall -o $@
# Set LCOPTS - the linker options (32-bit)
LCOPTS = -m32 -Wl,-rpath=$(MQMLIB) -o $@ -L$(MQMLIB) -L. $(LIBS)
LCOPTC = -m32 -Wl,-rpath=$(MQMLIB) -o $@ -L$(MQMLIB) -L. $(LIBC)
# Set the suffix for the object files
OBJSUF = o
RM = rm
# Include the file which does the real work!
include makefile.common
Ara compilem:
sebas@p9111-520:~/codi/MQcfg/SaveQmgr> make -f makefile.linux
I ja podem executar:
sebas@p9111-520:~/codi/MQcfg/SaveQmgr> ./saveqmgr.linux
Compiled for Websphere MQ V7.0 on Oct 20 2011
SAVEQMGR V6.1.1
MQCONN failed for , CC=2 RC=2059
sebas@p9111-520:~/codi/MQcfg> ./saveqmgr.linux -s -f -m P9111
Writing Queue Manager definition to P9111.MQSC.
Power on
To start MQ at op sys power on:
# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# Ejemplo de creacin de fichero en el arranque
touch ~/test.txt
# Ejecutamos un script
/bin/sh ~/test.sh
MQ linux problems
WMQ application fails to connect to queue manager and receives FDC XY029004 when socket descriptor exceeds FD_SETSIZE(1024)
This problem occurs for applications that use a large number of file descriptors
such as MQ Java applications running in WebSphere Application Server (WAS) or in any other application server.
Users running WebSphere MQ V7 applications which use more than 1024 file descriptors in a single process;
for example a JVM running inside an application server.
WebSphere MQ has been modified to allow applications to use poll instead of select for file descriptor multiplexing.
To enable WebSphere MQ to use poll,
export the environment variable AMQ_DONT_USE_SELECT_FOR_SOCKMTX to a non null value.
The export of this environment variable should be performed in the applications environment.
url