v3.13: Deployment Instructions - OpenWIS/openwis GitHub Wiki

This page documents the necessary changes that need to be made to the deployment environment when upgrading from OpenWIS v3.12 to OpenWIS v3.13.

The instructions are broken up into the following sections:

  • The list of artefacts that need to be deployed.
  • The instructions that are to be performed before deploying the new artefacts.
  • The instructions that are to be performed after deploying the new artefacts but before starting up the system.
  • The instructions that are to be performed after OpenWIS has been started.

Please, please, PLEASE, read all instructions first!!

Artefacts that Need to be Deployed

The following artefacts have been changed and will require re-deployment when upgrading from v3.12 to v3.13:

  • openwis-user-portal.war
  • openwis-admin-portal.war
  • openwis-portal-solr.war
  • openwis-dataservices.ear
  • openwis-management-service.ear
  • openwis-securityservice.ear

Before Deploying the New Artefacts

These changes are to be made before deploying OpenWIS v3.13

Case Insensitive URNs: OWT-482

  1. Backup the database and Solr index.

  2. Install the PostgreSQL contrib package. The actual package name may depend on your system but it will have a name like postgresql-contrib. You will need to be the root user, or have sudo access to do this:

     $ sudo yum install postgresql-contrib
    
  3. Install CIText extensions from PostgreSQL contrib package. You will need to be the postgres user to do this. The actual path of the citext.sql script may vary depending on the OS distribution.

     $ psql OpenWIS -f '/usr/share/pgsql/contrib/citext.sql'
    
  4. Log into the OpenWIS database and run the following 3 SQL commands:

    alter table metadata alter column uuid type citext;
    alter table deletedmetadata alter column uuid type citext;
    alter table openwis_product_metadata alter column urn type citext;
  5. Download PostgreSQL JDBC drivers v8.4-702:

    $ wget http://jdbc.postgresql.org/download/postgresql-8.4-702.jdbc4.jar
    
  6. Log into the data services host and replace "EnterprisePlatform-5.1.0/jboss-eap-5.1/jboss-as/server/production/lib/postgresql-8.4-701.jdbc4.jar" with the newly downloaded drivers:

    $ rm EnterprisePlatform-5.1.0/jboss-eap-5.1/jboss-as/server/production/lib/postgresql-8.4-701.jdbc4.jar
    $ cp postgresql-8.4-702.jdbc4.jar EnterprisePlatform-5.1.0/jboss-eap-5.1/jboss-as/server/production/lib/.
    
  7. Open "EnterprisePlatform-5.1.0/jboss-eap-5.1/jboss-as/server/production/deploy/openwis-ds.xml" in an editor and add ?stringtype=unspecified to the end of the "connection-url" value. The XML should look like the following:

    <connection-url>jdbc:postgresql://dbserver:5432/OpenWIS?stringtype=unspecified</connection-url>

User Alarms

  1. As the "openwis" user, Log into the OpenWIS database and execute the following script:

    -- Creates the user alarms table
    --
    
    create table OPENWIS_USER_ALARM (
      ALARM_ID int8 not null,
      DATE timestamp,
      USER_ID varchar(255),
      REQ_TYPE varchar(255),
      REQ_ID int8,
      PROCESSED_REQ_ID int8,
      MESSAGE varchar(255),
    
      primary key (ALARM_ID)
    );
    
    create sequence USER_ALARM_SEQ;
    
    create index USER_ID_AND_REQ_TYPE_IDX on OPENWIS_USER_ALARM (user_id, req_type);

Harvesting Task Updates: OWT-468

The following query adds the field startingdate to the harvestingtask table.

  1. Log into the OpenWIS database and execute the following script:

    ALTER TABLE harvestingtask ADD startingdate character varying(24);

Cache Purge

OpenWIS no longer performs housekeeping of the cache directory on the file-system. There needs to be in place a mechanism that removes old files, thereby avoiding filling up of the file-system. This can be done using a cron that does the job:

  1. On the data service host, add the following cron jobs:

    # Remove all cache files older than 1 day
    */15 * * * * /usr/bin/find /cache -mmin +1500 -exec /bin/rm -rf {} \;
    # Remove empty cache folders
    */20 * * * * /usr/bin/find /cache -mindepth 1 -depth -type d -empty -exec rmdir {} \;
    

After Deploying the New Artefacts

These instructions are to be performed once the new artefacts have been deployed but BEFORE the application is started.

Removal of Version Numbers from WSDL URLs

  1. Go to each of the following configuration files and remove -1.0-SNAPSHOT or -develop-SNAPSHOT from each URL that ends with ?wsdl. Keep in mind URLs to third-party services (e.g. dissemination harnesses, local data sources, etc.) as they may need to stay as they are.

    The list of configuration files to change are:

    Service File
    Sercurity Service EnterprisePlatform-5.1.0/jboss-eap-5.1/jboss-as/server/production/deploy/openwis-securityservice-jndi-service.xml
    Data Services EnterprisePlatform-5.1.0/jboss-eap-5.1/jboss-as/server/production/deploy/openwis-dataservice-jndi-service.xml
    User Portal apache-tomcat-6.0.29/webapps/openwis-user-portal/WEB-INF/classes/openwis-metadataportal.properties
    Admin Portal apache-tomcat-6.0.29/webapps/openwis-admin-portal/WEB-INF/classes/openwis-metadataportal.properties

    Example: Subset of openwis-metadataportal.properties before the change:

    openwis.management.alertservice.wsdl=http://data:8180/openwis-management-service-openwis-management-service-ejb-1.0-SNAPSHOT/AlertService?wsdl
    openwis.management.controlservice.wsdl=http://data:8180/openwis-management-service-openwis-management-service-ejb-1.0-SNAPSHOT/ControlService?wsdl
    openwis.management.monitoringservice.wsdl=http://data:8180/openwis-management-service-openwis-management-service-ejb-1.0-SNAPSHOT/MonitoringService?wsdl
    openwis.management.disseminateddatastatistics.wsdl=http://data:8180/openwis-management-service-openwis-management-service-ejb-1.0-SNAPSHOT/DisseminatedDataStatistics?wsdl
    

    After removing -1.0-SNAPSHOT:

    openwis.management.alertservice.wsdl=http://data:8180/openwis-management-service-openwis-management-service-ejb/AlertService?wsdl
    openwis.management.controlservice.wsdl=http://data:8180/openwis-management-service-openwis-management-service-ejb/ControlService?wsdl
    openwis.management.monitoringservice.wsdl=http://data:8180/openwis-management-service-openwis-management-service-ejb/MonitoringService?wsdl
    openwis.management.disseminateddatastatistics.wsdl=http://data:8180/openwis-management-service-openwis-management-service-ejb/DisseminatedDataStatistics?wsdl
    

CheckAuthorization Service: OWT-464

For centres that provide Inspire services, the following configuration changes need to be done for the user and admin portal for the CheckAuthorization service.

  1. Create the WEB-INF/config-inspire.xml file containing the Jeeves service declaration:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <geonet>
      <services package="org.openwis.metadataportal">
        <service name="xml.CheckAuthorization" type="xml">
          <class name=".services.inspire.CheckAuthorization"/>
        </service>
      </services>
    </geonet>
  2. Add the following line to WEB-INF/userPortal-profiles.xml (for the user portal) and WEB-INF/adminPortal-profiles.xml to authorize access to this service for the Guest profile:

    <profile name="Guest">
      ...
      <allow service="xml.CheckAuthorization"/>  <!-- Add this line -->
    </profile>
  3. Add the following line to WEB-INF/config.xml file:

    <include>config-inspire.xml</include>

Case Insensitive URNs: OWT-482

  1. For both the user portal and the admin portal:
    1. Open "WEB-INF/config.xml" in a text editor.

    2. Locate the <resource> element that is enabled and has a <name> element with the value "main-db". Add the snip-it in the example below:

      <resource enabled="true">
         <name>main-db</name>
         ...
         <config>
           <user>openwis</user>
           <password>whatever</password>
           ...
           <!-- Add the following snip-it -->
           <properties>
             <property key="stringtype">unspecified</property>
           </properties>
           <!-- End snip-it -->
         </config>
      </resource>

User Alarms

  1. The following property will need to be added to "WEB-INF/classes/openwis-metadataportal.properties" in both the user and admin portal. The dataService is the hostname that the OpenWIS data services are deployed to:

    openwis.management.useralarmmanager.wsdl=http://{dataService}/openwis-dataservice-openwis-dataservice-cache-ejb/UserAlarmManager?wsdl
    

Harvest detailed reports: OWT-484

  1. Create a data directory on the admin portal server, which will be used to store the harvesting reports. This will be referred to as REPORTS_DIR.

  2. Add the following properties to "openwis-metadataportal.properties":

    openwis.metadataportal.report.file.path=<REPORTS_DIR>
    openwis.metadataportal.report.file.prefix=harvest
    openwis.metadataportal.report.file.ext=txt
  3. (optional) Add a cron to purge any harvest reports which are older than 7 days:

    # Remove harvesting logs older than 7 days at 00:30
    30 00 * * * /usr/bin/find <REPORTS_DIR>/harvest-*.txt -mtime +7 -exec rm {} \;
    

After Starting OpenWIS v3.13

These instructions are to be performed after starting OpenWIS 3.13 for the first time, but before announcing the system as available.

Case Insensitive URNs: OWT-482

  1. Log into the admin portal and rebuild the index. This may take a little bit of time so it might be necessary to tell users that the search capabilities will not be available for a little while.

More Information

More information about the changes these instructions relate to can be found here:

⚠️ **GitHub.com Fallback** ⚠️