Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Configure Logical Replication

  1. inistiate initiate 2 new PostgresSQL database clusters

  2. Configure Publisher server with “wal_level=logical“

  3. Start the instance

  4. Create a database and the tables

...

Code Block
# start the database cluster
pg_ctl -D /var/lib/postgresql/daselement-munich_publication start

Create default postgres userPostgres User

Code Block
# access the database via psql
psql --port=5432 postgres

# create superuser for IT/admins and pipeline TDs
CREATE ROLE postgres LOGIN password 'postgres';
ALTER USER root CREATEDB;
ALTER USER root CREATEROLE;
ALTER USER root SUPERUSER;

# create user that is allowed to create new databases and read/write information
CREATE ROLE dbuser LOGIN password 'dbuser';
ALTER USER root CREATEDB;

# create replication user that is used by the other facilites
CREATE ROLE user_replication WITH REPLICATION LOGIN password 'password';

# exit the database from psql
\q

...

host = ip-of-publisher-postgres-server (e.g. the munich postgres server)

user = must be a superuser or replication role

Code Block
breakoutModefull-width
create subscription muc_subscription connection 'dbname=de_munich_vfxelements host=192.168.178.50 user=

...

user_replication port=5433' publication muc_pub;

Configure Logical Replication

...

Code Block
# create a symbolic link to initdb to access the command
sudo ln -s /usr/lib/postgresql/14/bin/pg_ctl /usr/local/bin

# now you can run ...
pg_ctl

Unable to connecto to server; FATAL: role “postgres“ does not exist

Seems like there is no user in the database called “postgres”.
To create a user use this command:

...