Striim 4.0.4 documentation

PostgreSQL setup in Linux or Windows

This will require a reboot, so it should probably be performed during a maintenance window.

  1. Install the wal2json plugin for the operating system of your PostgreSQL host as described in https://github.com/eulerto/wal2json.

  2. Edit postgressql.conf, set the following options, and save the file. The values for max_replication_slots and max_wal_senders may be higher but there must be one of each available for each instance of PostgreSQL Reader. max_wal_senders cannot exceed the value of max_connections.

    wal_level = logical
    max_replication_slots = 1
    max_wal_senders = 1
  3. Edit pg_hba.conf and add the following records, replacing <IP address> with the Striim server's IP address. If you have a multi-node cluster, add a record for each server that will run PostgreSQLReader. Then save the file and restart PostgreSQL.

    local  replication  striim  <IP address>/0  trust
    local  replication  striim                  trust
  4. Restart PostgreSQL.

  5. Enter the following command to create the replication slot (the location of the command may vary but typically is /usr/local/bin in Linux or C:\Program Files\PostgreSQL\<version>\bin\ in Windows.

    pg_recvlogical -d mydb --slot striim_slot --create-slot -P wal2json

    If you plan to use multiple instances of PostgreSQL Reader, create a separate slot for each.

  6. Create a role with the REPLICATION attribute for use by Striim and give it select permission on the schema(s) containing the tables to be read. Replace ****** with a strong password and myschema with the name of your schema.

    CREATE ROLE striim WITH LOGIN PASSWORD '******' REPLICATION;
    GRANT SELECT ON ALL TABLES IN SCHEMA public TO striim;