Data Directory Configuration

The data directory contains the web application configuration files, log files, and any other information generated during runtime. Each deployed application uses its relative ./WEB-INF/config directory as the default data directory. This can be changed to a location outside of the deployed application directory by passing a Java option at startup and manually indicating the location for the data directory.

The main reason for setting the data directory outside of the deployed application is to preserve configuration settings when the application is re-deployed (for example, following an upgrade).

Data Directory Options

Each Kinetic Data application uses a unique Java option name to indicate the data directory. As stated previously, if the Java option is not defined, the deployed application will use it's relative ./WEB-INF/config directory by default.

Platform ComponentJava OptionDefault
Kinetic Request CE/Kinetic Platform-Dcom.kineticdata.core.dataDirectory/kinetic/WEB-INF/config
Kinetic Task-Dcom.kineticdata.task.dataDirectory/kinetic-task/WEB-INF/config
Kinetic Bridgehub-Dcom.kineticdata.bridgehub.dataDirectory/kinetic-bridgehub/WEB-INF/config
Kinetic Filehub-Dcom.kineticdata.filehub.dataDirectory/kinetic-filehub/WEB-INF/config
Kinetic Agent-Dcom.kineticdata.agent.dataDirectory/kinetic-agent/WEB-INF/config

Setting the Data Directory

The data directory can be set by passing a Java option when the web server running the application starts. There are various ways to do this depending on the web server used, how it is configured, and what operating system it is running on.

We won't be able to cover every scenario, but will try to give examples of some of the more common configurations.

All of the following examples assume the Apache Tomcat web server is used. Also a placeholder APPLICATION variable is used in the name of the Java option. Replace it with the corresponding Kinetic Platform Component you are configuring.

Linux / Unix Service

If you installed Tomcat with a package manager, it is likely installed to run as a service and the configuration files are most likely located in the /etc directory.

You may need to reference your package manager documentation to locate the exact configuration file. The following instructions are assuming a configuration file location of "/etc/tomcat/conf.d/tomcat.conf".

To set the data directory for a Linux / Unix service, follow these steps:

  1. Open terminal.
  2. Edit the "/etc/tomcat/conf.d/tomcat.conf" file and add the following data directory: export JAVA_OPTS=${JAVA_OPTS} -Dcom.kineticdata.APPLICATION.dataDirectory=/usr/local/kineticdata/APPLICATION
  3. Save the file and restart the Tomcat server.

Windows Service

To set the data directory for a Windows service, follow these steps:

  1. Open the Command Prompt and enter change directories to "%TOMCAT_HOME%\bin".
  2. Run the Tomcat Windows service manager program (tomcat8w.exe, tomcat9w.exe, etc.)
  3. Select the Java tab.
  4. Add the following to the Java Options input box:
    -Dcom.kineticdata.APPLICATION.dataDirectory="C:\usr\local\kineticdata\APPLICATION"
  5. Replace APPLICATION with the name of the application and the directory with the appropriate location as in the example below:
    export CATALINA_OPTS="${CATALINA_OPTS} -Dcom.kineticdata.bridgehub.dataDirectory=/Users/chadrehm/kineticdata/bridgehub"
    Note: Each property must be on a separate line)
  6. Click Apply.
  7. Select the General tab and restart the service.

Tar / Zip Archive Configuration

If you installed Tomcat from a tar or zip archive file, it is likely not configured to run as a service. It is usually controlled using the startup.sh/shutdown.sh (or startup.bat/shutdown.bat for Windows) files located in the $TOMCAT_HOME/bin directory.

When the Tomcat web server starts up, it first checks if there is a setenv.sh file (setenv.bat for Windows) located in $TOMCAT_HOME/bin directory. If the file exists, Tomcat will load that file and include any configuration settings that are defined. Simply create the setenv.sh / setenv.bat file if it doesn't already exist.

Linux / Unix

  1. Open terminal and cd to $TOMCAT_HOME/bin
  2. If the setenv.sh file doesn't exist, create it and set executable permissions:
    touch setenv.sh && chmod +x setenv.sh
  3. Edit the setenv.sh file, and add the data directory: export JAVA_OPTS=${JAVA_OPTS} -Dcom.kineticdata.APPLICATION.dataDirectory=/usr/local/kineticdata/APPLICATION
  4. Save the file and restart the Tomcat server

Windows

NOTE: This method will not work if running Tomcat as a Windows service. Please see the instructions for configuring the Windows Service.

  1. Open command prompt and cd to %TOMCAT_HOME%\bin
  2. If the setenv.bat file doesn't exist, create it:
    type NUL > setenv.bat
  3. Edit the setenv.bat file, and add the data directory:
    set JAVA_OPTS=%JAVA_OPTS% -Dcom.kineticdata.APPLICATION.dataDirectory="C:\usr\local\kineticdata\APPLICATION"
  4. Save the file and restart the Tomcat server