一、 配置准备
新建bea用户uid 1002 gid 1003 软件tuxedo9.1 os:AS5 以控制台方式安装tuxedo9.1,如果license过期可以修改系统时间(仅用于学习和测试)
二、 配置阶段
1. 编辑ubbsimplev.txt
[root@mail simpapp]# vi ubbsimple.txt
# (c) 2003 BEA Systems, Inc. All Rights Reserved.
#ident "@(#) samples/atmi/simpapp/ubbsimple $Revision: 1.5 $"
*RESOURCES
IPCKEY 87654
DOMAINID simpapp
MASTER mail
MAXACCESSERS 40
MAXSERVERS 20
MAXSERVICES 40
UID 1002
GID 1003
MODEL MP
OPTIONS LAN
*MACHINES
mail LMID=mail
APPDIR="/home/BEA/simpapp"
TUXCONFIG="/home/BEA/simpapp/tuxconfig"
MAXWSCLIENTS=5
#TYPE="<Replace with the proper machine type for site1>"
TUXDIR="/home/BEA/tux"
UID=1002
GID=1003
*GROUPS
GROUP1
LMID=mail GRPNO=1 OPENINFO=NONE
*NETWORK
mail NADDR="//192.168.1.200:6033"
NLSADDR="//192.168.1.200:6034"
#BRIDGE="<Replace with the network device or omit if there is none>"
*SERVERS
DEFAULT:
CLOPT="-A"
simpserv SRVGRP=GROUP1 SRVID=3
WSL SRVGRP=GROUP1 SRVID=1 CLOPT="-A -t -- -n //192.168.1.200:6603 -m 2 -M "
*SERVICES
TOUPPER
2. 编译成二进制文件
tmloadcf -y ubbsimple.txt
3. 编辑tux.env
vi tux.env
TUXDIR=/home/BEA/tux; export TUXDIR
PATH=$TUXDIR/bin:$PATH; export PATH
COBCPY=:$TUXDIR/cobinclude; export COBCPY
COBOPT="-C ANS85 -C ALIGN=8 -C NOIBMCOMP -C TRUNC=ANSI -C OSEXT=cbl"; export COBOPT
SHLIB_PATH=$TUXDIR/lib:$SHLIB_PATH; export SHLIB_PATH
LIBPATH=$TUXDIR/lib:$LIBPATH; export LIBPATH
LD_LIBRARY_PATH=$TUXDIR/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
WEBJAVADIR=$TUXDIR/udataobj/webgui/java
LANG=C;export LANG
APPDIR=/home/BEA/simpapp; export APPDIR
TUXCONFIG=$APPDIR/tuxconfig; export TUXCONFIG
WSNADDR=//192.168.1.200:6033;export WSNADDR
4. 使环境变量生效并查看
[bea@mail simpapp]$ .空格./tux.env
5. 生成服务端
[bea@mail simpapp]$ buildserver -f simpserv.c -o simpserv -s TOUPPER
6. 生成本地客户端
buildclient -f simpcl.c -o client
7. 生成网络客户端
[bea@mail simpapp]$buildclient -w -o netclient -f simpclnet.c
8. 启动监听
[bea@mail simpapp]$tlisten -l //192.168.1.200:6034
9. 启动tuxedo服务
[bea@mail simpapp]$tmboot –y
Booting all admin and server processes in /home/BEA/simpapp/tuxconfig
INFO: BEA Tuxedo, Version 9.1, 32-bit, Patch Level (none)
INFO: Serial #: 454493271161-2617347438265, Expiration 2008-08-15, Maxusers 100
INFO: Licensed to: BEA Evaluation Customer
Booting admin processes ...
exec DBBL -A :
on mail -> process id=13596 ... Started.
exec BBL -A :
on mail -> process id=13597 ... Started.
Booting server processes ...
exec simpserv -A :
on mail -> process id=13599 ... Started.
exec WSL -A -t -- -n //192.168.1.200:6603 -m 2 -M :
on mail -> process id=13600 ... Started.
4 processes started.(网络服务端)
10. 关闭tuxedo服务
[bea@mail simpapp]$tmshutdown -y
三、 客户端访问
客户端安装完成之后,将服务器端的Tuxedo\bin下面的libtux.dll复制到客户端的Tuxedo\bin下面,运行时需要这个动态库(不知道为什么)
客户端也需要配置环境变量
TUXDIR=c:\bea\tuxedo8.1
path=...(其他path变量);%TUXDIR%\bin
在client程序中,需要加入
tuxputenv(“WSNADDR=//192.168.1.200:6603”);//访问Tuxedo服务器WSL服务的ip和端口
然后再执行tpinit等操作
编译已经写好的client程序,如
buildclient -w -o Client -f Client.cpp
这里需要注意的是必须加入-w这个编译项,否则无法init
然后就运行该client客户端程序,如果一切顺利,就可以使用Tuxedo服务了