IBM® AIX® V6.1 中引入了 WPAR,目的是提供一种方式,在 AIX 逻辑分区 (LPAR) 内实现分区操作。WPAR 允许将单个 AIX 实例分布到多个虚拟分区中,这样系统管理员能够快速部署多个隔离的 AIX 环境,同时没有管理单独 AIX 映像的开销。目前有两种类型的 WPAR:
- 应用程序 WPAR
- 单个进程(及其子进程)在其自己的分区内运行
- 系统 WPAR
- 整个 AIX 环境可以是共享的或分离的
如果系统 WPAR 是共享的,它会将全局环境的 /usr 和 /opt 分区挂载为只读的并共享这些分区。如果系统 WPAR 是分离的,它有一个全局环境的克隆并且所有文件系统都是 WPAR 本地的。图 1 显示了在相同 LPAR 中创建的共享 WPAR 和分离 WPAR。共享 WPAR 在全局环境中对 /usr 和 /opt 只能进行读取操作。分离 WPAR 无法访问全局环境并且使用其自己的文件系统:
图 1. 部署系统 WPAR

本文将探讨不同类型的 WPAR 以及在 AIX 上部署 IBM CICS® Transaction Gateway (TG) 时使用这些 WPAR 的方式。
第一个也是最简单的 WPAR 是应用程序 WPAR,它是一个适合执行一个或多个应用程序进程的轻量环境。对于在远程模式中运行的客户端应用程序,或者在本地模式中运行时使用了 IPIC 协议的地方,CICS TG 支持应用程序 WPAR。图 2 显示了在全局环境中运行的 Gateway 守护进程与三个应用程序 WPAR,每个 WPAR 运行一个连接到该 Gateway 守护进程且类型不同的应用程序:
图 2. 部署应用程序 WPAR

在这个例子中,Gateway 守护进程在全局环境中运行,因此在 LPAR 中启动:
aix7host144 # ctgd start |
要在 WPAR 中运行的应用程序是 Java EciB3 示例,最初是在远程模式中运行的。由于应用程序 WPAR 创建了它自己的环境,所以 CLASSPATH 并非继承自全局环境,并且必须作为命令行参数传递给该应用程序。要启动应用程序 WPAR,可使用 wparexec 命令和主机名(在本例中是 ctgwpar1),以及一个有 IP 地址 (192.168.1.1) 的网络栈,这样应用程序才能与 Gateway 守护进程通信:
aix7host # wparexec -h ctgwpar1 -N interface=en0 address=192.168.1.1 netmask=255.255.255.0
/opt/IBM/cicstg/jvm16/bin/java -cp
/opt/IBM/cicstg/classes/ctgsamples.jar:/opt/IBM/cicstg/classes/ctgclient.jar
com.ibm.ctg.samples.eci.EciB3 tcp://aix7host 2006
Starting workload partition 'ctgwpar1'.
Mounting all workload partition file systems.
Loading workload partition.
CICS Transaction Gateway Basic ECI Sample 3
Usage: java com.ibm.ctg.samples.eci.EciB3 [Gateway URL]
[Gateway Port Number]
[SSL Keyring
SSL Password]
To enable client tracing, run the sample with the following Java option:
-Dgateway.T.trace=on
The address of the gateway has been set to tcp://aix7host port 2006
CICS servers defined:
1. TS20IPIC – CICS TS IPIC server
2. TX20 – TXSeries TCP server
3. TS20 – CICS TS SNA server
Choose server to connect to, or Q to quit: 1
Enter text to send to the CICS program: HELP ME
Program EC03 returned 5 containers in channel "SAMPLECHANNEL":
[CHAR] CICSDATETIME = 31/05/2011 15:35:14
[CHAR] INPUTDATA = HELP ME
[CHAR] OUTPUTMESSAGE = Input data was: HELP ME
[BIT] INPUTDATALENGTH = 00000007
[CHAR] INPUTDATACCSID = 819
Shutting down all workload partition processes.
|
进程结束时,会关闭 WPAR 并删除它。要想验证应用程序 WPAR 是否与全局环境中的正确 Gateway 守护进程进行了通信,可检查 Gateway 信息日志:
05/31/11 15:35:03:994 [0] CTG6506I Client connected: [ConnectionManager-0] - tcp@Socket[addr=/192.168.1.1,port=52127,localport=2006] 05/31/11 15:35:14:453 [0] CTG8429I Established new IPIC connection to CICS server TS20IPIC with: negotiated session limit=100, CICSAPPLID=IY2GTG20 CICSAPPLIDQUALIFIER=GBIBMIYA, HOSTNAME=cicsserv.ibm.com, PORT=1120,sockets=2 05/31/11 15:35:14:473 [0] CTG6507I Client disconnected: [ConnectionManager-0] - tcp@Socket[addr=/192.168.1.1,port=52127,localport=2006], reason = Java client application closed the connection |
从上述代码中可以看到,WPAR 的 IP 地址正在连接并触发 Gateway,以建立与 CICS 的 IPIC 连接。然后可以让应用程序返回到本地模式,只需在 CLASSPATH 中添加 ctgserver.jar:
# wparexec -h ctgwpar1 -N interface=en0 address=192.168.1.1 netmask=255.255.255.0
/opt/IBM/cicstg/jvm16/bin/java -cp /opt/IBM/cicstg/classes/ctgsamples.jar:
/opt/IBM/cicstg/classes/ctgclient.jar:/opt/IBM/cicstg/classes/ctgserver.jar
com.ibm.ctg.samples.eci.EciB3
Starting workload partition 'ctgwpar1'.
Mounting all workload partition file systems.
Loading workload partition.
CICS Transaction Gateway Basic ECI Sample 3
Usage: java com.ibm.ctg.samples.eci.EciB3 [Gateway URL]
[Gateway Port Number]
[SSL Keyring
SSL Password]
To enable client tracing, run the sample with the following Java option:
-Dgateway.T.trace=on
The address of the gateway has been set to local: port 2006
IPIC servers are not listed when running in local mode.
Enter URL of a CICS server, or Q to quit: tcp://winmvs2g:1120
Enter text to send to the CICS program: HELP ME
Program EC03 returned 5 containers in channel "SAMPLECHANNEL":
[CHAR] CICSDATETIME = 31/05/2011 16:02:47
[CHAR] INPUTDATA = HELP ME
[CHAR] OUTPUTMESSAGE = Input data was: HELP ME
[BIT] INPUTDATALENGTH = 00000007
[CHAR] INPUTDATACCSID = 819
Shutting down all workload partition processes.
|
您还可以运行那些在应用程序 WPAR 内调用 Remote C ECIv2、ESIv2 和 Statistics API 的应用程序。
应用程序 WPAR 中的客户端应用程序在其自己隔离的环境中运行,完成自己的网络栈,这样做拥有以下优势:
- 在监控期间很容易识别应用程序实例
- 应用程序内的问题不会影响 LAPR 的其他部分,也不会影响其中运行的任何其他 WPAR。
共享的系统 WPAR 作为一个 AIX 实例出现,但共享全局环境的 /usr 和 /opt 文件系统,并在 WPAR 中将这些系统挂载为只读的。下面提供了一个如何使用 WPAR 运行 CICS TG 的例子。图 3 显示将一个 CICS TG 安装配置为在全局环境中运行,在该全局环境 LPAR 中还有三个共享的系统 WPAR。第一个系统 WPAR 在全局环境中使用 ctg.ini 配置文件,其他两个 WPAR 都有其自己的本地配置,但仍使用已安装的 CICS TG 可执行文件。
图 3. 部署共享系统 WPAR

第一步是创建 WPAR。在本例中,您要指定:
- WPAR 名称是
ctgwpar1。 - 安装是共享的。
- 主机名是
ctgwpar1。 - 网络路由信息继承自全局环境。
- 网络使用
en0与给定的 IP 地址。
要创建 WPAR,可使用以下命令:
aix7host # mkwpar -n ctgwpar1 -l -h ctgwpar1 -r -N interface=en0 address=192.168.1.1 netmask=255.255.255.0 |
WPAR 名称和主机名不必相同,但测试表明 SNA 远程 API 客户端会查找 WPAR 名称,而不是主机名。如果二者的名称不同,WPAR 名称可能无法解析为有效的 IP 地址。
aix7host # startwpar -v ctgwpar1 Starting workload partition 'ctgwpar1'. Mounting all workload partition file systems. Mounting '/wpars/ctgwpar1'. Mounting '/wpars/ctgwpar1/home'. Mounting '/wpars/ctgwpar1/opt'. Mounting '/wpars/ctgwpar1/proc'. Mounting '/wpars/ctgwpar1/tmp'. Mounting '/wpars/ctgwpar1/usr'. Mounting '/wpars/ctgwpar1/var'. Loading workload partition. Exporting workload partition devices. Exporting workload partition kernel extensions. Starting workload partition subsystem 'cor_ctgwpar1'. 0513-059 The cor_ctgwpar1 Subsystem has been started. Subsystem PID is 11403326. Verifying workload partition startup. Return Status = SUCCESS. aix7host # lswpar Name State Type Hostname Directory RootVG WPAR -------------------------------------------------------------- ctgwpar1 A S ctgwpar1 /wpars/ctgwpar1 no |
要想验证 WPAR 已成功创建为共享安装,可检查已创建的 WPAR 下的文件系统在 /dev 上已挂载(/opt 和 /usr 是一个例外,它们在 WPAR 中被挂载为只读的):
aix7host # df -k Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/hd4 1245184 971756 22% 11826 6% / /dev/hd2 5734400 1507368 74% 62691 16% /usr /dev/hd9var 1048576 756404 28% 7002 4% /var /dev/hd3 3145728 3141308 1% 133 1% /tmp /dev/hd1 1212416 1038192 15% 2919 2% /home /dev/hd11admin 131072 130692 1% 5 1% /admin /proc - - - - - /proc /dev/hd10opt 2490368 1857964 26% 13218 4% /opt /dev/livedump 262144 261776 1% 4 1% /var/adm/ras/livedump /dev/fslv00 98304 67200 32% 2322 14% /wpars/ctgwpar1 /dev/fslv01 32768 31904 3% 5 1% /wpars/ctgwpar1/home /opt 2490368 1857964 26% 13218 4% /wpars/ctgwpar1/opt /proc - - - - - /wpars/ctgwpar1/proc /dev/fslv02 98304 96688 2% 9 1% /wpars/ctgwpar1/tmp /usr 5734400 1507368 74% 62691 16% /wpars/ctgwpar1/usr /dev/fslv03 131072 110100 17% 363 2% /wpars/ctgwpar1/var |
共享的系统 WPAR 有其自己的 IP 地址,因此用户可以使用 rlogin 和主机名远程登录该 WPAR。用户登录后,WPAR 的外观与普通的 AIX 系统相同。所有文件系统都标记为全局并且不能查看 WPAR 外部的任何文件系统。
aix7host # rlogin ctgwpar1 ******************************************************************************* * Welcome to AIX Version 7.1! * * Please see the README file in /usr/lpp/bos for information pertinent to * * this release of the AIX Operating System. * ******************************************************************************* ctgwpa1 # df -k Filesystem 1024-blocks Free %Used Iused %Iused Mounted on Global 98304 67196 32% 2321 14% / Global 32768 31904 3% 5 1% /home Global 2490368 1857944 26% 13218 4% /opt Global - - - - - /proc Global 98304 96688 2% 9 1% /tmp Global 5734400 1507368 74% 62691 16% /usr Global 131072 110096 17% 364 2% /var |
对于没有配置 TCP/IP 的 WPAR,您可使用控制台登录 (clogin) 访问并设置 WPAR,但是由于没有网络栈,所以无法使用 CICS TG。
在共享的 WPAR 中,您必须在全局环境中安装 CICS TG,因为 WPAR 只能对 /opt 进行只读访问,而 CICS TG 安装在 /opt 中。请运行产品安装程序:
aix7host # ./installer -i console Preparing to install... Extracting the JRE from the installer archive... Unpacking the JRE... Extracting the installation resources from the installer archive... Configuring the installer for this system's environment... Launching installer... |
接受所有默认值。在全局环境中,应该可成功安装 CICS TG。要确认在全局环境和 WPAR 中均可访问该产品,请执行以下命令:
aix7host # type cicscli cicscli is /usr/bin/cicscli ctgwpar1 # type cicscli cicscli is /usr/bin/cicscli |
默认情况下,在共享的系统 WPAR 安装中,配置文件在所有共享 WPAR 之间是共享的,因为该配置文件位于 /opt/IBM/cicstg/bin 目录中。共享一个配置对于到 CICS 的 TCP/IP 连接效果很好。但是对于 SNA 和 IPIC(需要独特的值来识别 Gateway 实例),共享是受限制的,只有使用该配置连接到 CICS 的首个 Gateway 能建立连接。其他连接都被拒绝。
计划使用 ctgd 将 CICS TG 作为初始任务运行时,能够克服这种共享限制,方法是在每个系统 WPAR 中设置 CTGDCONF 环境变量,让其指向本地 ctgd.conf,该 ctgd.conf 将 CICSCLI 环境变量设置为 WPAR 中的 ctg.ini 文件,该文件中包含了 CICS TG 实例的惟一标识符。ctgd 进程在使用默认值之前会检查该环境变量是否存在。如果没有使用 ctgd,而是使用 ctgstart 或 cicscli,那么您必须设置 CICSCLI 环境变量,让它直接指向 ctg.ini 本地文件。在这个例子中,我们使用 ctgd 启动 CICS TG:
首先,在全局环境中复制两个配置文件,并将文件副本保存在 WPAR 中,这样可以修改这些文件副本:
aix7host # cp ctgd.conf ctg.ini /wpars/ctgwpar1/tmp |
转到 WPAR,并修改 ctgd.conf 文件,以便让 CICSCLI 变量指向本地 local ctg.ini 文件:
#----------------------------------------------------------------------- # Location of ctg.ini file. Set this to specify a location for ctg.ini, # other than the default <install_path>/bin/ctg.ini. #CICSCLI=<install_path>/bin/ctg.ini CICSCLI=/tmp/ctg.ini |
接下来更新 ctg.ini 文件,更改 Gateway 的 APPLID 和 SNA 本地 LU 名称,使这些名称都是惟一的,并且不同于全局环境中的名称:
SECTION PRODUCT
APPLID=CTGWPAR1
APPLIDQUALIFIER=CHRSQUAL
DEFAULTSERVER=TX20
ENDSECTION
SECTION SERVER = TS20
SRVIDLETIMEOUT=0
PROTOCOL=SNA
UPPERCASESECURITY=N
LOCALLUNAME=CTGCM01
MODENAME=LU62PS
NETNAME=GBIBMIYA.IY2GTG20
PARTNERLUALIAS=N
ENDSECTION
|
最后在 WPAR 中设置 CTGDCONF 环境变量,这样共享的 ctgd 副本可以找到本地配置:
ctgwpar1 # export CTGDCONF=/tmp/ctgd.conf |
如果在 WPAR 和全局环境中启动 CICS TG,SNA 和 IPIC 应该都能正常运行:
aix7host # ctgd start CICS Transaction Gateway, Version 8.0.0.1 : Build Level c800-20101014 (C) Copyright IBM Corporation 2004, 2010. All rights reserved. Starting IBM CICS Transaction Gateway: started as root:system ctgwpar1 # ctgd start CICS Transaction Gateway, Version 8.0.0.1 : Build Level c800-20101014 (C) Copyright IBM Corporation 2004, 2010. All rights reserved. Starting IBM CICS Transaction Gateway: started as root:system |
检查日志,确保正在使用正确的 ctg.ini,并且 Gateway APPLID 是正确且惟一的:
在全局环境中:
06/23/11 18:12:47:206 [2] *** IBM CICS Transaction Gateway log V8.0.0.1 Build Level c800-20101014 *** 06/23/11 18:12:47:103 [0] CTG6400I CICS Transaction Gateway is starting 06/23/11 18:12:47:189 [0] CTG8448I Command line options updated adminport to be2810 06/23/11 18:12:47:221 [0] CTG8400I Using configuration file /opt/IBM/cicstg/bin/ctg.ini 06/23/11 18:12:47:221 [0] CTG8426I The applid is CTGGE 06/23/11 18:12:47:221 [0] CTG8427I The applid qualifier is CHRSQUAL |
在 ctgwpar1 上:
06/23/11 18:14:51:022 [2] *** IBM CICS Transaction Gateway log V8.0.0.1 Build Level c800-20101014 *** 06/23/11 18:14:50:785 [0] CTG6400I CICS Transaction Gateway is starting 06/23/11 18:14:51:000 [0] CTG8448I Command line options updated adminport to be 2810 06/23/11 18:14:51:025 [0] CTG8400I Using configuration file /tmp/ctg.ini 06/23/11 18:14:51:025 [0] CTG8426I The applid is CTGWPAR1 06/23/11 18:14:51:026 [0] CTG8427I The applid qualifier is CHRSQUAL |
现在 Gateway 守护进程都已正确启动,您可运行一个示例来确认到 CICS 的 IPIC 连接正在工作。执行以下命令:
aix7host # cat run_me.sh
#!/bin/ksh
/opt/IBM/cicstg/jvm16/bin/java -cp
/opt/IBM/cicstg/classes/ctgserver.jar:/opt/IBM/cicstg/classes/ctgsamples.jar:
/opt/IBM/cicstg/classes/ctgclient.jar com.ibm.ctg.samples.eci.EciB1 tcp://aix7host 2006
aix7host # ./run_me.sh
CICS Transaction Gateway Basic ECI Sample 1
Usage: java com.ibm.ctg.samples.eci.EciB1 [Gateway URL]
[Gateway Port Number]
[SSL Keyring]
[SSL Password]
To enable client tracing, run the sample with the following Java option:
-Dgateway.T.trace=on
The address of the Gateway has been set to tcp://aix7host Port:2006
CICS Servers Defined:
1. TS20IPIC – CICS TS IPIC server
2. TX20 – TXSeries TCP server
3. TS20 – CICS TS SNA server
Choose Server to connect to, or q to quit:
1
Program EC01 returned with data:-
Hex: 32332f30362f31312031393a31323a35380
ASCII text: 23/06/11 19:12:58
ctgwpar1 # ./run_me.sh
CICS Transaction Gateway Basic ECI Sample 1
Usage: java com.ibm.ctg.samples.eci.EciB1 [Gateway URL]
[Gateway Port Number]
[SSL Keyring]
[SSL Password]
To enable client tracing, run the sample with the following Java option:
-Dgateway.T.trace=on
The address of the Gateway has been set to tcp://ctgwpar1 Port:2006
CICS Servers Defined:
1. TS20IPIC – CICS TS IPIC server
2. TX20 – TXSeries TCP server
3. TS20 – CICS TS SNA server
Choose Server to connect to, or q to quit:
1
Program EC01 returned with data:-
Hex: 32332f30362f31312031393a31323a35390
ASCII text: 23/06/11 19:12:59
|
现在可通过 SNA 测试 CICS 连接。为了让 SNA 守护进程正确启动,必须在 WPAR 中复制 /etc/sna/sna_clnt.net 文件。
aix7host # ./ecib1 CICS Transaction Gateway Basic ECI V1 Sample Servers defined in the Client daemon: 1.TX20 2.TS20 Choose server to connect to: 2 Program EC01 returned with data: 24/06/11 10:42:10 ctgwpar1 # ./ecib1 CICS Transaction Gateway Basic ECI V1 Sample Servers defined in the Client daemon: 1.TX20 2.TS20 Choose server to connect to: 2 Program EC01 returned with data: 24/06/11 10:47:57 |
查看客户端信息日志,确认两个程序分别在其各自的本地 LU(CTGCM01 和 CTGCM02)下运行:
aix7host # cat /var/cicscli/cicscli_info.log 06/24/11 10:36:15.491 [0049] CCL:CCL0200I *** IBM CICS Transaction Gateway Client log for 'AIX' '8.0.0.1' Build Level 'c800-20101014' *** 06/24/11 10:36:15.508 [2239] CCL:CCL2239I Server 'TX20' is configured to use the TCP/IP protocol with NETNAME 'cicsserv.ibm.com' and PORT '7720' 06/24/11 10:36:15.513 [2238] CCL:CCL2238I Server 'TS20' is configured to use the SNA protocol with NETNAME 'GBIBMIYA.IY2GTG20' and LOCALLUNAME 'CTGCM02' 06/24/11 10:36:15.520 [2224] CCL:CCL2218I The initialization of the Client daemon is complete 06/24/11 10:42:10.296 [2228] CCL:CCL2222I About to connect to server 'TS20' 06/24/11 10:42:10.493 [2229] CCL:CCL2223I Connected to server 'TS20 ' using 'SNA' to 'GBIBMIYA.IY2GTG20' 06/24/11 10:47:33.798 [0049] CCL:CCL0200I *** IBM CICS Transaction Gateway Client log for 'AIX' '8.0.0.1' Build Level 'c800-20101014' *** 06/24/11 10:47:33.807 [2239] CCL:CCL2239I Server 'TX20' is configured to use the TCP/IP protocol with NETNAME 'cicsserv.ibm.com' and PORT '7720' 06/24/11 10:47:33.811 [2238] CCL:CCL2238I Server 'TS20' is configured to use the SNA protocol with NETNAME 'GBIBMIYA.IY2GTG20' and LOCALLUNAME 'CTGCM01' 06/24/11 10:47:33.819 [2224] CCL:CCL2218I The initialization of the Client daemon is complete 06/24/11 10:47:54.605 [2228] CCL:CCL2222I About to connect to server 'TS20' 06/24/11 10:47:57.176 [2229] CCL:CCL2223I Connected to server 'TS20 ' using 'SNA' to 'GBIBMIYA.IY2GTG20' |
对于共享的系统 WPAR 拓扑,其主要优势在于包括 CICS TG、SNA 远程 API 客户端和 C/C++ 编译器在内的系统软件只需在全局环境中安装一次,然后所有共享的系统 WPAR 都可使用这些软件了,无需安装任何额外的内容。因此与非共享的 WPAR 相比,共享的系统 WPAR 所占用的空间相对较小。
在共享的系统 WPAR 场景中(例如通过 TCP/IP 与 CICS 通信),所有 CICS TG 实例的配置可以是公共的。如果必须惟一地标识 Gateway 守护进程(例如使用 IPIC 或 SNA 协议与 CICS 进行通信),那么每个 WPAR 必须有自己的本地配置,并且该配置必须与全局环境分开管理。共享的系统 WPAR 还让您可以更高效地利用 LPAR,并且可以在全局环境中创建工作负载管理器,从而在多个 WPAR 之间分配负载。
分离的系统 WPAR 看似一个完全独立的 AIX 安装,具有自己的隔离文件系统和网络栈。使用分离的系统 WPAR 运行 CICS TG 的例子如下所示。图 4 显示了在全局环境中安装的 CICS TG 以及三个分离的系统 WPAR。与前面小节中共享的系统 WPAR 不同,这些安装是隔离的,程序和配置文件也是单独安装的:
图 4. 部署分离的系统 WPAR

为私有安装 (private install) 设置分离的系统 WPAR
设置分离的系统 WPAR 的第一步是创建该 WPAR。在这个例子中,您要指定:
- WPAR 名称是
ctgwpar4。 - 安装是私有的(与全局环境分离)。
- 主机名是
ctgwpar4。 - 网络路由信息继承自全局环境。
- 设置网络使用
en0与给定的 IP 地址。
aix6host # mkwpar -n ctgwpar4 -l -h ctgwpar4 -r -N interface=en0 address=192.168.1.2 netmask=255.255.255.0 |
对于共享的系统 WPAR 部分,WPAR 名称和主机名不必相同,但测试表明 SNA 远程 API 客户端会查找 WPAR 名称,而不是主机名。如果二者的名称不同,WPAR 名称可能无法解析为有效的 IP 地址。
设置 WPAR 的过程需要点时间,因为要在 WPAR 内创建 AIX 环境的一个副本。该过程完成后即可启动 WPAR:
aix6host # startwpar -v ctgwpar4 Starting workload partition 'ctgwpar4'. Mounting all workload partition file systems. Mounting '/wpars/ctgwpar4'. Mounting '/wpars/ctgwpar4/home'. Mounting '/wpars/ctgwpar4/opt'. Mounting '/wpars/ctgwpar4/proc'. Mounting '/wpars/ctgwpar4/tmp'. Mounting '/wpars/ctgwpar4/usr'. Mounting '/wpars/ctgwpar4/var'. Loading workload partition. Exporting workload partition devices. Starting workload partition subsystem 'cor_ctgwpar4'. 0513-059 The cor_ctgwpar4 Subsystem has been started. Subsystem PID is 11206788. Verifying workload partition startup. Return Status = SUCCESS. aix6host # lswpar Name State Type Hostname Directory RootVG WPAR ---------------------------------------------------------------- ctgwpar4 A S ctgwpar4 /wpars/ctgwpar4 no |
从 LPAR 中检查已挂载的文件系统对于该分离的 WPAR 安装是正确的。所创建的 WPAR 下的所有文件系统都被挂载到 /dev 上,这一点与共享的系统 WPAR 不同,后者的挂载点(如 /wpars/CTG_WPAR1/opt)使用文件 systems/opt(只读模式)。
aix6host # df -k Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/hd4 327680 133972 60% 10820 25% / /dev/hd2 7602176 4960396 35% 55415 5% /usr /dev/hd9var 720896 373892 49% 12479 13% /var /dev/hd3 2293760 2159324 6% 167 1% /tmp /dev/hd1 65536 65144 1% 15 1% /home /dev/hd11admin 131072 130692 1% 5 1% /admin /proc - - - - - /proc /dev/hd10opt 2555904 2045364 20% 12617 3% /opt /dev/livedump 262144 261776 1% 4 1% /var/adm/ras/livedump /dev/fslv00 131072 82264 38% 2977 14% /wpars/ctgwpar4 /dev/fslv01 65536 64156 3% 5 1% /wpars/ctgwpar4/home /dev/fslv02 2555904 2035252 21% 12614 3% /wpars/ctgwpar4/opt /proc - - - - - /wpars/ctgwpar4/proc /dev/fslv03 131072 128420 3% 10 1% /wpars/ctgwpar4/tmp /dev/fslv10 7602176 4874528 36% 53437 5% /wpars/ctgwpar4/usr /dev/fslv11 131072 53320 60% 2755 19% /wpars/ctgwpar4/var |
与共享的 WPAR 一样,分离的系统 WPAR 有其自己的 IP 地址,因此用户使用 rlogin 和 TCP/IP 主机名可远程登录该 WPAR。分离的系统 WPAR 在用户看来就像普通的 AIX 系统;每个文件系统看似都是全局的,而 WPAR 外部的任何内容都看不到。
aix6host # rlogin ctgwpar4 ******************************************************************************* * Welcome to AIX Version 6.1! * * * * Please see the README file in /usr/lpp/bos for information pertinent to * * this release of the AIX Operating System. * ******************************************************************************* Last login: Thu 26 May 15:14:20 2011 on /dev/pts/0 from 192.168.1.3 ctgwpar4 # df -k Filesystem 1024-blocks Free %Used Iused %Iused Mounted on Global 131072 82216 38% 2991 14% / Global 65536 64156 3% 5 1% /home Global 2555904 2035660 21% 12614 3% /opt Global - - - - - /proc Global 131072 128420 3% 12 1% /tmp Global 7602176 4936516 36% 55414 5% /usr Global 131072 49436 63% 2818 20% /var |
如果没有为 WPAR 配置 TCP/IP,您可使用 clogin (console login) 访问并配置该 WPAR,由于没有 TCP/IP 栈,所以无法使用 CICS TG。
使用分离的系统 WPAR 的缺点在于:创建 WPAR 时会使用默认的分区大小,而为了提供足够的空间安装软件栈,可能需要增加分区的大小。在本例中,/tmp 目录空间太小,无法存储 CTG 安装程序的副本,所以我们在全局环境中增加其大小:
aix6host # chfs -a size=+1G /wpars/CTG_WPAR1/tmp Filesystem size changed to 2359296 Inlinelog size changed to 8 MB. aix6host # cp installer /wpars/CTG_WPAR1/tmp |
运行产品安装程序:
ctgwpar4 # ./installer -i console Preparing to install... Extracting the JRE from the installer archive... Unpacking the JRE... Extracting the installation resources from the installer archive... Configuring the installer for this system's environment... Launching installer... |
接受所有默认值。CICS TG 应该能成功安装到 WPAR 中。要想验证安装情况,可对比全局环境中的 /opt/IBM 与 WPAR 中的 /opt/IBM:
aix6host # ls -l /opt/IBM total 16 drwxr-xr-x 28 root system 4096 24 May 17:38 ITM drwxr-xr-x 2 root system 4096 24 May 16:40 sysmgtlib ctgwpar4 # ls -l /opt/IBM total 24 drwxrwxr-x 17 root system 4096 26 May 15:46 cicstg drwxr-xr-x 28 root system 4096 24 May 17:38 ITM drwxr-xr-x 2 root system 4096 24 May 16:40 sysmgtlib |
有两种方式安装那些使用本机 AIX 安装程序的应用程序:
- 多个时间(每个系统 WPAR 一个时间)
- 在全局环境中使用单一时间,然后将所有文件的同步副本设置到每个系统 WPAR 中。
SNA 远程 API 客户端和 xlC/C++ 编译器都使用本机 AIX 安装程序。对于本例,我们将使用单一时间方法安装这些软件,这样做的好处在于尽管在单一时间安装这些软件,但每个软件实例都在其自己的 WPAR 中独立运行。
Smit 在安装时提供了选项,允许您在所有分离的 WPAR 中安装软件。如果将该选项设为 no,可在以后运行以下命令,手动同步 WPAR:
aix6host # syncroot syncroot: Processing root part installation status. syncroot: Installp root packages are currently synchronized. syncroot: RPM root packages are currently synchronized. syncroot: Root part is currently synchronized. syncroot: Returns Status = SUCCESS |
每个系统 WPAR 现在都作为一个隔离的 SNA 客户端运行并且可使用 C/C++ 编译器。
您可使用配置工具配置 Gateway。此配置对于该 WPAR 而言是本地的,所以您必须确保 APPLID 和 SNA 本地 LU 是惟一的。
如果未引用 JVM,则更新 Java 的 PATH:
ctgwpar4 # export PATH=/opt/IBM/cicstg/jvm16/bin:$PATH |
配置 Gateway 守护进程,使其具有 TCP/IP、SNA 和 IPIC 服务器定义,并确保将日志写入到文件中,而不是控制台。还必须启用 Gateway TCP 和统计端口处理程序。现在将 ini 文件保存到 WPAR 中的 /opt/IBM/cicstg/bin 中。在本例中,使用 ctgstart 启动 Gateway 守护进程。现在您应该验证 Gateway 可正确启动并在正确的端口上进行侦听:
ctgwpar4 # ctgstart *** IBM CICS Transaction Gateway log V8.0.0.1 Build Level c800-20101014 *** (C) Copyright IBM Corporation 1996, 2010. All rights reserved. CTG6508I To shut down the Gateway daemon type CTG6493I Q or - for normal shutdown CTG6494I I for immediate shutdown ctgwpar4 # more /var/cicscli/ctg_info.log 05/27/11 11:19:40:670 [2] *** IBM CICS Transaction Gateway log V8.0.0.1 Build Level c800-20101014 *** 05/27/11 11:19:40:626 [0] CTG6400I CICS Transaction Gateway is starting 05/27/11 11:19:40:661 [0] CTG8448I Command line options updated adminport to be 2810 05/27/11 11:19:40:673 [0] CTG8400I Using configuration file /opt/IBM/cicstg/bin/ctg.ini 05/27/11 11:19:40:673 [0] CTG8461I Successfully initialized trace plug-in 'com.ibm.ctg.client.FileTrace' 05/27/11 11:19:40:676 [0] CTG6577I Java details: Version=1.6.0, Vendor=IBM Corporation, Path=/opt/IBM/cicstg/jvm16/bin/java 05/27/11 11:19:40:710 [0] CTG6981I Successfully initialized JNI library 05/27/11 11:19:40:758 [0] CTG6502I Initial Connection managers = 1, Maximum Connection managers = 100 05/27/11 11:19:40:759 [0] CTG6526I Initial workers = 1, Maximum workers = 100 05/27/11 11:19:40:763 [0] CTG6505I Successfully created the initial connection manager and Worker threads 05/27/11 11:19:40:771 [0] CTG6524I Successfully started handler for the tcp: protocol on port 2006 05/27/11 11:19:40:774 [0] CTG6524I Successfully started handler for the statsapi: protocol on port 2980 05/27/11 11:19:40:775 [0] CTG8455I Successfully started the local administration handler on port 2810 05/27/11 11:19:40:788 [0] CTG6512I CICS Transaction Gateway initialization complete 05/27/11 11:19:40:800 [0] CTG6411I Interval statistics are active. The statistics interval length is set to 3 hours, 0 minutes and 0 seconds. The statistics end of day time is set to 00:00:00 Greenwich Mean Time. |
现在您可以通过引用该 Gateway 的 IPIC 连接发送一个示例请求:
ctgwpar4 # ./ctgecib3 ctwpar4 2006
CICS Transaction Gateway Basic ECI V2 Sample 3
Usage: ctgecib3 [hostname] [port number]
Connected to CICS TG on ctgwpar4 using port 2006
Servers returned from CICS TG:
1. TS20IPIC – CICS TS IPIC server
2. TX20 – TXSeries TCP server
3. TS20 – CICS TS SNA server
Choose server to connect to, or q to quit:
1
Enter text to send to the CICS program (max 128):
HELP ME!
Program EC03 returned containers:
[BIT] INPUTDATALENGTH = 00000007
[CHAR] INPUTDATACCSID = 819
[CHAR] OUTPUTMESSAGE = Input data was: HELP ME
[CHAR] CICSDATETIME = 27/05/2011 14:43:23
[CHAR] INPUTDATA = HELP ME
Closed connection to CICS Transaction Gateway
ctgecib3 completed successfully
|
验证 SNA 在 WPAR 中可正常工作,方法是编译并运行 ecia1 示例,它可测试 TCP/IP 和 SNA 等连接:
ctgwpar4 # export PATH=/usr/vac/bin:$PATH
ctgwpar4 # make -f samp.mak
Creating Advanced ECI C Sample
cc_r -c -g -DCICS_AIX -I../../../include -I../../include ecia1.c
cc_r -o ecia1 ecia1.o -L../../../lib -L/opt/IBM/cicstg/lib -lpthreads -lc_r
-lcclaix
ctgwpar4 # ./ecia1
CICS Transaction Gateway Advanced ECI V1 Sample
SYNTAX :
ecia1 <Threads> <Calls> <SYNC|ASYNC> [-DEBUG]
where
Threads = Number of threads to run per server (Default=5)
Calls = Number of ECI calls to make per thread (Default=10)
SYNC/ASYNC = Do (a)synchronous eci calls (Default=SYNC)
-DEBUG = Show all messages (Default is off)
Running with:
2 Servers
5 Threads per server
10 ECI calls per thread
Call type is synchronous
MAIN : Threads all started - Starting test
MAIN : Threads all finished - Results follow:
Server : TX20 , overall average time in seconds 0.020060
Server : TS20 , overall average time in seconds 0.023860
Press enter to terminate
|
分离的系统 WPAR 可提供 LPAR 的优势,但占用的处理器时间和内存较少,这样就可以进一步将 LPAR 划分为多个子管理资源,同时仍在同一 LPAR 内运行多个 Gateway。更高的 LPAR 利用率允许您在全局环境中创建工作负载管理器,并在多个 WPAR 之间分布负载。
本节探讨几个可使用 WPAR 的场景。
在该场景中,CICS TG 已安装并已配置,在 LPAR 中运行。通过 TCP/IP 连接到 CICS。此处使用共享的系统 WPAR,您可运行多个 CICS TG 配置实例,每个配置都有自己的网络栈。该场景更好地利用了 LPAR 资源,同时单个产品安装和单个配置让维护开销也降低了。
在该场景中有多个机器或 LPAR,每个 LPAR 中托管着不同版本的 CICS TG。这种拓扑很可能使用大量的机器资源或 LPAR 资源。一种更为高效的解决方案是将硬件整合到单个 LPAR 中,让每个软件实例都作为一个分离的系统 WPAR 运行。
该场景与上一个类似。使用分离的系统 WPAR 与现有的应用程序在当前操作环境中测试 CICS TG 的新版本。这对现有的安装和配置没有任何影响。
在同一 LPAR 中运行多个长时间的应用程序时,您可在每个应用程序自己的 WPAR 中运行该程序。这样可以将每个应用程序与系统的其他部分隔离,所以如果某个应用程序出现故障,则故障仅限于该 WPAR 内,不会影响其他应用程序。
本文介绍了两类 WPAR:应用程序 WPAR 和系统 WPAR,并展示了 CICS TG 如何与这些 WPAR 互操作。本文还介绍了部署 WPAR 与 CICS TG 可实现显著优势的各种客户场景。
学习
- AIX 资源
- AIX V6.1 信息中心
该 Web 门户网站提供了所有 AIX V6.1 文档。 - AIX V7.1 信息中心
该 Web 门户网站提供了所有 AIX V7.1 文档。 - Introduction to workload partition management in AIX V6.1
该 IBM 红皮书介绍了 AIX V6.1 WPAR 操作系统虚拟化功能。 - Workload partition management in AIX V6.1
该 IBM 红皮书提供更为深入的 WPAR 信息。 - developerWorks AIX 和 UNIX 专区
针对 AIX 和 UNIX 开发人员与系统管理员的大量技术资源。
- AIX V6.1 信息中心
- CICS 资源
- CICS Transaction Gateway 信息中心
该信息中心介绍了各种平台上的 CICS Transaction Gateway V6、V7 和 V8。 - CICS Transaction Server for z/OS 信息中心
该信息中心介绍了 CICS Transaction Server V3 和 V4 for z/OS。 - CICS 产品页
产品说明、产品新闻、培训信息、支持信息等。 - CICS 服务
IBM 提供了全面的服务来帮助您在公司内计划、设计、升级、保护、管理和实现 CICS 解决方案。IBM CICS 服务可帮助您降低成本,最大限度发挥在 CICS 方面的投资,提高您的竞争优势。 - IBM Redbook: Developing connector applications for CICS
了解如何开发可使用 CICS Transaction Gateway 连接到 CICS 的客户端应用程序。
- CICS Transaction Gateway 信息中心
- WebSphere 资源
- developerWorks WebSphere 开发人员资源
面向使用 WebSphere 产品的开发人员的技术信息和资源。developerWorks WebSphere 提供产品下载、how-to 信息、支持资源以及一个免费技术库,该技术库包含 2000 多篇技术文章、教程、最佳实践、IBM 红皮书和在线手册。 - developerWorks WebSphere 应用程序集成开发人员资源
帮助您构建 WebSphere 应用程序集成和业务集成解决方案的 how-to 文章、下载、教程、培训、产品信息等资源。 - developerWorks WebSphere 业务流程管理开发人员参考资料
WebSphere BPM how-to 文章、下载、教程、培训、产品信息和其他参考资料,帮助您建模、制定、部署和管理业务流程。 - 最流行的 WebSphere 试用版下载
免费下载关键 WebSphere 产品试用版。 - WebSphere 论坛
针对特定产品的论坛,在那里获取您的技术问题的解答,并与其他 WebSphere 用户分享您的专业知识。 - WebSphere on-demand 演示
下载并观看 WebSphere on-demand 演示,了解 WebSphere 产品和技术如何帮助您的企业应对快速变化和日益复杂的商业环境。 - developerWorks WebSphere 每周时事通讯
developerWorks 新闻简讯提供了您感兴趣的主题的最新文章和信息。除 WebSphere 以外,还可以选择 Java、Linux、Open source、Rational、SOA、Web 服务和其他主题。立即订阅并设计您的定制邮件。 - IBM Press 的 WebSphere 相关图书
通过 Barnes & Noble 实现便捷的在线订购。 - 与 WebSphere 有关的活动
世界各地针对 WebSphere 开发人员的会议、商贸展览、网络广播和其他活动。
- developerWorks WebSphere 开发人员资源
- developerWorks 资源
- IBM 软件产品试用版下载
免费下载 IBM® DB2®、Lotus®、Rational®、Tivoli® 和 WebSphere® 产品的试用版。 - developerWorks 博客
加入 developerWorks 用户和作者、IBM 编辑和开发人员的谈话。 - developerWorks 云计算专区
访问 IBM 或 Amazon EC2 云计算,在沙箱中测试 IBM 云计算产品,查看云计算产品和服务演示,阅读各种云计算文章,以及访问其他云计算资源。 - developerWorks 技术加油站
由 IBM 专家主持的免费技术活动可以帮助您加快学习进度,从最困难的软件项目中取得成功。这些在世界各地举行的活动包括一小时的虚拟简报、半天到全天的真实活动等。 - developerWorks 播客
收听新颖有趣的软件创新者访谈和讨论。 - developerWorks on Twitter
查看最近的 Twitter 消息和 URL。 - IBM Education Assistant
多媒体教育模块集合,帮助您更好地理解 IBM 软件产品,更高效地使用它们来满足您的业务需求。
- IBM 软件产品试用版下载
讨论
- 加入 developerWorks 中文社区,developerWorks 社区是一个面向全球 IT 专业人员,可以提供博客、书签、wiki、群组、联系、共享和协作等社区功能的专业社交网络社区。
- 加入 IBM 软件下载与技术交流群组,参与在线交流。

Chris Mawer 是英国 Hursley IBM Software Lab 的 CICS Transaction Gateway 团队高级测试人员。他负责领导 ECI V2 和 Microsoft .NET 测试团队。Chris Mawer 毕业于曼彻斯特大学,于 2001 年加入 IBM,成为 ICS Transaction Gateway Level 3 支持团队中的一员,在此他全面了解了 CICS Transaction Gateway 及其客户。2008 年,他转到 CICS Transaction Gateway 测试团队,并在测试和测试策略方面扮演着重要角色。最近,他还参与了客户场景和性能测试工作。