Professional Documents
Culture Documents
Rumsey Best Practices
Rumsey Best Practices
By Jonathan Rumsey IBM Hursley E-mail: jrumsey@uk.ibm.com Date: 31st May 2006
Copyright IBM Corp., 2006
WebSphere MQ for iSeries Best Practice Guide ........................................................ 2 1 Introduction ....................................................................................................... 3 2 WebSphere MQ maintenance and software rollout............................................. 4 2.1 Software maintenance ................................................................................ 4 2.2 Managing rollouts ...................................................................................... 5 3 General housekeeping........................................................................................ 6 3.1 Creating and changing objects.................................................................... 6 3.2 Journal housekeeping................................................................................. 6 3.3 Shared memory cleanup............................................................................. 6 3.4 Queue manager shutdown .......................................................................... 7 3.5 12-Step / Cold Start procedure ................................................................... 7 3.6 Backups ..................................................................................................... 8 3.6.1 Data ................................................................................................... 8 3.6.2 Object definitions ............................................................................... 9 3.7 Multiple queue managers ........................................................................... 9 3.8 Daylight saving time ................................................................................ 10 3.8.1 Spring time change........................................................................... 10 3.8.2 Autumn or fall time change .............................................................. 10 4 Performance .................................................................................................... 12 4.1 Journal receiver location .......................................................................... 12 4.2 Journal receiver switching........................................................................ 12 4.3 Restart time.............................................................................................. 13 4.4 Channel process pooling .......................................................................... 13 4.5 IFS Type 2 ............................................................................................... 14 5 Availability...................................................................................................... 15 5.1 High Availability (HA) clustering ............................................................ 15 5.1.1 Remote mirroring............................................................................. 15 5.1.2 Backup queue managers ................................................................... 15 5.2 High Availability features ........................................................................ 16 5.2.1 WebSphere MQ clustering ............................................................... 16 5.2.2 Client Channel table ......................................................................... 17 5.3 Network topology .................................................................................... 17 5.4 Hardware assistance................................................................................. 18 6 Conclusion ...................................................................................................... 18
Table of Contents
1 Introduction
This document is intended for people who manage WebSphere MQ 5.3 or 6.0 software on iSeries machines. It has been written for both novice and expert users of WebSphere MQ and encapsulates general best practice information that has been collated by the IBM development and service teams from customer installations. It is divided into four main sections: WebSphere MQ maintenance and software rollout, General housekeeping, Performance, and Availability. This guide should be used in conjunction with, and not as a replacement to, the WebSphere MQ publications. Full details of the WebSphere MQ administration and programming interfaces are available in these publications; the latest editions of all books can be downloaded from the WebSphere MQ Web site .
Page 3 of 18
Page 4 of 18
It takes time to test applications and roll the product into production systems and lastminute upgrades can run into problems if this testing is not done. We know that some sites take several months to implement a replacement version, as they go through the tiers of testing. Problems need to be found early so that you have time to fix these problems before the final end of service deadline. The latest version of WebSphere MQ for iSeries at the time of writing (May 2006) is V6.0. This release contains many functional enhancements over V5.3. It also contains fixes to all the relevant, known defects that were included in the V5.3 PTFs available before V6.0 shipped. Future fixes made to V5.3 will also be included in V6.0 PTFs where appropriate. You can see the WebSphere MQ Support, Service summary for OS/400 for a summary of the problems fixed in each PTF. This page also shows the end of service date for each version of WebSphere MQ.
Page 5 of 18
3 General housekeeping
3.1 Creating and changing objects
It is good practice when creating queue manager objects, to put the object creation commands into an MQSC script or CL command program. If you always create WebSphere MQ objects programmatically then you have a record of the queue manager definitions that allows you to very quickly rebuild an entire queue manager. When changing WebSphere MQ objects, change the definition of the object in the program and rerun the program rather than changing the object directly.
Page 6 of 18
Page 7 of 18
Performing a cold start is not best practice. When WebSphere MQ journal receivers that are still required by the queue manager are deleted it must be understood that messages can be lost or duplicated. Normal queue manager start-up processing involves reconciling the data in the AMQAJRN journal with the data in the IFS queue files. When a queue manager is restarted using the cold start procedure, there is no journal data to replay, so WebSphere MQ cannot perform its normal start-up processing. The start-up reconciliation is required by WebSphere MQ to guarantee integrity. One of the key reasons this is required is because WebSphere MQ uses a technique called write-ahead logging. This means that whenever WebSphere MQ puts or gets persistent messages, the put or get is recorded in two ways: 1. With a forced disk write to the AMQAJRN Journal, meaning that WebSphere MQ waits for OS/400 or i5/OS to confirm that the disk has been physically updated. 2. With a lazy write to the queue, WebSphere MQ caches some data in memory, and writes some data to the IFS queue file with an OS/400 unforced write. The unforced write will be stored in operating system buffers and written to disk at the operating system's convenience. The journal data on disk is therefore the master copy of WebSphere MQ data. In normal circumstances when WebSphere MQ is shut down and restarted, STRMQM processing ensures that the data in the queue files is brought up to date with the data in the journals. If a queue manager or system terminates abnormally, then information about messages and transactions may exist in the journal, but not in the IFS. Deleting the journal receivers as part of a cold start deletes the only copy of these messages and transactions. By using the cold start procedure (by deleting the journals and bypassing any STRMQM reconciliation) could lead to loss, duplication, or corruption of data. Because the data in the journal receivers is so important to the recovery of MQ data, we strongly recommend that the journal receivers are stored on RAID protected disk, and that the cold start is avoided wherever possible.
3.6 Backups
Two methods to consider when planning a backup and recovery strategy for WebSphere MQ are the data backup and object definition backup. These methods are complementary, and most enterprises successfully implement a combination of these two techniques.
3.6.1 Data
It is necessary to quiesce a queue manager before fully backing up its IFS and journal data, you can however, take a backup of just the journal data while the queue manager is running. If the backed up journal data is restored then it is possible to fully recover a queue manager and its IFS data.
WebSphere MQ for iSeries Best Practice Guide Page 8 of 18
It is a good idea to perform a full backup of the WebSphere MQ libraries and IFS directories occasionally (for example, when the queue manager is quiesced to apply maintenance). Journal backups can be taken more frequently, for example, daily or weekly.
MS03 and AMQOAMD provide a quick and lightweight way of backing up and restoring a queue managers definitions from one machine to another, or even between queue managers on a single machine. The alternative to using MS03 is using one of the third-party system management tools that hold queue manager configurations in a central repository.
Page 9 of 18
Advantages of a single queue manager: Low overhead - There is a fixed minimum overhead associated with a queue manager. Dependent on the version, each queue manager can start between five and eleven jobs before any applications connect. The fewer queue managers, the fewer system resources are used. Management - An increase to the number of queue managers may increase the management tasks that need to be performed. Running each queue manager in a separate subsystem is a good strategy to simplify queue manager maintenance if multiple queue managers are used.
Advantages of multiple queue managers: Failure impact - A single queue manager is a single point of failure for all applications. Multiple queue managers can reduce the impact of a failure to only the application(s) or location(s) being served by that queue manager. Scalability - On a single queue manager system, one high volume application can adversely affect the performance of all other applications using the queue manager. Having multiple queue managers gives scope for greater throughput on a queue manager by queue manager basis. For example, if the performance of a queue manager is suffering because of a bottleneck when writing to the journals it is possible to move the journals for that queue manager to a dedicated disk. WebSphere MQ 6.0 allows you to allocate storage for queue manager journal data to a specific auxiliary storage pool. Availability planning Multiple queue managers can simplify planning for high availability. It allows individual queue managers and applications to be considered as a single failover unit that can be failed over to another machine without affecting services for other applications.
Page 10 of 18
WebSphere MQ is stopped for an hour either before, or after the time change and UTC offset update, to avoid the problems associated with setting the system clock backward by an hour. In environments where downtime must be minimized, an enforced outage of one hour may not be acceptable. IBM is investigating a solution to this problem, but until a solution is available the only alternative to quiescing the queue manager for an hour is to perform a controlled cold start of the system (see section 3.5 for a discussion of the Cold Start). A controlled cold start is one where all queues are emptied of any persistent messages and the queue manager is cleanly shut down. The queue manager journal data can then be deleted per the cold start procedure. This eliminates the risk of losing messages, but it still deletes all media recovery information. You will not be able to recover damaged objects without media recovery information, so you should ensure that you have backed up your object definitions prior to attempting this (see section 3.6.2). Your IBM service representative will be able provide details of the cold start procedure should it be required.
Page 11 of 18
4 Performance
4.1 Journal receiver location
The critical path for performance of persistent messages is usually the update of the WebSphere MQ log files (journals on iSeries), these updates should ideally be isolated using operating system facilities so that they are written using dedicated disk heads. This is achieved by putting the Queue Manager AMQAJRN and its receivers into a separate Auxiliary Storage Pools, this facility is provided as an option when creating your queue manager at WebSphere MQ 6.0.
Page 12 of 18
where QMGRLIB is the name of your queue manager library, AMQAnnnnnn is the name of the next journal receiver in sequence, and NEW_ SIZE is the new receiver size.
Important: If you use Channel process pooling you must ensure that all channel exits are thread-safe, as you would need to do so with any threaded MCAs.
Page 13 of 18
Page 14 of 18
5 Availability
5.1 High Availability (HA) clustering
High Availability (HA) clustering is a general term for systems where a service is automatically restarted, perhaps on a different box, when a failure is discovered. WebSphere MQ provides technology for integrating with HA frameworks where the WebSphere MQ data and journals are stored on a disk that can be accessed by more than one machine (not necessarily simultaneously). When a machine fails, the disk is switched to the other machine and the queue manager is restarted. There will be a short delay while the takeover occurs, queue managers outside the HA cluster will automatically reconnect as channel retry kicks in, and no persistent messages are lost. OS/400 V5R2 introduced the ability to place libraries onto disks that can be switched between two machines (Independent Auxiliary Storage Pools or IASPs). This makes it possible to develop an HA clustering solution for WebSphere MQ. IBM have provided a SupportPac that shows how to configure OS/400 HA clusters with WebSphere MQ.
Page 15 of 18
command which informs the queue manager to just replay the journal data to update the IFS, rather than perform a full queue manager startup. Periodically new journal receivers are copied from the primary queue manager to the backup and replayed using STRMQM REPLAY(*YES) command. At this stage the backup cannot yet be started proper, but if the primary queue manager fails the backup queue manager can then be activated using STRMQM ACTIVATE(*YES). Using the backup queue manager feature does not impact performance of the primary queue manager as would occur in remote mirroring and in most scenarios it is faster to start a backup rather than a mirrored queue manager. This solution may not be acceptable if loss of some messages is unacceptable, as the backup queue manager may not be completely up to date with the same configuration and message data to that of the primary queue manager.
Page 16 of 18
Many customers are using WebSphere MQ clustering successfully in large configurations; it is our normal recommendation for managing a set of queue managers that need to share workload. More information about Clustering can be found in these online WebSphere MQ manuals.
Page 17 of 18
6 Conclusion
This article discussed some of the best practices that will help you to get the most out of WebSphere MQ on iSeries. These practices will help you keep your system up to date, safely backed up, available, and performing well. WebSphere MQ is a versatile product that is used in many environments and that makes it difficult to describe procedures that will cover every eventuality. If you have a best practice that is not covered here, the authors would be interested to hear about it.
IBM and WebSphere are trademarks or registered trademarks of IBM Corporation in the United States, other countries, or both. Other company, product, and service names may be trademarks or service marks of others. IBM copyright and trademark information
Page 18 of 18