Installing and Configuring PostgreSQL

You can install and configure PostgreSQL 9.6.

Install PostgreSQL

If you are using MySQL instead of PostgreSQL, you may skip these steps. See the instructions for MySQL in the previous section.
  1. Install Red Hat Package Manager (RPM) according to the requirements of your operating system:
    yum install https://yum.postgresql.org/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
  2. Install PostgreSQL version 9.6:
    yum install postgresql96-server postgresql96-contrib postgresql96
  3. Initialize the database:

    For example, if you are using CentOS 7, use the following syntax:

    /usr/pgsql-9.6/bin/postgresql96-setup initdb
  4. Start PostgreSQL.
    For example, if you are using CentOS 7, use the following syntax:
    systemctl enable postgresql-9.6.service
    systemctl start postgresql-9.6.service
  5. Verify that you can log in:
    sudo su postgres
    psql

Configure PostgreSQL to Allow Remote Connections

It is critical that you configure PostgreSQL to allow remote connections before you deploy CEM. If you do not perform these steps in advance of installing the EFM Server, the installation fails.
  1. Open /var/lib/pgsql/9.6/data/pg_hba.conf and update to the following:
    # "local" is for Unix domain socket connections only
    local all all trust
    
    
    # IPv4 local connections:
    host all all 0.0.0.0/0 trust 
    
    
    # IPv6 local connections: 
    host all all ::/0 trust
  2. Open /var/lib//pgsql/9.6/data/postgresql.conf and update to the following:
    listen_addresses = '*'
  3. Restart PostgreSQL.
    systemctl stop postgresql-9.6.service
    systemctl start postgresql-9.6.service 

Configure PostgreSQL for use by EFM

  1. Log in to PostgreSQL:
    sudo su postgres
    psql
  2. Create a database called efm with the password efm:
    create database efm;
    CREATE USER efm WITH PASSWORD 'efmPassword';
    GRANT ALL PRIVILEGES ON DATABASE "efm" to efm;

Configure the EFM database properties

  1. Configure the database properties in the efm.properties file:
    efm.db.url=jdbc:postgresql://localhost/efm
    efm.db.driver.class=org.postgresql.Driver
    efm.db.username=efm
    efm.db.password=efmPassword