For the components of the identity service to work, you need to configure the connection to the PostgreSQL databases on the primary and backup nodes and manually create the databases that will store information about LDAP users and groups in PostgreSQL version 15. For more information on managing databases, please refer to documentation on the official PostgreSQL website.
To set up a connection to PostgreSQL databases:
sudo apt install postgresql -y
sudo systemctl disable postgresql
sudo systemctl stop postgresql
/etc/postgresql/15/main
directory, open the pg_hba.conf
file for editing and add the following lines to the replication
section:host replication all <
IP address of the primary node
> trust
host replication all <
IP address of the backup node
> trust
/etc/postgresql/15/main
directory, open the postgresql.conf
file and change the value of the wal_level
setting while commenting out the unix_socket_directories
line as follows:wal_level = replica
#unix_socket_directories
/etc/parsec
directory, open the mswitch.conf
file for editing and change the value of the zero_if_notfound
parameter to yes
to connect to the databases.The PostgreSQL database connection is configured. Proceed to create databases for the user identity service components.
To create databases for user information:
sudo systemctl start postgresql
sudo -u postgres psql
CREATE USER uaws WITH PASSWORD '<
password
>';
usermpp
by running the following query:CREATE DATABASE usermap;
uaws
user permissions to manage the usermap
database:ALTER DATABASE usermap OWNER TO uaws;
usermap
database by running the following query:\c usermap;
usermap
database, create a table named log_events
for user event logging by running the following query:CREATE TABLE log_events (id SERIAL PRIMARY KEY, userName VARCHAR(255) NOT NULL, domain VARCHAR(255) NOT NULL, ipAddress VARCHAR(15) NOT NULL, addTime TIMESTAMP NOT NULL, updateTime TIMESTAMP, expiryTime TIMESTAMP, status VARCHAR(16) NOT NULL, receivedTime TIMESTAMP, UNIQUE (userName, domain, ipAddress));
uaws
user permissions to manage the log_events
table:ALTER DATABASE public.log_events OWNER TO uaws;
groupapp
by running the following query:CREATE DATABASE groupapp;
uaws
user permissions to manage the groupapp
database:ALTER DATABASE groupapp OWNER TO uaws;
groupapp
database by running the following query:\c groupapp;
groupapp
database, do the following:groups
for information about LDAP user groups by running the following query:CREATE TABLE groups(id SERIAL PRIMARY KEY, name VARCHAR(255) NOT NULL, dn VARCHAR(255), status VARCHAR(15) NOT NULL, lastRequestTime TIMESTAMP NOT NULL, updatedTime TIMESTAMP, createdTime TIMESTAMP, deletedTime TIMESTAMP);
users
for information about LDAP users by running the following query:CREATE TABLE users(id SERIAL PRIMARY KEY, username VARCHAR(255) NOT NULL, samaccountname VARCHAR(255) NOT NULL, groupId INTEGER, status VARCHAR(15) NOT NULL, updatedTime TIMESTAMP, createdTime TIMESTAMP, deletedTime TIMESTAMP);
uaws
user permissions to manage the groups
table:ALTER TABLE public.groups OWNER TO uaws;
uaws
user permissions to manage the users
table:ALTER TABLE public.users OWNER TO uaws;
CREATE ROLE replicator WITH REPLICATION LOGIN PASSWORD <
password
>;
\q
sudo rm -rf /var/lib/pgsql/tmp/PGSQL.lock
sudo -u postgres sh -c "rm -rf /var/lib/postgresql/*/main/*"
sudo -u postgres pg_basebackup -h <
IP address of the primary node
> -D /var/lib/postgresql/15/main -P
sudo systemctl stop postgresql
The databases are prepared and can be used by the components of the user identity service.
Page top