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
Install the PostgreSQL server.
sudo yum install postgresql-server
Enable remote access by editing the following files:
In the
postgresql.conf
file, setlisten_addresses = '*'
.This configures the server to listen for connections from client applications on all available IP interfaces.
In the
pg_hba.conf
file, sethost 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.
Restart PostgreSQL.
service postgresql restart
Log in as the default user
postgres
.su - postgres
Create a database.
createdb <database_name>
Log in to the PostgreSQL server.
psql -h <database_ip> <database_name>
Add a database user.
CREATE USER <user_name> WITH PASSWORD '<password>';
Set the permissions on the new database to the user.
For example:
ALTER DATABASE <database_name> OWNER TO <user_name>;
Exit the
postgres
account.exit
You are returned to the root user role.
Navigate to ${INSTALLER_HOME}/ and open the
config.env.sh
file for editing.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.