TUXEDO教程PPT格式课件下载.ppt
《TUXEDO教程PPT格式课件下载.ppt》由会员分享,可在线阅读,更多相关《TUXEDO教程PPT格式课件下载.ppt(129页珍藏版)》请在冰豆网上搜索。
功能包括全局事务协调、事务的分布式两段提交、故障恢复、高可靠性、网络负载平衡等等,3.Tuxedo的执行过程,4.Tuxedo的安装,4.1.双击tuxedo80_win:
接受协议,系统会出现如下界面:
4.Tuxedo的安装(续),选择安装目录,4.Tuxedo的安装(续),在安装的过程中,系统会出现CreatTlistenPassword的界面,要求客户输入客户端监听的口令(此口令用于客户端与不同的Server进行连接的),输入:
tuxedo,界面如下:
4.Tuxedo的安装(续),接着会出现如下界面,询问是否安装:
SSLSUPORT,选择不安装,然后界面如下,安装完成,5.配置环境变量(Win32),增加两条系统变量WSNADDR=/10.1.2.212:
8888TUXDIR=d:
programbeatuxedo8.0*注意:
其中的目录应该与你TUXEDO的安装目录一致修改PATH在PATH中增加:
d:
programbeatuxedo8.0bin;
其中的目录应该与你TUXEDO的安装目录一致,5.配置环境变量(Linux),在TUXEDO用户的.bash_profile中设置GCC_EXEC_PREFIX=/usr/i386-glibc21-linux/lib/gcc_lib/。
将TUXEDO安装目录下tux.env里的设置复制到TUXEDO用户的/home/tuxedo/.bash_profile文件中。
将以下设置复制到.bash_profile中:
WSNADDR=0x000222220a010064(其中后8位是服务器IP地址的16进制写法,此处为10.1.0.100)WSDEVICE=/dev/inet/tcpWSINTOPPRE71=yes(在高版本的客户端联低版本的服务器时须加此参数)(注1)WSTYPE=586(通常这些设置也可以单独写在一个文件中(如.wsenv),然后在程序中动态调用)注1:
在低版本的客户端联高版本的服务器时,须在服务器UBB中的WSL中加入-t,如CLOPT=”-At-n/10.1.0.100:
8888”,6.Tuxedo的一个例子,功能:
介绍了BEATuxedo的一个简单例子,用C语言编写的simpapp,它包含了一个客户程序和一个服务器,服务器只执行一个服务:
从客户程序接收小写字母,将其转换成大写后,返回给客户程序。
在使用这个例子之前,需要在系统中安装C语言编译器。
步骤:
1.复制simpapp所需要的所有文件,它们位于$TUXDIR/samples/atmi/simpapp目录下;
2.检查并编译客户程序;
3.检查并编译服务程序;
4.编辑并加载配置文件;
5.启动应用程序;
6.执行运行时应用程序;
7.监视运行时应用程序;
8.关闭应用程序。
6.Tuxedo的一个例子(续),复制simpapp例子的相关文件simpcl.c,simpserv.c,ubbsimple,setenv.cmd,6.Tuxedo的一个例子(续),设置环境变量setenv.cmdsetTUXDIR=c:
beatuxedo8.1setWSNADDR=/10.13.8.233:
8888setAPPDIR=d:
tuxtrainingsimpappsetPATH=%TUXDIR%bin;
%APPDIR%;
%PATH%setTUXCONFIG=%APPDIR%tuxconfigd:
msdevvstudiovc98binvcvars32.bat,6.Tuxedo的一个例子(续),客户端程序simpcl.c#include#includeatmi.h/*TUXEDOHeaderFile*/#ifdefined(_STDC_)|defined(_cplusplus)main(intargc,char*argv)#elsemain(argc,argv)intargc;
char*argv;
#endifchar*sendbuf,*rcvbuf;
longsendlen,rcvlen;
intret;
6.Tuxedo的一个例子(续),if(argc!
=2)(void)fprintf(stderr,Usage:
simpclstringn);
exit
(1);
/*AttachtoSystem/TasaClientProcess*/if(tpinit(TPINIT*)NULL)=-1)(void)fprintf(stderr,Tpinitfailedn);
sendlen=strlen(argv1);
/*AllocateSTRINGbuffersfortherequestandthereply*/if(sendbuf=(char*)tpalloc(STRING,NULL,sendlen+1)=NULL)(void)fprintf(stderr,Errorallocatingsendbuffern);
tpterm();
if(rcvbuf=(char*)tpalloc(STRING,NULL,sendlen+1)=NULL)(void)fprintf(stderr,Errorallocatingreceivebuffern);
tpfree(sendbuf);
6.Tuxedo的一个例子(续),(void)strcpy(sendbuf,argv1);
/*RequesttheserviceTOUPPER,waitingforareply*/ret=tpcall(TOUPPER,(char*)sendbuf,0,(char*),6.Tuxedo的一个例子(续),6.Tuxedo的一个例子(续),编译客户端程序d:
tuxtrainingsimpappbuildclient-osimpcl-fsimpcl.c-w-o指明输出目标文件名,-f指出源文件名-w指编译时不考虑服务器的影响,6.Tuxedo的一个例子(续),服务器端程序simpserv.c#include#include#include/*TUXEDOHeaderFile*/#include/*TUXEDOHeaderFile*/*tpsvrinitisexecutedwhenaserverisbooted,beforeitbeginsprocessingrequests.Itisnotnecessarytohavethisfunction.Alsoavailableistpsvrdone(notusedinthisexample),whichiscalledatservershutdowntime.*/#ifdefined(_STDC_)|defined(_cplusplus)tpsvrinit(intargc,char*argv)#elsetpsvrinit(argc,argv)intargc;
#endif/*Somecompilerswarnifargcandargvarentused.*/argc=argc;
argv=argv;
/*userlogwritestothecentralTUXEDOmessagelog*/userlog(Welcometothesimpleserver);
return(0);
6.Tuxedo的一个例子(续),#ifdef_cplusplusexternC#endifvoid#ifdefined(_STDC_)|defined(_cplusplus)TOUPPER(TPSVCINFO*rqst)#elseTOUPPER(rqst)TPSVCINFO*rqst;
#endifinti;
for(i=0;
ilen-1;
i+)rqst-datai=toupper(rqst-datai);
/*Returnthetransformedbuffertotherequestor.*/tpreturn(TPSUCCESS,0,rqst-data,0L,0);
6.Tuxedo的一个例子(续),6.Tuxedo的一个例子(续),编译服务器D:
tuxtrainingsimpappbuildserverosimpservfsimpserv.csTOUPPERsTOUPPER指明了在服务器启动时需要提供的服务,6.Tuxedo的一个例子(续),配置文件ubbsimple#(c)2003BEASystems,Inc.AllRightsReserved.#ident(#)samples/atmi/simpapp/ubbsimple$Revision:
1.5$#SkeletonUBBCONFIGfilefortheTUXEDOSimpleApplication.#Replacetheitemswiththeappropriatevalues.*RESOURCESIPCKEY123456#Example:
#IPCKEY123456DOMAINIDsimpappMASTERsimpleMAXACCESSERS10MAXSERVERS5MAXSERVICES10MODELSHMLDBALN,6.Tuxedo的一个例子(续),*MACHINESDEFAULT:
APPDIR=d:
tuxtrainingsimpappTUXCONFIG=d:
tuxtrainingsimpapptuxconfigTUXDIR=c:
beatuxedo8.1#Example:
#APPDIR=/home/me/simpapp#TUXCONFIG=/home/me/simpapp/tuxconfig#TUXDIR=/usr/tuxedoJOHNLEELMID=simple#Example:
#beatuxLMID=simple*GROUPSGROUP1LMID=simpleGRPNO=1OPENINFO=NONE*SERVERSDEFAULT