01 February 2013

1. TIF Server - Initial Setup

In order to use TIF, you need to configure a couple of things before taking it into use.

The main configuration files inside the TIF server is located under:

  • ${TIF_ROOT}/etc

  • ${TIF_ROOT}/modules/enovia/etc

The sub chapters describe the required setup.

In general, don’t modify the configuration files that are part of the TIF distribution. You can in most cases create a new file with a different name containing the customized configurations. For example:
  • Don’t modify the file ${TIF_ROOT}/etc/tif.properties directly.

    • Create instead a new file in the same directory called ${TIF_ROOT}/etc/tif.custom.properties.

  • Create/use the file ${TIF_ROOT}/modules/enovia/etc/module.properties instead

    • Create/use the file ${TIF_ROOT}/modules/enovia/etc/module.custom.properties instead.

  • And also the file ${TIF_ROOT}/modules/enovia/etc/tvc.properties

    • Create/use the file ${TIF_ROOT}/modules/enovia/etc/tvc.custom.properties instead.

These custom files are merged with the original file meaning that the content of the custom file takes precedence over the original file.

1.1. Macros in Property Files

The property values in the property files may contain macros that resolves to a value. The macro are defined using a ${} construct. You can reference other properties from the same file.

Example properties
one=1
two=2
three=3
twenty_three=${two}${three}
dont_resolve=$${two}

When resolving properties from ${TIF_HOME}/etc/tif.properties, then macros are also resolved from system properties. Example:

Resolve from system properties
directory=${user.home}/subdir

1.2. Multiple TIF Instances

To support horizonal scaling, you can setup multiple TIF instances.

Internally, a TIF instance is defined by its node id and instance id. The node id is equal to the hostname, which the TIF server binds to. The instance id is either automatically assigned or defined.

The data related to one TIF instance is stored below ${TIF_ROOT}/data/${NODE_ID}/${INSTANCE_ID}, and every TIF instance must have its own data directory.

The first time TIF is started up, TIF will assign an instance id (unless the INSTANCE_ID has been defined, see below how the instance id is resolved) and create the directory.

You should NOT try to start two different instances using the same node id and instance id combination. A simple (and naive!) solution is to duplicate the TIF installation directory and simply start up the instances in the normal way. The auto generated instance id’s will be unique, however, you then have two TIF installations to setup and configure so this is not recommended.

The recommended approach is to use one installation base, and simply use different start scripts to start each instance with. See below how to specify the instance-id within a start-script.

The ENOVIA Connector have some additional things to concern when setting up multiple instance. Please read more here.

1.2.1. Resolving the Instance Id

The instance id is default set to auto within the file ${TIF_ROOT}/etc/tif.properties.

If you want to change this value to something else, you should do so in the custom properties file ${TIF_ROOT}/etc/tif.custom.properties.

You can also provide this parameter as a runtime parameter in the TIF start script like this:

java -Dtif.instance.id=auto -Dtif.http.port=8080 ...

The latter is useful in case you have one installation base and via different start scripts wants.

1.2.2. Production Mode

Per default, TIF starts in production mode. To start TIF in development mode, use the "productionMode" parameter.

Either set this property in ${TIF_HOME}/etc/tif.custom.properties, or as a Java system parameter as shown below.

java -Dtif.productionMode=false ...

1.2.3. HTTP / HTTPS Port

Running different TIF instances on the same network address requires you to configure TIF to bind the HTTP/HTTPS server to a unique port.

This is then set via these Java system parameters:

java -Dtif.https.port=443 -Dtif.http.port=8181 ...

1.2.4. Shutdown Listen Port

TIF listens for shutdown signals by default at port 9005. To change this port, which is needed in case you launch multiple TIF instances on the same machine, set the value as a Java system parameter like this:

java -Dtif.shutdownListener.port=9006 ...

1.2.5. Example Start Script

Below is an example start script where additional parameters are defined.

@echo off
setlocal

set ENOVIA_HOME=c:\apps\ENOVIA\V6R2016X\Server
set JAVA_HOME=c:\apps\jdk64\7
set WEBAPP_ROOT=c:\webapps\2016X

set EXTRA_OPTS=-Dtif.instance.id=TIF-2 -Dtif.http.port=8282 -Dtif.shutdownListener.port=9005 (1)
set START_ARGS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n (2)
set STOP_ARGS= (3)

call tif.bat run
1 EXTRA_OPTS is handled in the tif.bat script and is appended to the Java argument list
2 START_ARGS works similar to EXTRA_OPTS, however they are only set if the TIF server is started
3 STOP_ARGS are only added to the argument list if the TIF server is stopped