1、在windows主机上安装了TimesTen Client,然后主机上通过VirtualBox虚拟出Linux Guest OS,安装了TimesTen Server。由于虚拟机配置的是NAT网络,缺省情况下,虚拟机对于主机是不可见的,因此也无法作为服务器使用。
2、有两种方法可以解决问题:更改网络为Bridged Network设置NAT网络的port forwarding这里讨论第2种方法,也即将主机接收到的请求转发给虚拟机。在NAT设置下,Guest OS的IP如下:
3、[timesten@localhost ~]$ ifconfig -a eth0 Lin氯短赤亻k encap:Ethernet HWaddr 08:00:27:45:AB:7A inet addr:10.0.2.100 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe45:ab7a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:167 errors:0 dropped:0 overruns:0 frame:0 TX packets:206 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:18231 (17.8 KiB) TX bytes:25049 (24.4 KiB)
4、Guest OS可以ping主机的IP:[timesten@localhost ~]$ping 192.168.56.1PING 192.168.56.1(192.168.56.1) 56(84) bytes of data.64 bytes from 192.168.56.1: icmp_seq=1 ttl=127time=1.70 ms 64 bytes from192.168.56.1: icmp_seq=2ttl=127 time=1.17 ms
5、Host OS的地址是在VirtualBox Host-Only Network中自动定义的。而Host OS无法访问Guest OS.设置如下图:打开网络设置,选择端口转发设置如图的规则在ODBC数据源中设置的DSN如下,注意服务器为localhost:然后在SQL Developer中就可以建立TimesTen连接,测试成功
6、其实,我还是建议大家用bridged network的,不过通过设置port forwarding,可以明白一个重要的概念。就是TimesTen的Main Daemon和Server Daemon的关系。在ttstatus中可以看到这些daemon:
7、[timesten@localhost ~]$ ttstatusTimesTen status report as of Fri Aug 26 23:20:44 2016Daemon pid 3418 port 53396 instance tt1122TimesTen server pid 3427 started on port 53397 ...
8、以上的Daemon,又称为TimesTen Daemon, Data Manager Daemon, Main Daemon而TimesTen Server即Server Daemon,它处理所有的C/S连接。所以我们选择的端口是53397而非53396