Configuring a PostgreSQL database for Smart IT installation
To prepare your PostgreSQL database
As a database administrator, install at least one instance of the PostgreSQL database. For more information, see PostgreSQL documentation.
- Update the pg_hba.conf file.
The pg_hba.conf file stores the client authentication information. Perform the following steps to edit the pg_hba.conf file and modify the IP address and password-based authentication method in the local and host records:Open the pg_hba.conf file by using the following command:
#vi /var/lib/pgsql/10/data/pg_hba.confUpdate the local and host records to use md5 authentication, as follows:
local all all md5
host all all 0.0.0.0/0 md5Do not delete the remaining records in the pg_hba.conf file. You must manually update these values and not copy the values from this file.
- Update the postgresql.conf file:
Open the postgresql.conf file by using the following command:
#vi /var/lib/pgsql/10/data/postgresql.confUpdate the listen_addresses = 'localhost' parameter as follows:
listen_addresses = '*'Stop the PostgreSQL server and restart it by using the following commands:
#service postgresql-10 stop
#service postgresql-10 start
To pre-create a PostgreSQL database for Smart IT installation
Perform the following steps to create a PostgreSQL database and user for Smart IT.
Log in as a root user and switch to the Postgres account:
su - postgresLogin to postgres command line and specify the password :
psql -h localhost -U postgresExecute the following script to create Smart IT database and users:
CREATE DATABASE "SmartIT" ENCODING = 'UTF8' CONNECTION LIMIT = -1;
\c SmartIT;
CREATE SCHEMA "openfire";
CREATE SCHEMA "SmartIT_System";
CREATE SCHEMA "SmartIT_Business";
CREATE USER "openfire" WITH PASSWORD 'SmartIT';
CREATE USER "SmartIT_System" WITH PASSWORD 'SmartIT';
CREATE USER "SmartIT_Business" WITH PASSWORD 'SmartIT';
grant all privileges on database "SmartIT" to "openfire";
grant all privileges on database "SmartIT" to "SmartIT_System";
grant all privileges on database "SmartIT" to "SmartIT_Business";
grant all privileges on schema "openfire" to "openfire";
grant all privileges on schema "SmartIT_System" to "SmartIT_System";
grant all privileges on schema "SmartIT_Business" to "SmartIT_Business";
Where to go from here