Revision as of 06:49, June 22, 2017 by Peter Chaplin (talk | contribs)
Jump to: navigation, search

iWD History Node Migration Information

Automatic Database Schema Migration

You can configure iWD History Node to automatically migrate database schema at startup. To do this set the value of Configuration Server option [iWD]/migrate-schema to true. The default value is false.

Beside the automatic schema update, you can also migrate the schema using the command-line thus:

  1. On linux:
  2. ./iwd_history.sh -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db migrate
    
  3. On Windows (but works on Linux too):
  4. java -jar iwd_history.jar -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db migrate
    
Important
All commands like "./iwd_history.sh" and "java -jar iwd_history.jar" should be executed from the directory where History Node has been installed.

Troubleshooting

Schema migration can sometimes get stuck in a loop that prevents History Node starting. When this happens, the following entries are written to the log file:

INFO  [2017-05-26 10:10:57,497] com.genesyslab.iwd.history.HistoryApplication: Running database schema migration
INFO  [2017-05-26 10:11:03,313] liquibase: Waiting for changelog lock....
INFO  [2017-05-26 10:11:13,317] liquibase: Waiting for changelog lock....
...

To correct this, after stopping History Node application, do the following:

  • On Linux
  1. List any database locks.
  2. ./iwd_history.sh -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db locks --list
    
  3. Release the database locks.
  4. ./iwd_history.sh -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db locks --force-release
    
  • On Windows:
  1. List any database locks.
  2. java -jar iwd_history.jar -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db locks --list
    
  3. Release the database locks.</li
    java -jar iwd_history.jar -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db locks --force-release
    

Migrating GTL History Events

You can migrate GTL history events from the Event Log database to the History Node database by using History Node's built-in mechanism, which can be run with the following command:

  • On Linux:
./iwd_history.sh -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP events-migrate
  • On Windows:
java -jar iwd_history.jar -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP events-migrate

In order to use the events migration mechanism, the History Node application must be properly configured. tHE Mechanism itself is configured in the [event-log-migration] section of the yaml configuration file.

Warning
When events migration is in process, make sure that one or other of the following conditions applies:
  • No History Node applications are running.
  • If any History Node applications are running, they must have history events removal disabled (stop-processing option set to remove)
Comments or questions about this documentation? Contact us for support!