![[AIX]](ngaix.gif)
![[Linux]](nglinux.gif)
Migrating IBM MQ library loading to a later version on AIX and Linux
On AIX® and Linux®, no change in the way IBM® MQ libraries are loaded is normally required if you upgrade from an earlier version of the product to a later version by replacing an earlier version of the product with the later version, based on the single stage scenario. However, if you choose to take advantage of multi-installation in the later version of the product, based on the side-by-side or multi-stage migration scenarios, you might have to configure the runtime environment differently, for the operating system to load the later version of the IBM MQ library.
Before you begin
To migrate applications from an earlier version of the product to the later version, you must know how the operating system loads an IBM MQ library for an application. Is the load path fixed by the application, and can you set the path in an environment variable? It is not essential to know the name of the IBM MQ library that the application loads. The library name does not change from an earlier version of the product to the later version, although the contents of the library do.
Read Multi-installation queue manager coexistence on AIX, Linux, and Windows before starting this task.
Plan and install the later version of IBM MQ, and remember the installation name and whether the installation was set to primary.
About this task
To migrate an application from an earlier version of the product to the later version, you do not have to recompile or relink the application, because the IBM MQ libraries are compatible with later versions; see Application compatibility and interoperability with later versions of IBM MQ.
The build procedure for IBM MQ applications is to include an explicit library path to the location of the IBM MQ libraries, and to /usr/lib, in the link step of the compiler, as shown in Figure 1. The build procedure is the same for the later version of the product.
gcc -m32 -o amqsput_32_r amqsput0.c -I/opt/mqm/inc -L/opt/mqm/lib
-Wl,-rpath=/opt/mqm/lib -Wl,-rpath=/usr/lib -lmqm_r -lpthread
The example shown in Figure 1 is for Linux, but the build step for AIX platforms is similar.
- Single-stage scenario
- If you are replacing an earlier version of the product with the later version, based on the single stage scenario described in Migrating on AIX and Linux: single-stage, you do not, in most cases, need to make any changes to the way IBM MQ libraries are loaded. The possible exception to this is if you changed the location of the libraries from the earlier version, or created symbolic links to the libraries.
- Side-by-side and Multi-stage scenarios
- If you have chosen a multi-installation approach to installing the later version of the product, based either on the side-by-side scenario described in Migrating on AIX and Linux: side-by-side, or the multi-stage migration scenario described in Migrating on AIX and Linux: multi-stage, you must investigate whether applications connecting to the later version of the product are linked to, and load libraries from, the correct installation and then modify the environment for the operating system to resolve IBM MQ dependencies for an application as appropriate. Typically, you can modify the runtime environment, rather than relink the application. You can use the following two commands to assist you in configuring the runtime environment:
Scenario |
Latest version replaces earlier version in the same location Single-stage |
Latest version replaces earlier version in a different location Side-by-side |
Latest version alongside earlier version Multi-stage |
|
---|---|---|---|---|
Action |
||||
setmqinst |
setmqinst makes the later version installation primary. Symbolic links to the IBM MQ link libraries are inserted into /usr/lib. |
No. The later version installation can be primary, because an earlier version is installed. |
||
No other configuration actions |
Library loading works correctly. Library loading works, even without the later version installation being made primary, because
the libraries are installed in /opt/mqm/lib and the application was built with
the link option, |
Library loading works correctly. Library loading works, because the installation is primary, and the application was built with
the link option, |
The library loading continues to work with the earlier version correctly, nothing works with the later version. |
|
setmqenv, without setting the -k or -l options. |
Library loading works correctly. setmqenv is unnecessary. Library loading works, because the libraries are
installed in /opt/mqm/lib and the application was built with the link option,
|
Library loading works correctly. setmqenv is unnecessary. Library loading works, because the installation is
primary, and the application was built with the link option, |
The library loading continues to work with the earlier version correctly, nothing works with the later version. |
|
setmqenv, with the -k or -l options set. |
Library loading works correctly. |
Library loading works correctly, both for the earlier version and the later version. The correct earlier version is loaded, because the later version library loads the earlier version library for queue managers that have not been migrated from the earlier version. |
||
The operating system finds the IBM MQ library
location set by setmqenv. setmqenv adds the location to
|
Procedure
What to do next
If you add further installations of the later version of the product, you must decide which installation to make primary, if you have chosen to make any primary. As long as applications load IBM MQ libraries from one of the later version installations, such as the primary installation, they can connect to queue managers associated with any other later version installation.