OpenLSD ENOpenLSD

Download at SourceForge.net

ConceptLogic Technical Aspects Future Plan Howto Benchmarks
Home OpenLSD OpenLSM OpenR66

HowTo-Configuration-Files

How to modify configuration files

context.xml file from tomcat/conf directory:

Here you will have to define the database access through the servlet in a DataSourceFactory. You can change the value and also the localization of this definition if you know what you do.

 

<!-- The contents of this file will be loaded for each web application -->

<Context>

 

    <!-- Default set of monitored resources -->

    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <Resource

      name="jdbc/poollsd"

      auth="Container"

      type="javax.sql.DataSource"

      factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"

      maxActive="20"

      maxIdle="2"

      username="lsd"

      maxWait="5000"

      driverClassName="oracle.jdbc.OracleDriver"

      password="lsd"

      url="jdbc:oracle:thin:@localhost:1521:lsd"/>

    <!--Uncomment this to disable session persistence across Tomcat restarts -->

    <!--

    <Manager pathname="" />

    -->

 

</Context>

 

Here are the possible values:

  • name: the name as seen by the servlet for the DataSource
  • maxActive, maxIdle, mawWait: specify the maximum number of active database connection, of unactive but in the spool connection and the time before the connection is over
  • username and password: specify the user and password for the database access
  • url: specify the url in jdbc format to access to the database (here Oracle example)

openlsd.cfg

This file defines the LSD Server configuration (ports, functions, but no database), legacy configuration files inclusions and Log4j configuration file inclusion.

 

<openlsd>

      <server>

            <timeout>60</timeout>

            <blocksize>16277</blocksize>

            <fastmd5path>D:/ALLJARS/lib/arch/win32_x86/MD5.dll</fastmd5path>

            <getfilepath>D:/LSD/getFileFromPath3.exe</getfilepath>

            <runlsdpath>D:/Source/OpenLSD/Scripts-Ora/LSDServerOra.bat</runlsdpath>

            <runlsdcheckpath>D:/Source/OpenLSD/Scripts-Ora/LSDCheckInDbThreadedOra.bat</runlsdcheckpath>

            <dfpath>df -kP</dfpath>

            <dupath>D:/LSD/openlsddu.exe</dupath>

                <slf4jpath>D:/LSDORA/slf4j-server.xml</slf4jpath>

                <httpport>8085</httpport>

      </server>

      <admin>

            <port>8082</port>

            <compressionserver>false</compressionserver>

            <compressionclient>false</compressionclient>

            <password>abcdefghijkl</password>

            <funcadmin>true</funcadmin>

            <funcdel>false</funcdel>

            <funcget>true</funcget>

            <funcgetna>true</funcgetna>

            <funcinfo>true</funcinfo>

            <funcmove>true</funcmove>

            <funcput>true</funcput>

            <funcputna>true</funcputna>

            <funcputfile>true</funcputfile>

      </admin>

      <client>

            <port>8084</port>

            <compressionserver>false</compressionserver>

            <compressionclient>false</compressionclient>

            <funcadmin>false</funcadmin>

            <funcdel>false</funcdel>

            <funcget>true</funcget>

            <funcgetna>true</funcgetna>

            <funcinfo>false</funcinfo>

            <funcmove>false</funcmove>

            <funcput>true</funcput>

            <funcputna>true</funcputna>

            <funcputfile>true</funcputfile>

      </client>

      <clientcomp>

            <port>8081</port>

            <compressionserver>true</compressionserver>

            <compressionclient>true</compressionclient>

            <funcadmin>false</funcadmin>

            <funcdel>false</funcdel>

            <funcget>true</funcget>

            <funcgetna>true</funcgetna>

            <funcinfo>false</funcinfo>

            <funcmove>false</funcmove>

            <funcput>true</funcput>

            <funcputna>true</funcputna>

            <funcputfile>true</funcputfile>

      </clientcomp>

      <protected>

            <port>8083</port>

            <compressionserver>false</compressionserver>

            <compressionclient>false</compressionclient>

            <password>abcdefghijkl</password>

            <funcadmin>false</funcadmin>

            <funcdel>true</funcdel>

            <funcget>false</funcget>

            <funcgetna>false</funcgetna>

            <funcinfo>true</funcinfo>

            <funcmove>true</funcmove>

            <funcput>true</funcput>

            <funcputna>true</funcputna>

            <funcputfile>true</funcputfile>

      </protected>

      <legacy>

            <file>D:/LSDORA/legacy1.xml</file>

            <file>D:/LSDORA/legacy2.xml</file>

      </legacy>

</openlsd>

 

 

Here are the possible values:

  • Server part
    • timeout: specify the timeout time of an idle connection in second in OpenLSD
    • blocksize: specify the default block size for OpenLSD (size of minimal message), should be a multiple of 8K minus 104 bytes. Usually set as 16K minus 104 bytes so 16277.
    • fastmd5path: specify the path to the filename for the fastMD5 C library for the fastMD5 jar library
    • getfilepath: specify the path to the filename for the getfilepath C command
    • runlsdpath: specify the full command to start OpenLSD from Tomcat
    • runlsdcheckpath: specify the full command to check consistency in OpenLSD and the database
    • dfpath: path and args for ‘df’ command
    • dupath: path and args for ‘du’ command
    • log4jpath: specify where is the configuration file for log4j support
  • Clients part: admin, client, clientcomp (compressed client) and protected part
    • port: specify on which port this client is listening
    • compressionserver and compressionclient: true to enable compression, false to disable compression (in general it should be disabled)
    • severall functions: for each function, specify if this server will enable or not the support of this function
      • admin (stop, start)
      • delete
      • get and get with NoAck
      • info
      • move
      • put and put with NoAck and putfile (local put)
  • Legacy part
    • file: specify where is the corresponding legacy configuration file

The mapping of the function should be as follow, but one can change this according to specific needs. We specify the necessity of this support.

 

Client

Port

Compression

Admin

Del

Get

GetNa

Info

Move

Put

PutNa

PutFile

ADMIN

X

-

X

-

-

-

X

X

-

-

-

Necessity

Y

 

Y

 

 

 

Y

Y

 

 

 

CLIENT

X

-

-

-

X

X

-

-

X

X

X

Necessity

N

 

 

 

Y

Y

 

 

Y

Y

Y

COMP

X

X

-

-

X

X

-

-

X

X

X

Necessity

N

Y

 

 

Y

Y

 

 

Y

Y

Y

PROTECTED

X

-

-

X

X

X

X

X

X

X

X

Necessity

Y

 

 

Y

Y

Y

Y

Y

Y

Y

Y

 

 

legacy<n>.xml

This file defines the Legacy storage configuration (mounting point, size, crypto, …) that are included in the openlsd.xml file.

 

<legacy>

      <lid>-9223372036854775807</lid>

      <name>MON LEGACY1</name>

      <base>d:/LSDORA/Legacy1/files</base>

      <outbase>d:/LSDORA/Legacy1/out</outbase>

      <storagesize>100000000</storagesize>

      <crypted>false</crypted>

      <key></key>

      <status>true</status>

</legacy>

 

Here are the possible values:

  • lid: the numeric unique id of this legacy
  • name: the logical name of this legacy
  • base: the path of the base of all storages of this legacy
  • outbase: the path of the base for the outbase storage of this legacy (export, temporary, …)
  • storagesize: the size of each storage of this legacy (should be 10% lower than real filesystem size)
  • crypted: set if this legacy is crypted (cannot be changed once set)
  • key: the associated key of this legacy (cannot be changed once set)
  • status: the associated status, True meaning fully opened, False meaning close to any write or delete operations except move operations, read operations are always allowed

openlsddb.cfg

This file defines the LSD Clients configuration (database access and log4j configuration file inclusion).

 

<openlsddb>

      <driver>oracle.jdbc.OracleDriver</driver>

      <server>jdbc:oracle:thin:@localhost:1521:lsd</server>

      <user>lsd</user>

      <password>lsd</password>

      <timeoutcon>3000</timeoutcon>

      <timeout>60</timeout>

      <blocksize>16277</blocksize>

        <slf4jpath>D:/LSDORA/slf4j-client.xml</slf4jpath>

      <business>openlsd.business.LSDBusinessImpl</business>

</openlsddb>

 

 

Here are the possible values:

  • driver: which class for the JDBC driver
  • server: the connect string
  • user: the user for the database
  • password: the associated password
  • timeoutcon: timeout in millisecond when connection is to be done
  • timeout: timeout in second of an idle connection
  • blocksize: specify the default block size for OpenLSD (size of minimal message), should be a multiple of 8K minus 104 bytes. Usually set as 16K minus 104 bytes so 16277.
  • log4jpath: specify where is the configuration file for log4j support
  • business: specify which class implements the LSDBusiness abstract class, which must be in the classpath

For PostGreSQL, only two values need to be changed:

      <driver>org.postgresql.Driver</driver>   

      <server>jdbc:postgresql://localhost:5432/lsd</server>     

 

 

slf4j.lcf

Each type of client has its own slf4j.lcf configuration file. So there is one for the Server, one for the Client and one for the Web support.

 

Server version: rotation each day on files

<configuration>

  <appender name="FILE"

    class="ch.qos.logback.core.rolling.RollingFileAppender">

    <file>D:/LSDORA/log/LSDServer2.log</file>

      <Append>true</Append>

      <BufferedIO>false</BufferedIO>

    <ImmediateFlush>true</ImmediateFlush>

    <rollingPolicy

      class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

      <FileNamePattern>

        D:/LSDORA/log/LSDServer2-%d{yyyy-MM-dd}.log

      </FileNamePattern>

    </rollingPolicy>

    <layout class="ch.qos.logback.classic.PatternLayout">

      <Pattern>

        %date %level [%thread] %logger [%file %method : %line] %msg%n

      </Pattern>

    </layout>

  </appender>

  <root>

    <level value="warn" />

    <appender-ref ref="FILE" />

  </root>

</configuration>

 

Client version: rotation each day on files and output

<configuration>

  <appender name="FILE"

    class="ch.qos.logback.core.rolling.RollingFileAppender">

    <file>D:/LSDORA/log/LSDClient2.log</file>

      <Append>true</Append>

      <BufferedIO>false</BufferedIO>

    <ImmediateFlush>true</ImmediateFlush>

    <rollingPolicy

      class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

      <FileNamePattern>

        D:/LSDORA/log/LSDClient2-%d{yyyy-MM-dd}.log

      </FileNamePattern>

    </rollingPolicy>

    <layout class="ch.qos.logback.classic.PatternLayout">

      <Pattern>

        %date %level [%thread] %logger [%file : %line] %msg%n

      </Pattern>

    </layout>

  </appender>

  <appender name="STDOUT"

    class="ch.qos.logback.core.ConsoleAppender">

    <ImmediateFlush>true</ImmediateFlush>

    <layout class="ch.qos.logback.classic.PatternLayout">

      <Pattern>%date %level [%thread] %logger [%file %method : %line] %msg%n</Pattern>

    </layout>

  </appender>

  <root>

    <level value="debug" />

    <appender-ref ref="FILE" />

      <appender-ref ref="STDOUT" />

  </root>

</configuration>

 

Web version: rotations each day on files only

<configuration>

  <appender name="FILE"

    class="ch.qos.logback.core.rolling.RollingFileAppender">

    <file>D:/LSDORA/log/LSDWeb.log</file>

      <Append>true</Append>

      <BufferedIO>false</BufferedIO>

    <ImmediateFlush>true</ImmediateFlush>

    <rollingPolicy

      class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

      <FileNamePattern>

        D:/LSDORA/log/LSDWeb-%d{yyyy-MM-dd}.log

      </FileNamePattern>

    </rollingPolicy>

    <layout class="ch.qos.logback.classic.PatternLayout">

      <Pattern>

        %date %level [%thread] %logger [%file : %line] %msg%n

      </Pattern>

    </layout>

  </appender>

  <root>

    <level value="warn" />

    <appender-ref ref="FILE" />

  </root>

</configuration>


 

Adapt any value as wanted in openlsd.common.LSDConstants

Some values can be changed to allow different behaviour.

 

Logging properties:

      /**

       *  Mode debug (very verbose)

       */

      public static final boolean DEBUG = false;

      /**

       *  Mode logging (partially verbose)

       */

      public static final boolean LOGGING = false;

 

External C functions:

      /**

       * Use C functions : only for some specific functions in Server

       */

      public static final boolean useCFunctions = false;

 

Size of internal buffers:

      /**

       * Default size for buffers (NIO)

       */

      public static final int buffersizedefault = 65536; // 64K

 

Limit Size for switching between Ack and No Acked method for Web retrieve:

      /**

       *  Limit size where NoAck method will be used (in Web retrieve functions)

       */

      public static final int WEBRETRIEVENOACKLIMIT = 1024000;

 

Time limit before retry and limit number of retry:

      /**

       *  Time elapse for retry in ms

       */

      public static final long RETRYINMS = 10;

      /**

       * Number of retry before error

       */

      public static final int RETRYNB = 3;

 

Size of blocks in the filesystems:

      /**

       * Size of one block in the filesystem: could be later in the Legacy

       * definition.

       * JFS2 supports multiple file system block sizes of 512, 1024, 2048, and

       * 4096, with 4 KBytes as standard.

       * EXT3 supports multiple file system block sizes of 1024, 2048 and 4096,

       * with 4 KBytes as standard.

       * NTFS supports sizes of clusters from 512 bytes up to 64 KBytes, with 4

       * KBytes as standard.

       */

      public static final long sizeblockfs = 4096; // 4K by default

      /**

       * Size of one block in the filesystem (double version): could be later in

       * the Legacy definition.

       */

      public static final double DSIZEBLOCKFS = 4096.0;

 

If you use JDK6 or greater, you can enable this value and uncomment the following code:

 

      /**

       * Is this running under JAVA6 (some optimisation)

       */

      public static final boolean ISJAVA6 = false;

     /**

       * Get the Global Used and Free space in KB ONLY FROM JDK6

       * @param storage

       * @return the global and used and free space in KB in long[] or null

       */

      private static double[] getGlobalUsedFreeSpaceJava6(File storage) {

            double []size = new double[3];

            /* JDK6 ONLY

            size[0] = storage.getTotalSpace();

            size[1] = size[0] - storage.getUsableSpace();

            size[2] = storage.getFreeSpace();

            */

            return size;

      }