Installing OpenIAM with a remote Postgres database in RPM environment
This document provides step-by-step instructions for installing OpenIAM using a remote PostgreSQL database. It is intended for system administrators and engineers who need to configure the application to connect to an externally hosted database environment. PostgreSQL is a powerful, open-source relational database management system (RDBMS) known for its reliability, extensibility, and strong compliance with SQL standards. By following this guide, you will learn how to prepare your environment, configure the required connection parameters, and complete the installation process with a remote PostgreSQL database backend.
Configuring Postgres for OpenIAM RPM Installation
Prerequisites
- A provisioned VM running CentOS / RHEL 9.
- Network access to the VM.
- SSH client (e.g., terminal or PuTTY).
- Sudo privileges.
- Setup a VM. Create a virtual machine (e.g., via Remmina or your virtualization platform) with the following example configuration:
- Private IP:
10.50.41.11 - Public IP:
68.170.153.144 - Username:
Administrator - Password:
<your-password>
Ensure the VM is accessible over the network.
- Connect to the VM via SSH. From your local machine, connect using:
ssh openiam@68.170.153.144
- Install PostgreSQL repository. Add the official PostgreSQL YUM repository:
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
- Disable Default PostgreSQL module to avoid conflicts with the following command.
sudo dnf -qy module disable postgresql
- Install PostgreSQL 15
sudo dnf install -y postgresql15-server
- Initialize the database cluster.
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
- Enable and start PostgreSQL
sudo systemctl enable --now postgresql-15systemctl status postgresql-15
- Prepare initialization SQL script. First, create the setup script:
sudo vi setup.sql
You can use the OpenIAM initialization script as a reference.
- Database creation.
- User creation.
- Permissions setup.
- Execute the initialization script. Move the script and set proper permissions with the following commands.
sudo cp /root/setup.sql /tmp/sudo chown postgres:postgres /tmp/setup.sqlsudo chmod 600 /tmp/setup.sql
Switch to the PostgreSQL user and execute the following.
sudo su - postgrespsql -f /tmp/setup.sql
If the file location is unknown use the following command.
sudo find / -name setup.sql 2>/dev/null
- Update role settings. Run the following commands to ensure proper schema access.
psql -d openiam -c "ALTER ROLE idmuser SET search_path TO public; GRANT USAGE ON SCHEMA public TO idmuser; GRANT CREATE ON SCHEMA public TO idmuser;"psql -d activiti -c "ALTER ROLE activiti SET search_path TO public; GRANT USAGE ON SCHEMA public TO activiti; GRANT CREATE ON SCHEMA public TO activiti;"psql -d groovy -c "ALTER ROLE groovy SET search_path TO public; GRANT USAGE ON SCHEMA public TO groovy; GRANT CREATE ON SCHEMA public TO groovy;"
- Verify PostgreSQL service with
systemctl status postgresql-15.service
Ensure the service is running without errors.
- Validate database setup. Access PostgreSQL CLI and list databases.
psql\l
Verify that the following databases exist:
openiamactivitigroovy
Exit CLI:
exit
- Your PostgreSQL instance is now ready to be used as a backend for OpenIAM. Once the database is ready
- Start the OpenIAM RPM installation process.
- When prompted, proceed with default selections where applicable.
- Configure the application to connect to the remote PostgreSQL database, namely ensure to
- Edit the below
conffile since the default value is MySQL. You will need to change the port from3306to5432and exportFLYWAY_DATABASE_TYPE=”postgres”.export OPENIAM_ENV= prerelease // if it is prerelease by default, it will be releasesudo vi /usr/local/openiam/env.conf
- Edit the below