TimesTen的逻辑服务器名概念

2024-02-04 13:38

本文主要是介绍TimesTen的逻辑服务器名概念,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

概念

TimesTen中逻辑服务器名(logical server name)的概念用的很少,但是了解一下还是必要的。
首先,logical server是在客户端定义,指向服务器端。
其次,当用非TCP/IP的通讯协议或者TimesTen Server不在缺省的端口监听时,必须使用logical server name。

A logical server name is a definition for a server system on the TimesTen Client. In some cases, such as when using a communication protocol other than TCP/IP for local client/server or the TimesTen Server process is not listening on the default TCP/IP port, you must define a logical server name on the client system. In these cases, the Client DSN must refer to the logical server name. However, in most cases when the communication protocol used is TCP/IP, the Client DSN can refer directly to the server host name without having to define a logical server name.

logical server的配置在sys.ttconnect.ini文件中定义。例如:

$ cat sys.ttconnect.ini
# Copyright (c) 1999, 2009, Oracle and/or its affiliates.All rights reserved. ###############################################################
# This is a sample sys.ttconnect.ini file that is used for the
# TimesTen Client.  It contains entries for each server.
###############################################################[ttLocalHost_tt1122]
Description=TimesTen Server
Network_Address=ttLocalHost
TCP_PORT=53393

在本例中, 由于是32位版本,因此TCP_PORT中的53393是缺省端口。
值得一说的是Network_Address:
ttLocalHost表示使用Unix Domain socket通讯
ttShmHost表示使用shared memory进行IPC通讯
Network_Address也可以定义为主机名或IP地址

示例

在本例中我们在一台VM中安装了两个TimesTen示例tt1122和ttnew,第一个使用缺省的端口53392。由于缺省端口已占用,第二个使用的是另外的端口号55555。

$ cat /etc/TimesTen/instance_info 
#SUM 55602     1
[ tt1122 ]
Product=TimesTen11.2.2.6.2
InstallDir=/home/oracle/TimesTen/tt1122
InstanceAdministrator=oracle
DaemonHome=/home/oracle/TimesTen/tt1122/info
BitLevel=64
Component=Client/Server and DataManager
TT_PORT=53392[ ttnew ]
Product=TimesTen11.2.2.8.11
InstallDir=/u01/TimesTen/ttnew
InstanceAdministrator=oracle
DaemonHome=/u01/TimesTen/ttnew/info
BitLevel=64
Component=Client/Server and DataManager
TT_PORT=55555$ ttversion
TimesTen Release 11.2.2.6.2 (64 bit Linux/x86_64) (tt1122:53392) 2014-01-03T07:01:05ZInstance admin: oracleInstance home directory: /home/oracle/TimesTen/tt1122Group owner: oracleDaemon home directory: /home/oracle/TimesTen/tt1122/infoPL/SQL enabled.$ . /u01/TimesTen/ttnew/bin/ttenv.sh
$ ttversion
TimesTen Release 11.2.2.8.11 (64 bit Linux/x86_64) (ttnew:55555) 2016-02-09T19:36:50ZInstance admin: oracleInstance home directory: /u01/TimesTen/ttnewGroup owner: oracleDaemon home directory: /u01/TimesTen/ttnew/infoPL/SQL enabled.

再看一下tt1122的ttstatus:

[oracle@timesten-hol info]$ ttstatus
TimesTen status report as of Wed Jun 29 04:20:17 2016Daemon pid 2644 port 53392 instance tt1122
TimesTen server pid 2653 started on port 53393
------------------------------------------------------------------------
Data store /home/oracle/TimesTen/tt1122/info/DemoDataStore/cachedb1
There are no connections to the data store
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group oracle
End of report

另起一个终端,看一下ttnew的ttstatus

$ . /u01/TimesTen/ttnew/bin/ttenv.sh
$ export TT_HOME=/u01/TimesTen/ttnew[oracle@timesten-hol info]$ ttstatus
TimesTen status report as of Wed Jun 29 04:21:38 2016Daemon pid 4494 port 55555 instance ttnew
TimesTen server pid 4503 started on port 55556
------------------------------------------------------------------------
Data store /home/oracle/TimesTen/tt1122/info/DemoDataStore/cachedb2
There are no connections to the data store
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group oracle
End of report

注意Daemon pid和TimesTen server pid两行,Daemon 指的是 TimesTen Data Manager daemon, 负责Data Manager service 。Daemon的端口不能重。
TimesTen server是Daemon的子进程,或称为subdaemon。

安装TimesTen后,系统自动产生了sys.ttconnect.ini文件,先看tt1122的, 由于是主机第一个安装,因此使用的都是缺省值:

[oracle@timesten-hol info]$ cat sys.ttconnect.ini 
# Copyright (c) 1999, 2009, Oracle and/or its affiliates.All rights reserved. ###############################################################
# This is a sample sys.ttconnect.ini file that is used for the
# TimesTen Client.  It contains entries for each server.
###############################################################[ttLocalHost_tt1122]
Description=TimesTen Server
Network_Address=ttLocalHost
TCP_PORT=53393

再看一下第二个非缺省安装ttnew的:

[tt1122]$ cat sys.ttconnect.ini 
# Copyright (c) 1999, 2009, Oracle and/or its affiliates.All rights reserved. ###############################################################
# This is a sample sys.ttconnect.ini file that is used for the
# TimesTen Client.  It contains entries for each server.
###############################################################[ttLocalHost_ttnew]
Description=TimesTen Server
Network_Address=ttLocalHost
TCP_PORT=55556
[tt1122]$ ttisql -v1 -e 'set prompt "tt1122>"' repdb1_1122
tt1122>create user tthr identified by timesten;
tt1122>grant create session to tthr;tt1122>call ttconfiguration('ConnectionName');
< ConnectionName, repdb1_1122 >[ttnew]$ ttisql -v1 -e 'set prompt "ttnew>"' repdb2_1122
ttnew>create user tthr identified by timesten;
ttnew>grant create session to tthr;ttnew>call ttconfiguration('ConnectionName');
< ConnectionName, repdb2_1122 >

接下来测试从ttnew上的repdb2_1122访问tt1122上的repdb1_1122
sys.odbc.ini中已经有了一个repdb1CS_1122的定义:

repdb1CS_1122=TimesTen 11.2.2 Client Driver[repdb1CS_1122]
TTC_SERVER=ttLocalHost_ttnew
TTC_SERVER_DSN=repdb1_1122

但由于ttLocalHost_ttnew实际上指向本实例,因此无法连接到对方。
因此我们必须修改TTC_SERVER指向的logical server,涉及到sys.odbc.ini和sys.ttconnect.ini, 这里不妨把对方实例的sys.ttconnect.ini拷贝过来

[ttnew]$ cat sys.odbc.ini
...
[repdb1CS_1122]
TTC_SERVER=ttLocalHost_tt1122
TTC_SERVER_DSN=repdb1_1122
...[ttnew]$ hostname
timesten-hol[ttnew]$ cat sys.ttconnect.ini
# Copyright (c) 1999, 2009, Oracle and/or its affiliates.All rights reserved. ###############################################################
# This is a sample sys.ttconnect.ini file that is used for the
# TimesTen Client.  It contains entries for each server.
###############################################################[ttLocalHost_ttnew]
Description=TimesTen Server
Network_Address=ttLocalHost
TCP_PORT=55556####### ADDED BY STEVEN,COPIED FROM INSTANCE TT1122 ########
[ttLocalHost_tt1122]
Description=TimesTen Server
Network_Address=timesten-hol
TCP_PORT=53393

然后测试连通性,成功了:
[ttnew]$ ttisqlcs “dsn=repdb1CS_1122;uid=tthr;pwd=timesten”
Command> call ttconfiguration(‘ConnectionName’);
< ConnectionName, repdb1cs_1122 >
1 row found.
Command> call ttconfiguration(‘datastore’);
< DataStore, /home/oracle/TimesTen/tt1122/info/DemoDataStore/repdb1_1122 >

更简洁的方法

除了在sys.ttconnect.ini中定义外,还可以在连接属性中直接定义。
使用的属性有ttc_server, ttc_server_dsn和tcp_port
关键是tcp_port,指的是timesten server port,即daemon port + 1。

从任意客户端连接到tt1122的cachedb1可以用:

$ ttIsqlCS -connstr "ttc_server=timesten-hol;tcp_port=53393;ttc_server_dsn=cachedb1;uid=tthr;pwd=timesten" 

从任意客户端连接到ttnew的cachedb2可以用:

ttIsqlCS -connstr "ttc_server=timesten-hol;tcp_port=55556;ttc_server_dsn=cachedb2;uid=tthr;pwd=timesten"

总结

逻辑服务器名用于使用非TCP/IP的通讯协议或者TimesTen Server不在缺省的端口监听时。
逻辑服务器名在sys.ttconnect.ini中定义,指向的是目标服务器的网络地址和Daemon使用的端口。而实际的DSN则在对方的DSN文件中定义。
逻辑服务器名在客户端的DSN文件中使用,用TTC_SERVER指定逻辑服务器名,用TTC_SERVER_DSN指定对方的DSN。
逻辑服务器的属性还可以直接在连接属性中定义。

参考

  • TimesTen Operation Guide | Working with the TimesTen Client and Server | Configuring TimesTen Client and Server | Defining a logical server name
  • TimesTen Client Connection Failed With Error: (Doc ID 1571037.1)

这篇关于TimesTen的逻辑服务器名概念的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/677693

相关文章

Go语言开发实现查询IP信息的MCP服务器

《Go语言开发实现查询IP信息的MCP服务器》随着MCP的快速普及和广泛应用,MCP服务器也层出不穷,本文将详细介绍如何在Go语言中使用go-mcp库来开发一个查询IP信息的MCP... 目录前言mcp-ip-geo 服务器目录结构说明查询 IP 信息功能实现工具实现工具管理查询单个 IP 信息工具的实现服

springboot上传zip包并解压至服务器nginx目录方式

《springboot上传zip包并解压至服务器nginx目录方式》:本文主要介绍springboot上传zip包并解压至服务器nginx目录方式,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录springboot上传zip包并解压至服务器nginx目录1.首先需要引入zip相关jar包2.然

将Java项目提交到云服务器的流程步骤

《将Java项目提交到云服务器的流程步骤》所谓将项目提交到云服务器即将你的项目打成一个jar包然后提交到云服务器即可,因此我们需要准备服务器环境为:Linux+JDK+MariDB(MySQL)+Gi... 目录1. 安装 jdk1.1 查看 jdk 版本1.2 下载 jdk2. 安装 mariadb(my

Python 迭代器和生成器概念及场景分析

《Python迭代器和生成器概念及场景分析》yield是Python中实现惰性计算和协程的核心工具,结合send()、throw()、close()等方法,能够构建高效、灵活的数据流和控制流模型,这... 目录迭代器的介绍自定义迭代器省略的迭代器生产器的介绍yield的普通用法yield的高级用法yidle

基于Python打造一个可视化FTP服务器

《基于Python打造一个可视化FTP服务器》在日常办公和团队协作中,文件共享是一个不可或缺的需求,所以本文将使用Python+Tkinter+pyftpdlib开发一款可视化FTP服务器,有需要的小... 目录1. 概述2. 功能介绍3. 如何使用4. 代码解析5. 运行效果6.相关源码7. 总结与展望1

使用Python开发一个简单的本地图片服务器

《使用Python开发一个简单的本地图片服务器》本文介绍了如何结合wxPython构建的图形用户界面GUI和Python内建的Web服务器功能,在本地网络中搭建一个私人的,即开即用的网页相册,文中的示... 目录项目目标核心技术栈代码深度解析完整代码工作流程主要功能与优势潜在改进与思考运行结果总结你是否曾经

使用Python实现快速搭建本地HTTP服务器

《使用Python实现快速搭建本地HTTP服务器》:本文主要介绍如何使用Python快速搭建本地HTTP服务器,轻松实现一键HTTP文件共享,同时结合二维码技术,让访问更简单,感兴趣的小伙伴可以了... 目录1. 概述2. 快速搭建 HTTP 文件共享服务2.1 核心思路2.2 代码实现2.3 代码解读3.

CentOS 7部署主域名服务器 DNS的方法

《CentOS7部署主域名服务器DNS的方法》文章详细介绍了在CentOS7上部署主域名服务器DNS的步骤,包括安装BIND服务、配置DNS服务、添加域名区域、创建区域文件、配置反向解析、检查配置... 目录1. 安装 BIND 服务和工具2.  配置 BIND 服务3 . 添加你的域名区域配置4.创建区域

Windows Server服务器上配置FileZilla后,FTP连接不上?

《WindowsServer服务器上配置FileZilla后,FTP连接不上?》WindowsServer服务器上配置FileZilla后,FTP连接错误和操作超时的问题,应该如何解决?首先,通过... 目录在Windohttp://www.chinasem.cnws防火墙开启的情况下,遇到的错误如下:无法与

最新Spring Security实战教程之表单登录定制到处理逻辑的深度改造(最新推荐)

《最新SpringSecurity实战教程之表单登录定制到处理逻辑的深度改造(最新推荐)》本章节介绍了如何通过SpringSecurity实现从配置自定义登录页面、表单登录处理逻辑的配置,并简单模拟... 目录前言改造准备开始登录页改造自定义用户名密码登陆成功失败跳转问题自定义登出前后端分离适配方案结语前言