DPS Installation and Setup
Also available as:
PDF
loading table of contents...

Chapter 3. Preparing Your External Database

Although DPS includes an embedded PostgreSQL database, the embedded database is intended for nonproduction use. You should use an external database for production environments. Currently, PostgreSQL database is supported. After installing the database following the instructions provided with the database software, you must set up the database for use with DPS.

Prerequisites

  • The PostgreSQL database must have been installed and properly configured for remote access.

  • A database must have been created.

  • A database user must have been created and assigned permissions for the new database.

Steps

  1. Install the PostgreSQL server.

    sudo yum install postgresql-server
  2. Enable remote access by editing the following files:

    1. In the postgresql.conf file, set listen_addresses = '*'.

      This configures the server to listen for connections from client applications on all available IP interfaces.

    2. In the pg_hba.conf file, set host all all 0.0.0.0/0 md5.

      IP address range can be modified as required, if known.

      This provides additional security by locking down which client machines can access the PostgreSQL server.

  3. Restart PostgreSQL.

    service postgresql restart
  4. Log in as the default user postgres.

    su - postgres
  5. Create a database.

    createdb <database_name>
  6. Log in to the PostgreSQL server.

    psql -h <database_ip> <database_name>
  7. Add a database user.

    CREATE USER <user_name> WITH PASSWORD '<password>';
  8. Set the permissions on the new database to the user.

    For example:

    ALTER DATABASE <database_name> OWNER TO <user_name>;
  9. Exit the postgres account.

    exit

    You are returned to the root user role.

  10. Navigate to ${INSTALLER_HOME}/ and open the config.env.sh file for editing.

  11. Modify the following settings to add the appropriate connection information.

    USE_EXT_DB="yes"
    DATABASE_URI="jdbc:postgresql://<host_name>:5432/<database_name>"
    DATABASE_USER="<user_name>"
    DATABASE_PASS="<password>"
    

Your external PostgreSQL is now configured so you can configure it during DPS installation.