|
This chapter guides your installation of TG
on the following environment.
| * Environment |
 Platform |
Linux |
 JDBC driver |
PostgreSQL JDBC Driver |
 Target database |
PostgreSQL |
|
* If you have choosed TG package with J2RE, install it according to the instraction of the installer and apply procedures from "Step2 Determine install directory for TG".
For example, it is assumed that "jre-1_5_0_18-linux-i586.bin" which is downloaded from Oracle Corp(former:Microsystem's inc) web site will be installed to the "/home/postgres/tg" directory.
Make sure the downloaded package is executable. If not, use "chmod" command to give the package "execute" permission
and run it. |
| To the next, execute "java" command and make sure "java" will run without error. |
| |
* COMMAND-LINE SAMPLE
|
[postgres@dbsrv1 tg]$ cd jre1.5.0_18/bin
[postgres@dbsrv1 bin]$ ./java -version
java version "1.5.0_18"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) Client VM (build 1.5.0_18-b02, mixed mode, sharing)
[postgres@dbsrv1 bin]$
|
|
| |
  |
|
Step2 |
- Determine install directory for TG - |
                                  |
| Extract TG ZIP package("tar.gz" package, If you have choosed TG with J2RE Package) to a folder of your choice. In this section, it is assumed that "/home/postgres/tg" directory is used. |
| |
*COMMAND-LINE SAMPLE (ZIP)
|
|
|
|
| |
*COMMAND-LINE SAMPLE (tar.gz)
|
|
|
|
| |
| The directory "/home/postgres/tg/tg09X" contains these subdirectories and files : |
| |
- tgc.bat
- tgc.sh
- tgc.jar
- tg.bat
- tg.sh
- tg.conf
- tg.jar
- jobs
- lib
- conf |
:
:
:
:
:
:
:
:
:
|
Startup TGC - TG Controller - on Windows systems.
Startup TGC - TG Controller - on Linux systems.
Contains classes for TGC.
Startup TG on Windows systems.
Startup TG on Linux, UNIX systems.
Contains parameters for TG.
Contains classes for TG.
Contains scripts for JOB.
Contains java libraries.
Contains confifration files for TG.
|
|
| |
  |
|
Step3 |
- Create a symbolic link to J2RE - |
                                  |
* If you have choosed TG package with J2RE, skip this step and proceed next.
Create the symbolic link "/home/postgres/tg/tg09X/j2re" to "/home/postgres/tg/jre1.5.0_18".
Make sure you can run "java" command via the symbolic link. |
| |
* COMMAND-LINE SAMPLE
|
[postgres@dbsrv1 tg09X]$ pwd
/home/postgres/tg/tg09X
[postgres@dbsrv1 tg09X]$ ln -s ../jre1.5.0_18 j2re
[postgres@dbsrv1 tg09X]$ ./j2re/bin/java -version
java version "1.5.0_18"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) Client VM (build 1.5.0_18-b02, mixed mode, sharing)
[postgres@dbsrv1 tg09X]$
|
|
| |
  |
|
Step4 |
- Copy JDBC driver and edit "tg.sh" - |
                                  |
Copy JDBC driver into "/home/postgres/tg/tg09X/lib" directory. In this section it assumes that "postgresql-8.2-508.jdbc3.jar" is used as a JDBC driver.
Edit the shell script "tg.sh" which is used to startup TG. And, set "CLASSPATH" environmental value to contain JDBC driver file. |
| |
* COMMAND-LINE SAMPLE
|
[postgres@dbsrv1 tg09X]$ vi tg.sh
|
|
| |
* "tg.sh" SAMPLE
|
#! /bin/sh
# -- #! /bin/sh
# -- TG - Transaction Generator - [ Version 0.X ] initialization script v.X --
OPTION1=$1
OPTION2=$2
OPTION3=$3
PATH=./j2re/bin:${PATH}
export PATH
# MySQL JDBC DRIVER :
CLASSPATH=./lib/mysql-connector-java-5.1.6-bin.jar:${CLASSPATH}
# PostgreSQL JDBC DRIVER :
CLASSPATH=./lib/postgresql-8.2-508.jdbc3.jar:${CLASSPATH}
# ORACLE JDBC DRIVER :
CLASSPATH=./lib/ojdbc5.jar:${CLASSPATH}
# General setting :
CLASSPATH=./tg.jar:.:${CLASSPATH}
export CLASSPATH
java -Xmx512m tg ${OPTION1} ${OPTION2} ${OPTION3} ${OPTION4} ${OPTION5} ${OPTION6} ${OPTION7} ${OPTION8}
exit |
|
| |
| After editing, give "tg.sh" execute permission. |
| |
* COMMAND-LINE SAMPLE
|
[postgres@dbsrv1 tg09X]$ chmod 755 tg.sh
|
|
| |
  |
|
Step5 |
- Make sure you can run TG - |
                                  |
Run "tg.sh" to startup TG.
When your setup has been done correctly, the following message will be displayed. |
| |
* COMMAND-LINE SAMPLE
|
[postgres@dbsrv1 tg09X]$ ./tg.sh
Transaction Generator Wed Jun 13 23:49:11 JST 2007
Loading configuration file... Failed.
ERROR : Configuration file does not exist. : /home/postgres/tg/tg09X/tg.conf
type "HELP" or "h" to print help messages.
TG> |
|
| |
| *The example above is assumed that the configuration file of TG (tg.conf) does not exist. Therefore "Loading configuration file... Failed." message is displayed. For the details of "tg.cpmf", please see "Command-line mode" and "Parameter reference" pages. |
| |
  |
|
Step6 |
- Make sure you can load JDBC driver - |
                                  |
| Type "check driver postgresql " on TG command prompt and press "Enter" key. When JDBC driver is correctly loaded, the following message will be displayed. |
| |
* COMMAND-LINE SAMPLE
|
TG> check driver postgresql
Loading JDBC driver "org.postgresql.Driver" ... OK.
TG> |
|
| |
*If you recieved following messages, TG failed to load JDBC driver.
Loading JDBC driver "org.postgresql.Driver" ... Failed.
See section Step4 - Copy JDBC driver and edit "tg.sh", Edit the shell script and correct "CLASSPATH" environmental value. |
| |
  |
|
Step7 |
- Make sure you can run TGC- |
                                  |
If you can use GUI environments, you can control TG with TGC - TG Controller - which is management tool for TG.
Firstly, replace SWT library for Linux. * If you have choosed TG package with J2RE, skip this step and proceed next. |
| |
* COMMAND-LINE SAMPLE
|
[postgres@dbsrv1 tg09X]$ cd lib
[postgres@dbsrv1 lib]$ rm swt.jar
[postgres@dbsrv1 lib]$ ln -s swt.jar.linux swt.jar |
|
| |
| |
To the next,
Type "tgc.sh" which is startup script for TGC. The following window will be displayed. |
* COMMAND-LINE SAMPLE
|
[postgres@dbsrv1 tg09X]$ chmod 755 tgc.sh
[postgres@dbsrv1 tg09X]$ ./tgc.sh |
|
*If you recieved following messages, TGC failed to startup by the access control of X.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Exception in thread "main" org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
       at org.eclipse.swt.SWT.error(Unknown Source)
       at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)
       at org.eclipse.swt.widgets.Display.create(Unknown Source)
       at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
       at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
       at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
       at tgc.<init>(tgc.java:585)
       at tgc.main(tgc.java:581)
Type "xhost +" as root user and re-execute "tgc.sh". |
| |
| |
* COMMAND-LINE SAMPLE
|
[postgres@dbsrv1 tg09X]$ su -
Password:
[root@dbsrv1 ~]# xhost +
access control disabled, clients can connect from any host
[root@dbsrv1 ~]# |
|
| |
| |
|