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

相关文章

使用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实现从配置自定义登录页面、表单登录处理逻辑的配置,并简单模拟... 目录前言改造准备开始登录页改造自定义用户名密码登陆成功失败跳转问题自定义登出前后端分离适配方案结语前言

Java逻辑运算符之&&、|| 与&、 |的区别及应用

《Java逻辑运算符之&&、||与&、|的区别及应用》:本文主要介绍Java逻辑运算符之&&、||与&、|的区别及应用的相关资料,分别是&&、||与&、|,并探讨了它们在不同应用场景中... 目录前言一、基本概念与运算符介绍二、短路与与非短路与:&& 与 & 的区别1. &&:短路与(AND)2. &:非短

Windows server服务器使用blat命令行发送邮件

《Windowsserver服务器使用blat命令行发送邮件》在linux平台的命令行下可以使用mail命令来发送邮件,windows平台没有内置的命令,但可以使用开源的blat,其官方主页为ht... 目录下载blatBAT命令行示例备注总结在linux平台的命令行下可以使用mail命令来发送邮件,Win

Ubuntu 22.04 服务器安装部署(nginx+postgresql)

《Ubuntu22.04服务器安装部署(nginx+postgresql)》Ubuntu22.04LTS是迄今为止最好的Ubuntu版本之一,很多linux的应用服务器都是选择的这个版本... 目录是什么让 Ubuntu 22.04 LTS 变得安全?更新了安全包linux 内核改进一、部署环境二、安装系统

nginx配置多域名共用服务器80端口

《nginx配置多域名共用服务器80端口》本文主要介绍了配置Nginx.conf文件,使得同一台服务器上的服务程序能够根据域名分发到相应的端口进行处理,从而实现用户通过abc.com或xyz.com直... 多个域名,比如两个域名,这两个域名其实共用一台服务器(意味着域名解析到同一个IP),一个域名为abc

pycharm远程连接服务器运行pytorch的过程详解

《pycharm远程连接服务器运行pytorch的过程详解》:本文主要介绍在Linux环境下使用Anaconda管理不同版本的Python环境,并通过PyCharm远程连接服务器来运行PyTorc... 目录linux部署pytorch背景介绍Anaconda安装Linux安装pytorch虚拟环境安装cu

MySQL 中的服务器配置和状态详解(MySQL Server Configuration and Status)

《MySQL中的服务器配置和状态详解(MySQLServerConfigurationandStatus)》MySQL服务器配置和状态设置包括服务器选项、系统变量和状态变量三个方面,可以通过... 目录mysql 之服务器配置和状态1 MySQL 架构和性能优化1.1 服务器配置和状态1.1.1 服务器选项