Tuxedo11g 简介和安装过程
Tuxedo简介
Tuxedo是中间件,中间件又是介于客户机和server之间的夹层,突破了传统的c/s架构,为构建大规模,高性能,分布式c/s应用程序提供了通信,事物,安全,容错等基础服务,屏蔽了底层应用细节,应用程序不必从底层开发,以自身的复杂性换取应用程序开发的简单
Tuxedo:Transaction for Unix has been Extended for Distributed Operation分布式操作扩展之后的Unix事务系统。
交易中间件位于client和server之间
Tuxedo是一个事务处理(TP)监督器(transaction processing monitor),它管理联机事务处理(OLTP)系统操作的事务。客户通过结构化查询语言(SQL)调用,或其他类型的请求,产生对server的请求。这个事务处理监督器确信,正确地进行了改动,以保证数据的完整性。这在一个事务能够改变多个位置的数据库的分布式数据库环境是很重要的。这个事务处理监督器使用双阶段提交,以保证全部的数据库都已经接收和认可了这些数据的正确性。否则,这个数据库返回它的事务前状态
Tuxedo安装过程
- 下载地址
oracle官网各版本Tuxedo下载地址
选择Oracle Tuxedo 11gR1 (11.1.1.3.0)的适用于 Linux x86-64(64 位)(86,027,903 字节) - 创建用户和设置密码
[root@web1 ~]# useradd tuxedo
[root@web1 ~]# id tuxedo
uid=502(tuxedo) gid=502(tuxedo) groups=502(tuxedo)
[root@web1 ~]# passwd tuxedo
Changing password for user tuxedo.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
- 上传安装包并且赋予权限
[root@web1 ~]# mv tuxedo111130_64_Linux_01_x86.bin /tuxedo/
[root@web1 ~]# chown -R tuxedo:tuxedo /tuxedo/
[root@web1 ~]# cd /tuxedo/
[root@web1 tuxedo]# ll
total 84028
drwx------. 2 tuxedo tuxedo 16384 Aug 14 15:58 lost+found
-rw-r--r--. 1 tuxedo tuxedo 86027903 Aug 21 2018 tuxedo111130_64_Linux_01_x86.bin
[root@web1 tuxedo]# chmod 755 tuxedo111130_64_Linux_01_x86.bin
[root@web1 tuxedo]# ll
total 84028
drwx------. 2 tuxedo tuxedo 16384 Aug 14 15:58 lost+found
-rwxr-xr-x. 1 tuxedo tuxedo 86027903 Aug 21 2018 tuxedo111130_64_Linux_01_x86.bin
- 开始安装
[root@web1 tuxedo]# su - tuxedo
[tuxedo@web1 ~]$ ./tuxedo111130_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
这里只能填1,英语
CHOOSE LOCALE BY NUMBER: 1
===============================================================================
Tuxedo 11.1.1.3.0 (created with InstallAnywhere by Macrovision)
-------------------------------------------------------------------------------
===============================================================================
Introduction
------------
InstallAnywhere will guide you through the Tuxedo 11.1.1.3.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.3.0 installation.You
must re-install Tuxedo 11.1.1.3.0. For more information, see "Preparing to
Install the Oracle Tuxedo System" in the Tuxedo 11.1.1.3.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 选择1全安装
===============================================================================
Choose Oracle Home
------------------
1- Create new Oracle Home
2- Use existing Oracle Home
选择1 安装新的路径和安装目录
Enter a number: 1
Specify a new Oracle Home directory: /tuxedo
===============================================================================
Choose Product Directory
------------------------
1- Modify Current Selection (/tuxedo/tuxedo11gR1)
2- Use Current Selection (/tuxedo/tuxedo11gR1)
选择2并且确认
Enter a number: 2
Install Samples (Y/N): y
===============================================================================
Pre-Installation Summary
------------------------
Please Review the Following Before Continuing:
Product Name:
Tuxedo 11.1.1.3.0
Install Folder:
/tuxedo/tuxedo11gR1
Link Folder:
/home/tuxedo
Required Space:
187 MB
Available Space:
44303 MB
显示安装信息直接回车
PRESS <ENTER> TO CONTINUE: 回车
===============================================================================
Ready To Install
----------------
InstallAnywhere is now ready to install Tuxedo 11.1.1.3.0 onto your system at
the following location:
/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
选择2 不支持SSL
ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:
: 2
===============================================================================
Installation Complete
---------------------
Congratulations. Tuxedo 11.1.1.3.0 has been successfully installed to:
/tuxedo/tuxedo11gR1
回车结束安装
PRESS <ENTER> TO EXIT THE INSTALLER: 回车
- 确认安装成功
[tuxedo@web1 tuxedo]$ cd tuxedo11gR1/
[tuxedo@web1 tuxedo11gR1]$ ll
total 48
drwxr-x---. 2 tuxedo tuxedo 4096 Aug 27 23:23 bin
drwxr-x---. 2 tuxedo tuxedo 4096 Aug 27 23:22 cobinclude
drwxr-x---. 4 tuxedo tuxedo 4096 Aug 27 23:22 help
drwxr-x---. 5 tuxedo tuxedo 4096 Aug 27 23:22 include
drwxr-x---. 3 tuxedo tuxedo 4096 Aug 27 23:22 inventory
drwxr-x---. 6 tuxedo tuxedo 4096 Sep 12 2006 jre
drwxr-x---. 2 tuxedo tuxedo 4096 Aug 27 23:22 lib
drwxr-x---. 6 tuxedo tuxedo 4096 Aug 27 23:22 locale
drwxr-x---. 5 tuxedo tuxedo 4096 Aug 27 23:22 samples
-rw-r-----. 1 tuxedo tuxedo 568 Aug 27 23:23 tux.env
drwxr-x---. 8 tuxedo tuxedo 4096 Aug 27 23:23 udataobj
drwxr-x---. 3 tuxedo tuxedo 4096 Aug 27 23:33 uninstaller
[tuxedo@web1 tuxedo11gR1]$ chmod 755 tux.env
[tuxedo@web1 tuxedo11gR1]$ . tux.env
[tuxedo@web1 tuxedo11gR1]$ tmadmin -v
INFO: Oracle Tuxedo, Version 11.1.1.3.0, 64-bit, Patch Level (none)
这里查看到版本显示安装成功
" ./ “ 的方式类似于新建了一个shell, 在这个新建的shell中去执行脚本中的程序,类似于新建了一个子进程,但这个子进程不继承父进程的所有非export类型的变量,并且脚本中对非export环境变量的创建或修改不会反馈到外部调用shell中
” . " 的方式类似于将脚本中的每一行指令逐条在当前shell中执行,因此它继承了当前shell的环境变量,同时脚本中对环境变量的修改也可以反馈到shell中
- 部署测试例子
安装完成后使用/tuxedo/tuxedo11gR1/samples/atmi/simpapp下的列子,复制到新建的applications/目录里
[tuxedo@web1 tuxedo11gR1]$ vi tux.env
增加下列
LANG=C;export LANG
APPDIR=$TUXDIR/applications/simpapp;export APPDIR
TUXCONFIG=$APPDIR/tuxconfig; export TUXCONFIG
[tuxedo@web1 tuxedo11gR1]$ pwd
/tuxedo/tuxedo11gR1
[tuxedo@web1 tuxedo11gR1]$ mkdir applications
[tuxedo@web1 tuxedo11gR1]$ cp -r samples/atmi/simpapp/ applications/
[tuxedo@web1 tuxedo11gR1]$ pwd
/tuxedo/tuxedo11gR1
[tuxedo@web1 tuxedo11gR1]$ cd applications/
[tuxedo@web1 applications]$ ll
total 4
drwxr-x---. 2 tuxedo tuxedo 4096 Aug 28 00:05 simpapp
配置tuxedo环境变量
[tuxedo@web1 ~]$ vi .bash_profile
[tuxedo@gztvtest ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
TUXDIR=/tuxedo/tuxedo11gR1; export TUXDIR
APPDIR=$TUXDIR/applications/simpapp;export APPDIR
TUXCONFIG=$APPDIR/tuxconfig; export TUXCONFIG
JAVA_HOME=$TUXDIR/jre; export JAVA_HOME
JVMLIBS=$JAVA_HOME/lib/amd64/server:$JAVA_HOME/jre/bin
[tuxedo@web1 ~]$
[tuxedo@web1 ~]$ source .bash_profile
- 配置ubbconfig,编译程序
[tuxedo@web1 simpapp]$ pwd
/tuxedo/tuxedo11gR1/applications/simpapp
[tuxedo@web1 simpapp]$ ll
total 16
-rw-r-----. 1 tuxedo tuxedo 2943 Aug 28 00:05 README
-rw-r-----. 1 tuxedo tuxedo 1826 Aug 28 00:05 simpcl.c
-rw-r-----. 1 tuxedo tuxedo 2155 Aug 28 00:05 simpserv.c
-rw-r-----. 1 tuxedo tuxedo 886 Aug 28 00:05 ubbsimple
[tuxedo@web1 simpapp]$ vi ubbsimple
[tuxedo@web1 simpapp]$ cat 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 123456
#Example:
#IPCKEY 123456
DOMAINID simpapp
MASTER simple
MAXACCESSERS 10
MAXSERVERS 5
MAXSERVICES 10
MODEL SHM
LDBAL N
*MACHINES
DEFAULT:
APPDIR="/tuxedo/tuxedo11gR1/applications/simpapp"
TUXCONFIG="/tuxedo/tuxedo11gR1/applications/simpapp/tuxconfig"
TUXDIR="/tuxedo/tuxedo11gR1"
#Example:
# APPDIR="/home/me/simpapp"
# TUXCONFIG="/home/me/simpapp/tuxconfig"
# TUXDIR="/usr/tuxedo"
web1 LMID=simple
#Example:
#beatux LMID=simple
*GROUPS
GROUP1
LMID=simple GRPNO=1 OPENINFO=NONE
*SERVERS
DEFAULT:
CLOPT="-A"
simpserv SRVGRP=GROUP1 SRVID=1
*SERVICES
TOUPPER
tuxedo需要二进制形式的ubbconfig,需要使用tmloadcf得到二进制的ubbconfig:
/tuxedo/tuxedo11gR1/applications/simpapp
[tuxedo@web1 simpapp]$ ll
total 16
-rw-r-----. 1 tuxedo tuxedo 2943 Aug 28 00:05 README
-rw-r-----. 1 tuxedo tuxedo 1826 Aug 28 00:05 simpcl.c
-rw-r-----. 1 tuxedo tuxedo 2155 Aug 28 00:05 simpserv.c
-rw-r-----. 1 tuxedo tuxedo 841 Aug 28 00:09 ubbsimple
[tuxedo@web1 simpapp]$ tmloadcf -y ubbsimple //编译
[tuxedo@web1 simpapp]$ ll
total 452
-rw-r-----. 1 tuxedo tuxedo 2943 Aug 28 00:05 README
-rw-r-----. 1 tuxedo tuxedo 1826 Aug 28 00:05 simpcl.c
-rw-r-----. 1 tuxedo tuxedo 2155 Aug 28 00:05 simpserv.c
-rw-------. 1 tuxedo tuxedo 439296 Aug 28 00:10 tuxconfig
-rw-r-----. 1 tuxedo tuxedo 841 Aug 28 00:09 ubbsimple
-rw-rw-r--. 1 tuxedo tuxedo 471 Aug 28 00:10 ULOG.082819
编译服务端程序遇到报错:
tuxedo@web1 simpapp]$ buildserver -o simpserv -f simpserv.c -s TOUPPER
sh: cc: command not found
CMDTUX_CAT:1832: ERROR: can't execute cc -I$TUXDIR/include -o simpserv BS-77df.c -L${TUXDIR}/lib simpserv.c -ltux -lbuft -lfml -lfml32 -lengine -ldl -lpthread
显示缺少cc:则使用Yum下载
yum install gcc gcc-c++ libstdc+±deve
[tuxedo@web1 simpapp]$ buildserver -o simpserv -f simpserv.c -s TOUPPER
服务端程序及服务名不能任意命名,因为在刚刚配置文件中最下面一行有名字有配置
[tuxedo@web1 simpapp]$ tmboot -y 启动tuxedo应用系统
Booting all admin and server processes in /tuxedo/tuxedo11gR1/applications/simpapp/tuxconfig
INFO: Oracle Tuxedo, Version 11.1.1.3.0, 64-bit, Patch Level (none)
Booting admin processes ...
exec BBL -A :
process id=30816 ... Started.
Booting server processes ...
exec simpserv -A :
process id=30817 ... Started.
2 processes started.
[tuxedo@web1 simpapp]$ ./simpcl hello 运行客户端
Returned string is: HELLO 返回这个表示成功
关闭应用
[tuxedo@web1 simpapp]$ tmshutdown -y
Shutting down all admin and server processes in /tuxedo/tuxedo11gR1/applications/simpapp/tuxconfig
Shutting down server processes ...
Server Id = 1 Group Id = GROUP1 Machine = simple: shutdown succeeded
Shutting down admin processes ...
Server Id = 0 Group Id = simple Machine = simple: shutdown succeeded
2 processes stopped.