Configure Engagement Services - Tomcat_Server

To configure Engagement Services on Tomcat server, follow these steps:

  1. Go to <Tomcat Installation Directory>/bin
  2. Modify the catalina.bat  file with the following parameters:
    Parameters (for JVM)RequiredDescription
    -Xmx2048m YesMinimum Heap size: 2GB
    -Xms2048m YesMaximum Heap size: 2GB
    -XX:MaxPermSize=512m Yes One-fourth of the main Heap memory assigned
    -XX:+UseConcMarkSweepGCYes This is a recommended setting
    -XX:HeapDumpPath OptionalThis parameter is to get Heap Dump Path
    -Dkpns.configLocation Yes This is the directory where the configResource.properties, database.properties, and kmslog4j2. xml files must be placed.
    For example, if the location is /data/kpns-config, then you must specify the property as -Dkpns.configLocation=/data/kpns-config

    NOTE: -Dhibernate.dialect : This parameter mentioned in the above table is required only for Oracle database.

    Example: This is a sample for above mentioned parameters.

    
    
    set JAVA_OPTS="-server -Xms2048m -Xmx2048m -XX:NewSize=512m -XX:MaxNewSize=256m -XX:PermSize=512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/kpns/logs/heapdumps -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dnet.spy.log.LoggerImpl=net.spy.memcached.compat.log.Log4JLogger -Dfile.encoding=UTF8 -Dkpns.configLocation=/data/kpns-config/"
  3. Configure following jvm parameters:

    -Xms2048m –Xmx2048m -Dkpns.configLocation=<path of the kpns config location extracted from kpns-resources.tar>

  4. Configure JRE Home. Example: Set JRE_HOME=C:/Program Files/Java/jre1.8.0_221.
  5. Save the configuration.
  6. Configure the datasource.

    Database

    MySQL

    1. Copy mysql-connector-java-8.0.12.jar to <Tomcat installation directory>/lib
    2. Create the kpns.xml file in the <User install directory>\apache-tomcat-9.0.33\conf\Catalina\localhost folder.
    3. In the kpns.xml file, add the following data source configurations:
      
      
      <Resource name="jdbc/kpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="50" minIdle="1" maxIdle="10" testWhileIdle="true" maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="SELECT 1" removeAbandoned="false"
      removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://<host>:<port>/
      <database>?autoReconnect=true&amp;
      useUnicode=yes&amp;characterEncoding=UTF-8&amp;cachePrepStmts=true&amp;
      cacheCallableStmts
      =true&amp;cacheServerConfiguration=true&amp;useLocalSessionState
      =true&amp;elideSetAutoCommits
      =true&amp;alwaysSendSetIsolation=false&amp;enableQueryTimeouts=false&amp;
      rewriteBatchedStatements=true&amp;max_allowed_packet=104857600 "/>
    4. Replace the value given below in the above configuration.
      Configuration ValueDescription
      hostDatabase server IP/name
      portDatabase server port
      username Database user name
      passwordDatabase password
      databaseDatabase name

    Oracle

    1. Copy ojdbc6.jar to <Tomcat installation directory>/lib
    2. Create the kpns.xml file in the <User install directory>\apache-tomcat-9.0.33\conf\Catalina\localhost folder.
    3. In the kpns.xml file, add the following data source configurations:
      
      
      <Resource name="jdbc/kpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable"
      
      factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="30" minIdle="1" maxIdle="10" testWhileIdle="true"
      
      maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="select 1 from dual" removeAbandoned="false"
      
      removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@host:port:sid"/>
    4. Replace the value given below in the above configuration.
      Configuration ValueDescription
      hostDatabase server IP/name
      portDatabase server port
      usernamedatabase user name
      passwordDatabase password
      sid Oracle service id/name

    SQLServer

    1. Copy sqljdbc4-4.1.jarto <Tomcat installation directory>/lib
    2. Create the kpns.xml file in the <User install directory>\apache-tomcat-9.0.33\conf\Catalina\localhost folder.
    3. In the kpns.xml file, add the following data source configurations:
      
      
      <Resource name="jdbc/kpnsdb" auth="Container" type="javax.sql.DataSource" scope="Shareable"factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="50" minIdle="1" maxIdle="10" testWhileIdle="true" maxWait="10000" initialSize="10" testOnBorrow="true" validationQuery="SELECT 1" removeAbandoned="false"
      
      removeAbandonedTimeout="180" logAbandoned="false" username="username" password="password" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://host:port;databaseName=database;user=username;
      password=password;sendStringParametersAsUnicode=true;"/>
    4. Replace the value given below in the above configuration.
      Configuration ValueDescription
      hostDatabase server IP/name
      portDatabase server port
      usernameDatabase user name
      passwordDatabase password
      databaseDatabase name

Deploy Engagement Services

  1. To deploy Engagement Services .wars to Tomcat Server, copy and past the kpns.war file to the following location:
    <Tomcat installation directory>/webapps/
  2. After you deploy Engagement Services, complete the Engagement Services setup and start the Tomcat Server.

Post Upgrade

To start Tomcat server, post upgrade follow these steps:

  1. Clean up tomcat work directory.
    <Tomcat installation directory>/work/Catalina/<host>/
  2. Remove kpns folder in the above path and re-start Tomcat service.