VisibleThread -
Help Center Find helpful articles on different VisibleThread Products

Follow

How to configure VT Writer on Red Hat to connect to an external database

The default configuration when VT Writer is installed uses a local Postgres database. This guide shows you how to connect your VT Writer instance (installed on Red Hat) to an external Postgres database.

Note: in all snippets below replace <external-postgres-server-or-ip> with your external Postgres server hostname or IP.

Prerequisites

Your external Postgres version must be version 10.x and must have the postgres-contrib module installed.

Setup external VisibleThread database

Run the sql in this script as the postgres user to setup the external databases/users : vt-readability-db-setup.sql

psql -h <external-postgres-server-or-ip> -U postgres -f vt-readability-db-setup.sql

Backup/restore local DB to external DB

1.   On the local box, backup the DBs :

cd /opt/visiblethread
sudo su postgres
pg_dump vtreadability > /tmp/vtreadabilitybackup.sql
pg_dump vtinsights > /tmp/vtinsightsbackup.sql

2. On the local box, restore the backups to the external DB box :

psql -h <external-postgres-server-or-ip> -U vtinsights -f /tmp/vtinsightsbackup.sql vtinsights
psql -h <external-postgres-server-or-ip> -U vtreadability -f /tmp/vtreadabilitybackup.sql vtreadability

Point Readability app at external DB

Edit the vt_readability_service.sh file :

vi /opt/visiblethread/readability/vt_readability_service.sh

and remove  "--spring.datasource.primary." from the first java command "nohup java". From the same location copy/paste the below args and edit "<external-Database>" to reflect your database :

--spring.datasource.primary.url=jdbc:postgresql://<external-Database>:5432/vtreadability --spring.datasource.primary.username=vtreadability --spring.datasource.primary.password=vtreadability2017 --spring.datasource.secondary.url=jdbc:postgresql://<external-Database>:5432/vtinsights --spring.datasource.secondary.username=vtinsights --spring.datasource.secondary.password=vtinsights2018

remove  "--spring.datasource.primary." from the second java command "nohup java". From the same location copy/paste the below args and edit "<external-Database>" to reflect your database :

--spring.datasource.primary.url=jdbc:postgresql://<external-Database>:5432/vtreadability --spring.datasource.primary.username=vtreadability --spring.datasource.primary.password=vtreadability2017 --spring.datasource.secondary.url=jdbc:postgresql://<external-Database>:5432/vtinsights --spring.datasource.secondary.username=vtinsights --spring.datasource.secondary.password=vtinsights2018
Save and quit editing, then restart the service : 
systemctl restart vt-readability

Verify that VT WRiter is using the external DB

In your web browser, login to VT Writer and run a text scan.

If you run the following in the external database you should see the text you just analyzed :   

select title, started_date from scans order by id desc;

Recommended config for external Postgres

We recommend that you make this change to your external postgres.conf :

max_connections = 200
max_locks_per_transaction=500
Was this article helpful?
0 out of 0 found this helpful

Get Additional Help

Visit our Helpdesk for additional help and support.