tuxedo入门

为文件增加用户执行权限:

官网下载tuxedo111120_64_Linux_01_x86.bin

su //进入root操作,防止权限不够

创建文件夹,用来做tuxedo文件的安装路径

cd /opt

mkdir tuxedo 

然后将下载的文件拷贝到这个文件夹中,如果新建了用户的话则需要赋予新建用户对这个文件夹的所有权限,例如新建oracle用户之后授权:

cp /home/jacksile/下载/tuxedo111120_64_Linux_01_x86.bin /opt/tuxedo

ls -l //查看用户执行权限

如果没有则进行授权
chmod 755 tuxedo111120_32_Linux_01_x86.bin

在root用户下可以./tuxedo111130_64_Linux_01_x86.bin直接图形化安装,也可以使用字符界面模式进行安装
./tuxedo111130_64_Linux_01_x86.bin -i console 
执行安装文件,-i console 使其在字符界面安装

$ ./tuxedo111120_64_Linux_01_x86.bin -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...
strings: '/lib/libc.so.6': No such file

Launching installer...

Preparing CONSOLE Mode Installation...

===============================================================================
Choose Locale...
----------------

    1- English

CHOOSE LOCALE BY NUMBER: 1
===============================================================================
Tuxedo 11.1.1.2.0                 (created with InstallAnywhere by Macrovision)
-------------------------------------------------------------------------------




===============================================================================
Introduction
------------

InstallAnywhere will guide you through the Tuxedo 11.1.1.2.0 installation.



It is strongly recommended that you quit all programs before continuing with 
this installation.

Enter "next' to proceed to the next screen. Enter "back" to modify the previous
screen.

You may cancel this installation at any time by typing "quit".



WARNING: "Quitting" creates an incomplete  Tuxedo 11.1.1.2.0 installation.You 
must re-install  Tuxedo 11.1.1.2.0. For more information, see "Preparing to 
Install the Oracle Tuxedo System" in the  Tuxedo 11.1.1.2.0 Installation Guide.



PRESS <ENTER> TO CONTINUE: 



===============================================================================
Choose Install Set
------------------

Please choose the Install Set to be installed by this installer.

  ->1- Full Install
    2- Server Install
    3- Full Client Install
    4- Jolt Client Install
    5- ATMI Client Install
    6- CORBA Client Install

    7- Customize...

ENTER THE NUMBER FOR THE INSTALL SET, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
   : 1



===============================================================================
Choose Oracle Home
------------------


    1- Create new Oracle Home

Enter a number: 1
Specify a new Oracle Home directory: /opt/tuxedo



===============================================================================
Choose Product Directory
------------------------


    1- Modify Current Selection (/opt/tuxedo/tuxedo11gR1)
    2- Use Current Selection (/opt/tuxedo/tuxedo11gR1)

Enter a number: 2
Install Samples (Y/N): Y



===============================================================================
Pre-Installation Summary
------------------------

Please Review the Following Before Continuing:

Product Name:
    Tuxedo 11.1.1.2.0

Install Folder:
    /opt/tuxedo/tuxedo11gR1

Link Folder:
    /home/oracle

Disk Space Information (for Installation Target): 
    Required:  195,296,018 bytes
    Available: 205,917,069,312 bytes

PRESS <ENTER> TO CONTINUE: 



===============================================================================
Ready To Install
----------------

InstallAnywhere is now ready to install Tuxedo 11.1.1.2.0 onto your system at 
the following location:



   /opt/tuxedo/tuxedo11gR1

PRESS <ENTER> TO INSTALL: 



===============================================================================
Installing...
-------------

 [==================|==================|==================|==================]
 [------------------|------------------|------------------|------------------]



===============================================================================
Configure tlisten Service
-------------------------

Password:       
Verify Password:       
Password Accepted! Please wait...



===============================================================================
SSL Installation Choice.
------------------------

Would you like to install SSL Support?

  ->1- Yes
    2- No

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:
   : 2




===============================================================================
Installation Complete
---------------------

Congratulations. Tuxedo 11.1.1.2.0 has been successfully installed to:



   /opt/tuxedo/tuxedo11gR1

PRESS <ENTER> TO EXIT THE INSTALLER: 

安装完成确认:

进入安装目录,为tux.env文件添加执行权限
chmod 755 tux.env
. ./tux.env
env | grep UX
显示如下:
TUXDIR=/opt/tuxedo/tuxedo11gR1
查看版本信息
tmadmin -v

INFO: Oracle Tuxedo, Version 11.1.1.2.0, 64-bit, Patch Level (none)

跑例子:

进入tuxedo的安装目录,samples目录下自带了一些例子
cd /opt/tuxedo/tuxedo11gR1/samples/atmi
凡是了解tuxedo 的同学都知道这里面有个著名的例子 simpapp ,它的作用就是把客户端发送的小写字母转换成大写字母返回给客户端。我们就把这个例子运行起来。
前期准备:
cp -r simpapp/ /opt/tuxedo/ 为了便于操作,防止数据修改或丢失,把simpapp 拷贝到/opt/tuxedo/ 目录下面。

退到安装根目录,tuxedo11gR1,同上理,把tuxedo安装目录下的tux.env配置文件拷贝到/opt/tuxedo/simpapp/ 目录下
cp -r tux.env /opt/tuxedo/simpapp/ 

配置运行simpapp 例子
配置tux.env文件
vi tux.env 对配置文件进行修改,在最后面添加
APPDIR=/opt/tuxedo/simpapp; export APPDIR
TUXCONFIG=$APPDIR/tuxconfig; export TUXCONFIG
LANG=C; export LANG

命令  hostname //查看本机hostname

vi ubbsimple ,配置ubbsimple文件,这是我照着我的例子所修改的文件全部内容

# (c) 2003 BEA Systems, Inc. All Rights Reserved.
#ident "@(#) samples/atmi/simpapp/ubbsimple $Revision: 1.7 $"

#Skeleton UBBCONFIG file for the TUXEDO Simple Application.
#Replace the <bracketed> items with the appropriate values.

*RESOURCES
#IPCKEY <Replace with a valid IPC Key>

#Example:
IPCKEY 123456

DOMAINID simpapp
MASTER simple
MAXACCESSERS 10
MAXSERVERS 5
MAXSERVICES 10
MODEL SHM
LDBAL N

*MACHINES
DEFAULT:
APPDIR="/opt/tuxedo/simpapp"
TUXCONFIG="/opt/tuxedo/simpapp/tuxconfig"
TUXDIR="/opt/tuxedo/tuxedo11gR1"
#Example:
# APPDIR="/home/me/simpapp"
# TUXCONFIG="/home/me/simpapp/tuxconfig"
# TUXDIR="/usr/tuxedo"

tfjus LMID=simple //tfjus为本机hostname名,此句只是说明,最好将注释删掉,因为这个文件无法识别//表示注释符

#Example:
#beatux LMID=simple

*GROUPS
GROUP1
LMID=simple GRPNO=1 OPENINFO=NONE

*SERVERS
DEFAULT:
CLOPT="-A"

simpserv SRVGRP=GROUP1 SRVID=1

*SERVICES
TOUPPER


不能含有中文注释

注意:APPDIR、TUXCONFIG和TUXDIR三个选项的路径要与 tux.env 文件中的配置保持一致。
修改完成,保存退出

开始跑:


. ./tux.env
tmloadcf -y ubbsimple //运行此命令不出出任何提示,表示一切正常
//如果出现CMDTUX_CAT:883: ERROR: tmloadcf cannot run on an active node
//将进程关掉就行了,在后面有说怎样关闭
buildserver -f simpserv.c -o simpserv -s TOUPPER //编译服务器端程序
buildclient -f simpcl.c -o simpcl //编译客户端程序
ubuntu:
buildclient -o simpcl -f "-Xlinker --no-as-needed simpcl.c"
这里需要说明的是,buildserver和buildclient命令需要系统安装gcc 才能被执行,gcc -v 查看本机是否安装GCC ,这里就不介绍gcc的安装了。
tmboot -y 启动进程
//
INFO: Oracle Tuxedo, Version 11.1.1.2.0, 64-bit, Patch Level (none)

Booting admin processes ...

exec BBL -A :
process id=2658 ... Started.

Booting server processes ...

exec simpserv -A :
process id=2659 ... Started.
2 processes started.
//

ps -ef 查看启动进程
root 2658 1653 0 16:50 pts/19 00:00:00 BBL -C dom=simpapp -g 30002 -i 0
root 2659 1653 0 16:50 pts/19 00:00:00 simpserv -C dom=simpapp -g 1 -i
root 2936 2614 0 16:54 pts/19 00:00:00 ps -ef
// 能找到上面几个进程表面已经启动成功

开始验证:

root@node1:/opt/tuxedo/simpapp#./simpcl hello
Returned string is: HELLO
客户端发送一个小写的hello ,服务器端将返回一个大写的HELLO
tmshutdown -y //停止进程

如果两个进程分别在不同的机子上想实现通讯,就要走TCP/IP协议

通过TCP/IP协议,如果有本地连接,则使用etho,否则使用wlan0进行通讯,我用的是无线,所以使用的是wlan0进行通信

以下两个是用来配置服务端的,客户端不用配置,只要客户端在调用服务的时候使用这个IP地址和端口即可

修改tux.env文件,在后面继续添加:
WSNADDR=//192.168.30.177:3200; export WSNADDR

其中192.168.30.177是wlan0 IP地址,通过ipconfig可以查看,3200为端口号,在不冲突的情况下可以任意

修改ubbsimple文件
tfjus LMID=simple
MAXWSCLIENTS=5


simpserv SRVGRP=GROUP1 SRVID=1
WSL SRVGRP=GROUP1 SRVID=10
CLOPT="-A -- -n //192.168.30.177:3200"

remotesimpcl.x

/*    (c) 2003 BEA Systems, Inc. All Rights Reserved. */
/*    Copyright (c) 1997 BEA Systems, Inc.
      All rights reserved

      THIS IS UNPUBLISHED PROPRIETARY
      SOURCE CODE OF BEA Systems, Inc.
      The copyright notice above does not
      evidence any actual or intended
      publication of such source code.
*/

/* #ident    "@(#) samples/atmi/simpapp/simpcl.c    $Revision: 1.5 $" */

#include <stdio.h>
#include "atmi.h"        /* TUXEDO  Header File */


#if defined(__STDC__) || defined(__cplusplus)
main(int argc, char *argv[])
#else
main(argc, argv)
int argc;
char *argv[];
#endif

{

    char *sendbuf, *rcvbuf;
    long sendlen, rcvlen;
    int ret;

    if(argc != 2) {
        (void) fprintf(stderr, "Usage: simpcl string
");
        exit(1);
    }

    tuxputenv("WSNADDR=//192.168.30.177:3200");
    /* Attach to System/T as a Client Process */
    if (tpinit((TPINIT *) NULL) == -1) {
        (void) fprintf(stderr, "Tpinit failed
");
        exit(1);
    }
    
    sendlen = strlen(argv[1]);

    /* Allocate STRING buffers for the request and the reply */

    if((sendbuf = (char *) tpalloc("STRING", NULL, sendlen+1)) == NULL) {
        (void) fprintf(stderr,"Error allocating send buffer
");
        tpterm();
        exit(1);
    }

    if((rcvbuf = (char *) tpalloc("STRING", NULL, sendlen+1)) == NULL) {
        (void) fprintf(stderr,"Error allocating receive buffer
");
        tpfree(sendbuf);
        tpterm();
        exit(1);
    }

    (void) strcpy(sendbuf, argv[1]);

    /* Request the service TOUPPER, waiting for a reply */
    ret = tpcall("TOUPPER", (char *)sendbuf, 0, (char **)&rcvbuf, &rcvlen, (long)0);

    if(ret == -1) {
        (void) fprintf(stderr, "Can't send request to service TOUPPER
");
        (void) fprintf(stderr, "Tperrno = %d
", tperrno);
        tpfree(sendbuf);
        tpfree(rcvbuf);
        tpterm();
        exit(1);
    }

    (void) fprintf(stdout, "Returned string is: %s
", rcvbuf);

    /* Free Buffers & Detach from System/T */
    tpfree(sendbuf);
    tpfree(rcvbuf);
    tpterm();
    return(0);
}

. ./tux.env

tmloadcf -y ubbsimple // 编译文件
buildclient -f simpcl.c -o ws -w
ubuntu:
buildclient -o remotesimpcl -f "-Xlinker --no-as-needed remotesimpcl.c" -w
tmboot -y //启动进程

//
Booting all admin and server processes in /opt/tuxedo/simpapp/tuxconfig
INFO: Oracle Tuxedo, Version 11.1.1.2.0, 64-bit, Patch Level (none)

Booting admin processes ...

exec BBL -A :
process id=3301 ... Started.

Booting server processes ...

exec simpserv -A :
process id=3302 ... Started.
exec WSL -A -- -n //192.168.30.177:3200 :
process id=3303 ... Started.
3 processes started.
//
./remotesimpcl hello

Returned string is: HELLO

原文地址:https://www.cnblogs.com/tufujie/p/5343261.html