Run the IBM® MQ MQI client sample program
amqsfhac in parallel with amqmfsck to demonstrate that a queue
manager maintains message integrity during a failure.
Before you begin
You require four servers for this test. Two servers for the multi-instance queue manager, one for
the file system, and one for running amqsfhac as an IBM MQ MQI client application.
Follow step 1 in Verifying shared file system behavior on Multiplatforms to
set up the file system for a multi-instance queue manager.
About this task
The IBM MQ MQI client sample program
amqsfhac checks that a queue manager using networked storage maintains data
integrity following a failure. Run amqsfhac in parallel with amqmfsck to demonstrate that a queue manager
maintains message integrity during a failure.
Procedure
-
Create a multi-instance queue manager on another server,
QM1
, using the file
system you created in step 1 in Procedure.
-
Start the queue manager on both servers making it highly available.
On server 1:
strmqm -x QM1
On server 2:
strmqm -x QM1
-
Set up the client connection to run amqsfhac.
-
Use the procedure in Verifying an IBM MQ
installation for the platform, or platforms, that your enterprise use to set up a client
connection, or the example scripts in Reconnectable client samples.
-
Modify the client channel to have two IP addresses, corresponding to the two servers running
QM1
.
In the example script, modify:
DEFINE CHANNEL(CHANNEL1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) +
CONNAME('LOCALHOST(2345)') QMNAME(QM1) REPLACE
To:
DEFINE CHANNEL(CHANNEL1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) +
CONNAME('server1(2345),server2(2345)') QMNAME(QM1) REPLACE
where
server1
and
server2
are the host names of the two servers,
and
2345
is the port that the channel listener is listening on. Usually this
defaults to
1414
. You can use
1414
with the default listener
configuration.
-
Create two local queues on
QM1
for the test.
Run the following MQSC script:
DEFINE QLOCAL(TARGETQ) REPLACE
DEFINE QLOCAL(SIDEQ) REPLACE
-
Test the configuration with amqsfhac
amqsfhac QM1 TARGETQ SIDEQ 2 2 2
-
Test message integrity while you are testing file system integrity.
amqsfhac QM1 TARGETQ SIDEQ 10 20 0
If you stop the active queue manager instance, amqsfhac reconnects to the
other queue manager instance once it has become active. Restart the stopped queue manager instance
again, so that you can reverse the failure in your next test. You will probably need to increase the
number of iterations based on experimentation with your environment so that the test program runs
for sufficient time for the failover to occur.
Results
An example of running
amqsfhac in step
6 is shown in
the following example. In this example, the test is a success.
Sample AMQSFHAC start
qmname = QM1
qname = TARGETQ
sidename = SIDEQ
transize = 10
iterations = 20
verbose = 0
Iteration 0
Iteration 1
Iteration 2
Iteration 3
Iteration 4
Iteration 5
Iteration 6
Resolving MQRC_CALL_INTERRUPTED
MQGET browse side tranid=14 pSideinfo->tranid=14
Resolving to committed
Iteration 7
Iteration 8
Iteration 9
Iteration 10
Iteration 11
Iteration 12
Iteration 13
Iteration 14
Iteration 15
Iteration 16
Iteration 17
Iteration 18
Iteration 19
Sample AMQSFHAC end
If the test detected a problem, the output would report the failure. In some test runs
MQRC_CALL_INTERRUPTED
might report Resolving to backed out
.
It makes no difference to the result. The outcome depends on whether the write to disk was committed
by the networked file storage before or after the failure took place.