Document Type | Technical Information
Category | Administration
Applicable Product Versions | 6FS06, 6FS07, 6FS07PS, 7FS02, 7FS02PS
Document Number | TADTI033
Overview
This document describes how to configure tbgw (Tibero Gateway) in an environment where multiple Java versions are used on a single server.
The example explains the Tibero to MSSQL DBLink configuration.
Method
Note
The following environment was used for this procedure.
Tibero7 FS02 (Linux)
MSSQL 2019 (Windows)
Java: JDK1.6, JDK1.8 (In the test environment, running java -version shows version 1.8)
1. Set up tbJavaGW folders for each JDK version
[tibero@localhost bin]$ ls -al | grep tbJavaGW drwxr-xr-x 4 tibero tibero 103 May 29 10:10 tbJavaGW --JDK1.8 gateway drwxr-xr-x 4 tibero tibero 103 May 29 10:11 tbJavaGW_1.6 --JDK1.6 gateway
2. Change LISTENER_PORT and tbdns.tbr port in the jgw.cfg file
Since two gateways will be started on a single server, different LISTENER_PORT settings are required.
tbJavaGW/jgw.cfg
- LISTENER PORT for JDK1.8 gateway
LISTENER_PORT=9093
tbJavaGW_1.6/jgw.cfg
- LISTENER PORT for JDK1.6 gateway
LISTENER_PORT=8093
tbdsn.tbr
- MSSQL connection info via JDK1.8 based gateway
msgate=(
(GATEWAY=(LISTENER = (HOST=localhost) (PORT=9093))
(TARGET=ip:1433:master)
(TX_MODE=LOCAL)
)
)
- MSSQL connection info via JDK1.6 based gateway
ms=(
(GATEWAY=(LISTENER = (HOST=localhost) (PORT=8093))
(TARGET=ip:1433:master)
(TX_MODE=LOCAL)
)
)
3. Open tbgw with vi and specify the Java executable to use
tbJavaGW/tbgw
- Uses Java version 1.8 as is when running java -version
tbJavaGW_1.6/tbgw
- Must be written according to the installed Java path
if [[ $# -gt 0 ]] && [[ $1 = "-v" ]] ; then
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.41.x86_64/jre/bin/java -jar $gateway
else
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.41.x86_64/jre/bin/java -Xms128m -Xmx512m -Dlog4j.configuration=$log4jfile -classpath $mysqljdbc:$commonsdaemon:$commonspool:$commonscollections:$log4j:$gateway:$msjdbc:$asejdbc:$postgresqljdbc:$hive:. $mainclass CONFIG=$configfile $* &
sleep 1
fi
4. Start tbgw
- tbJavaGW/tbgw - tbJavaGW_1.6/tbgw ./tbgw
5. tbgw startup results
[tibero@localhost tbJavaGW_1.6]$ ps -ef | grep gw - JDK 1.8 gateway running tibero 30827 1 0 10:12 pts/0 00:00:02 /usr/lib/jvm/java -Xms128m -Xmx512m -Dlog4j.configuration=jgwlog.properties -classpath ./lib/mysql-connector-java-5.1.40-bin.jar:./lib/commons-daemon-1.0.6.jar:./lib/commons-pool.jar:./lib/commons-collections.jar:./lib/log4j-1.2.15.jar:./lib/tbgateway.jar:./lib/sqljdbc41.jar:./lib/sqljdbc42.jar:./lib/conn3.jar:./lib/postgresql-8.4-701.jdbc3.jar:./lib/httpclient-4.4.jar:./lib/httpcore-4.4.jar:./lib/slf4j-api-1.7.25.jar:./lib/curator-client-2.12.0.jar:./lib/commons-lang-2.6.jar:./lib/guava-14.0.1.jar:./lib/hive-jdbc-3.1.2.jar:./lib/hive-service-3.1.2.jar:./lib/hive-common-3.1.2.jar:./lib/hive-serde-3.1.2.jar com.tmax.tibero.gateway.main.GatewayMain CONFIG=./jgw.cfg - JDK 1.6 gateway running tibero 30801 1 0 10:12 pts/0 00:00:01 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.41.x86_64/jre/bin/java -Xms128m -Xmx512m -Dlog4j.configuration=jgwlog.properties -classpath ./lib/mysql-connector-java-5.1.40-bin.jar:./lib/commons-daemon-1.0.6.jar:./lib/commons-pool.jar:./lib/commons-collections.jar:./lib/log4j-1.2.15.jar:./lib/tbgateway.jar:./lib/sqljdbc41.jar:./lib/sqljdbc42.jar:./lib/conn3.jar:./lib/postgresql-8.4-701.jdbc3.jar:./lib/httpclient-4.4.jar:./lib/httpcore-4.4.jar:./lib/slf4j-api-1.7.25.jar:./lib/curator-client-2.12.0.jar:./lib/commons-lang-2.6.jar:./lib/guava-14.0.1.jar:./lib/hive-jdbc-3.1.2.jar:./lib/hive-service-3.1.2.jar:./lib/hive-common-3.1.2.jar:./lib/hive-serde-3.1.2.jar com.tmax.tibero.gateway.main.GatewayMain CONFIG=./jgw.cfg fi