Data Analytics Studio Installation
Also available as:
PDF

For Debian

The commands to configure Postgres database are different for CentOS, Debian, and Ubuntu. Refer to the respective section to view the procedure for your platform.

  1. Install the supported version of Postgres using the following commands:
    echo deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main > /etc/apt/sources.list.d/postgresql.list
    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
    apt-get update
    apt-get install postgresql-9.6

    For more information about the supported version of Postgres, see the DAS Support Matrix.

  2. To make Postgres accessible to the DAS webapp and the DAS event processor host:
    1. Open the pg_hba.conf file for editing.
      vi /etc/postgresql/9.6/main/pg_hba.conf

      If the configuration file is not available at the above location, it could be located at /var/lib/postgresql/9.6/main/pg_hba.conf.

    2. Add lines similar to the following lines:
      local   all             <dbuser>                              md5
      host    all             <dbuser>      0.0.0.0/0               md5
      host    all             <dbuser>      ::/0                    md5
      local   all             postgres         ident
      
    3. Open the postgresql.conf file for editing.
      vi /etc/postgresql/9.6/main/postgresql.conf

      If the configuration file is not available at the above location, it could be located at /var/lib/postgresql/9.6/main/postgresql.conf.

    4. Add, update, or uncomment the listen_addresses line as follows:
      listen_addresses = '*'
  3. Start the Postgres database by running the following command as a Postgres user:
    service postgresql start

    Wait for the command to finish in some time or kill the command if it does not respond.

  4. Create roles in Postgres by running the following commands as a Postgres user:
    psql -tc "SELECT 1 FROM pg_database WHERE datname = <dbname>" | grep 1 || (
    psql -c "CREATE ROLE <dbuser> WITH LOGIN PASSWORD <dbpass>;" &&
    psql -c "ALTER ROLE <dbuser> CREATEDB;" &&
    psql -c "CREATE DATABASE <dbname>;" &&
    psql -c "GRANT ALL PRIVILEGES ON DATABASE <dbname> TO <dbuser>;")

    Replace <dbname> with the database name, <dbuser> with the database username and <dbpass> with the database password.