Configure a PostgreSQL Event Datastore

HPE MMAP uses a database to store analytic events generated by Media Server (for example, transcription data). By default, HPE MMAP is configured to use an embedded H2 database that can be used for initial testing purposes; however, you must install and configure a PostgreSQL event datastore for use in production systems.


Install PostgreSQL

Install the PostgreSQL database server for your platform. For more information, see your PostgreSQL documentation.

During installation and configuration of PostgreSQL, take note of the following items. These items are required later during configuration of HPE MMAP to use the PostgreSQL server.

Configure HPE MMAP to use PostgreSQL

Configure HPE MMAP to use PostgreSQL as its event datastore.

To configure HPE MMAP to use PostgreSQL

  1. In the /hpemmap/jboss-eap-6.2 directory created in step 1 of Install HPE Media Management and Analysis Platform, navigate to the modules/org subdirectory.

  2. In the modules/org directory, create a directory structure as follows:

  3. Copy the PostgreSQL JDBC driver .jar file into the postgresql/main directory.

  4. In the main directory, create a file named module.xml with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.0" name="org.postgresql">
    <resource-root path="postgresql-9.1-903.jdbc4.jar"/>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
    NOTE: The <resource-root path="postgresql-9.1-903.jdbc4.jar"/> parameter is the .jar file name for the PostgreSQL JDBC driver version. Replace resource-root path with the .jar file name downloaded in Prerequisites.
  5. Save the module.xml file.

  6. In the /hpemmap/jboss-eap-6.2 directory, navigate to the standalone/configuration directory and open avalanche.xml in a text editor.

    1. Add three new system properties in the <system-properties> section:

      <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL82Dialect"/>
      <property name="avalanche.vms.database.timezone" value="UTC"/>
      <property name="" value=""/>
    2. Replace the following <datasources> section that uses H2:

      <datasource jndi-name="java:/datasources/EventsDS" pool-name="EventsDS" enabled="true" use-java-context="true">
      <connection-url>jdbc:h2:file:${}/h2/events;AUTO_SERVER=TRUE; INIT=runscript from 'classpath:/com/autonomy/avalanche/persistence/h2/init.sql'\;</connection-url>

      with the following datasource that uses PostgreSQL:

      <datasource jndi-name="java:/datasources/EventsDS" pool-name="EventsDS" enabled="true" use-java-context="true">

      In the connection-url section, replace the following settings with the information that you saved when you installed PostgreSQL.

      • Replace host with the host name of your server.

      • Replace port with the port number that the PostgreSQL communicates on.

      • Replace events with the database name.

      In the security section, replace the following settings with the information that you saved.

      • Replace user-name with the user name of a user account created for the PostgreSQL database.

      • Replace password with the password of the user account.

      For example:

      <datasource jndi-name="java:/datasources/EventsDS" pool-name="EventsDS" enabled="true" use-java-context="true">
    3. Add a new driver property in the <drivers> section:

      <driver name="postgresql" module="org.postgresql">
  7. Save the avalanche.xml file.

  8. Restart the JBoss application server.

Create the HPE MMAP Database Schema in PostgreSQL

The HPE MMAP archive contains the following SQL scripts that create the HPE MMAP database schema in PostgreSQL:

To run the SQL scripts on Windows

To run the SQL scripts on UNIX

  1. Run the script schema.sql by typing the following commands, where <database> is the database name.

    sudo su - postgres
    psql -hlocalhost -d<database> -f schema.sql
    TIP: The -f parameter accepts either an absolute path or a path relative to the current directory. For more information about psql parameters, refer to the PostgreSQL documentation.

    The script runs against the PostgreSQL instance listening on the default port (5432).

  2. Run the scripts stored-procedures.sql, searchable-text.sql, and partition-word-table.sql:

    psql -hlocalhost -d<database> -f stored-procedures.sql
    psql -hlocalhost -d<database> -f searchable-text.sql
    psql -hlocalhost -d<database> -f partition-word-table.sql