Home

Installing PostgreSQL for Unravel on Azure HDI

You can either use the Unravel bundled PostgreSQL or external PostgreSQL version 12.

Installing and configuring Unravel bundled PostgreSQL on Azure HDI
  1. Install Unravel RPM. The Unravel bundled PostgreSQL is automatically installed.

  2. Run the following commands in the given sequence to set up and connect the bundled PostgresSQL

    bash /usr/local/unravel/dbin/postgres_setup.sh
    sudo chkconfig unravel_emdb on
    sudo /etc/init.d/unravel_emdb start
Installing and configuring external PostgreSQL 12 on Azure HDI
  1. Download PostgreSQL 12.

    sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
  2. Run the following commands to install:

    sudo yum install postgresql12-server
    sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
    sudo systemctl start postgresql-12
    sudo systemctl enable postgresql-12
Configuring PostgreSQL for Unravel on Azure HDI
  1. Run the following command to setup PostgreSQL.

    sudo -u postgres psql
  2. Run the following queries:

    create database unravel;
    
    create user unravel with encrypted password 'unraveldata';
    
    grant all privileges on database unravel to unravel;ALTER USER unravel WITH SUPERUSER;alter user unravel with createdb createrole inherit replication bypassrls;grant connect on database unravel to unravel;grant usage on schema public to unravel;
    
    grant all privileges on all tables in schema public to unravel;
    
    grant all privileges on all sequences in schema public to unravel;
    
    alter default privileges in schema public grant all privileges on tables to unravel;
    
    alter default privileges in schema public grant all privileges on sequences to unravel;
    
    grant pg_read_server_files to unravel;
    
    grant pg_write_server_files to unravel;
    
    grant pg_execute_server_program to unravel;
  3. Allow user/server to connect to the database using one of the following options:

    • Option 1: If PostgreSQL is installed on the same server as Unravel

      Add the following line in /var/lib/pgsql/12/data/pg_hba.conf,  in the first line of IPv4 local connections:

      host    all             unravel         127.0.0.1/32            md5

      For example:

      postgre-config.png
    • Option 2: If PostgreSQL is installed on a different server:

      1. Add the following line in /var/lib/pgsql/12/data/pg_hba.conf  in the first line of IPv4 local connections:

        host    all             unravel         <Unravel Server Internal IP Address>/32            md5
      2. Update /var/lib/pgsql/12/data/postgresql.conf and ensure listen_addresses = '*' is set to allow PostgreSQL to listen to all traffic.

  4. Add the following properties in unravel.properties:

    unravel.jdbc.username
    unravel.jdbc.password
    unravel.jdbc.url
    

    For example:

    unravel.jdbc.username=unravel
    unravel.jdbc.password=unraveldata
    unravel.jdbc.url=jdbc:postgresql://<IP address of the server where PostgreSQL is installed> /unravel
    
  5. Restart PostgreSQL.

    sudo systemctl restart postgresql-12.service
  6. Test and update db schema.

    /usr/local/unravel/install_bin/db_access.sh*
    /usr/local/unravel/dbin/db_schema_upgrade.sh
    
  7. Check if the tables are created using following command:

    echo '\dt' | /usr/local/unravel/install_bin/db_access.sh
    

    Note

    In case db_access.sh shows the error: /usr/local/unravel/emdb/bin/psql: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory, you must install postgresql11-libs:

    # sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
    # sudo yum install postgresql11-libs