Versions Compared

Key

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

...

  1. Support Postgresql version

    1. v10 - v14

    2. Both servers should be running the same version.

  2. Network connectivity

    1. The servers must need to be on the same network and have proper consistent network connectivity.

    2. Primary server should have proper Ensure that the primary server has the correct pg_hba.conf settingsettings.

CSD for streaming Mode

Drawio
mVer2
zoom1
simple0
inComment0
custContentId3678240842
pageId3673391206
lbox1
diagramDisplayNamecsd-archive.drawio
contentVer4
revision5
baseUrlhttps://dbvisit.atlassian.net/wiki
diagramNamecsd-archive.drawio
pCenter0
width681
links
tbstyle
height1131

  1. Trigger CSD in streaming mode

  2. Create Replication Slot on Primary

    1. Run the following SQL query on the primary server to create a physical replication slot named SLOT_NAME

      Code Block
      SELECT * FROM pg_create_physical_replication_slot(SLOT_NAME, false, false) WHERE NOT EXISTS (SELECT * FROM pg_replication_slots WHERE slot_name = SLOT_NAME)
  3. On Primary MP find and Tar the postgresql config files, IncludingTar PostgreSQL Config Files on Primary:

    1. postgres.conf

    2. pg_ident.conf

    3. pg_hba.conf

  4. On Standby MP receive tar ball of postgresql Transfer Config Files to Standby

    1. Transfer the tarball containing PostgreSQL config files from

    Primary
    1. the primary server to the standby server

  5. Data directory setup: Directory Setup Using pg_basebackup to initialize
    Initiate a streaming backup from Standby to Primary to retrieve all files in data directory from Primary with the Replication Slot created the standby server to the primary server. This process retrieves all files from the primary server's data directory and includes the previously established replication slot on step 2

    1. Code Block
      /opt/rh/rh-postgresql13/root/usr/bin/pg_basebackup -D /var/lib/pgsql/data/13/main -F plain -X stream -S dbvisit_2 -R --progress --verbose --checkpoint=fast -d postgres://postgres@postgresqlcentos1:5432
  6. Config directory setup: Directory Setup

    1. Extract files from tar ball recieved on step 4 and put place them into in the target config configuration directory on the standby server

    2. Configure the PostgreSQL configuration in streaming mode according to instance on the standby server for streaming replication based on the CSD parameter and streaming the replication slot .created earlier

  7. If the OS operating system is windowsWindows, register windows a Windows service for the PostgreSQL cluster

  8. Restart Standby Server

    1. After setting up data director and config directory, restart standby server

  9. Applying Configuration Changes

    1. Applying the latest changes on configuration coming CSD and persisting configuration data on Control Center

CSD for archive Mode

Drawio
mVer2
zoom1
simple0
zoominComment10
inCommentcustContentId03678273563
pageId3673391206
custContentIdlbox36782735631
diagramDisplayNamecsd archive.drawiolbox1
contentVer5
revision5
baseUrlhttps://dbvisit.atlassian.net/wiki
diagramNamecsd archive.drawio
pCenter0
width710.9999999999998
links
tbstyle
height1170.9999999999998

  1. Trigger CSD in archive mode

  2. Create Base Backup Files

    1. Generate the essential base backup files using the following command:

      Code Block
      /opt/rh/rh-postgresql13/root/usr/bin/pg_basebackup -D tempBackupDir -F tar -X stream -R --progress --verbose 
    2. The aforementioned command will generate the subsequent files, which are to be transferred to the Standby in order to facilitate the cluster restoration process.

      1. base.tar: postgresql base files, including setting and etc

      2. pg_wal.tar: wal data files for standby to restore

      3. tblspc_xxxxx.tar: customized table space files

      4. backup_manifest: backup meta data, is used for pg_verifybackup to verify the backup

  3. On Primary MP find and Tar the postgresql config files, Includingfollowing PostgreSQL configuration files on the primary server

    1. postgres.conf

    2. pg_ident.conf

    3. pg_hba.conf

  4. On Standby MP receive all files generated from Primary server Transfer Backup Files from Primary to Standby, which are generated on step 3 and step 2.b

  5. Data directory setup : Extract

    1. On the Standby, receive and extract all files generated from Step 2.b and

    placed to the target data folder assigned before triggering CSD
    1. Step 3. Place these files in the designated data folder, previously allocated before initiating CSD.

  6. Config directory setup:

    1. Extract the files from tar ball recieved on step the tarball received in Step 4 and put place them into the target config configuration directory on the standby server.

    2. Configure the PostgreSQL configuration in archive mode according to as per the CSD parameter

  7. If the OS is windows, register windows service for the cluster

  8. After setting up configuring the data director and config directorydirectories, restart the standby PostgreSQL server

  9. Apply Configuration Changes from CSD

    1. Applying the latest changes on configuration coming CSD and persisting configuration data on Control Center

CSD for Log shipping Mode

Drawio
mVer2
zoom1
simple0
zoominComment10
inCommentcustContentId03678470151
pageId3673391206
custContentIdlbox36784701511
diagramDisplayNameCSD log-shipping.drawiolbox1
contentVer4
revision4
baseUrlhttps://dbvisit.atlassian.net/wiki
diagramNameCSD log-shipping.drawio
pCenter0
width741
links
tbstyle
height1451

...

  1. Trigger CSD in archive mode

  2. Create Replication Slot on Primary

    1. Run the following SQL query on the primary server to create a physical replication slot named SLOT_NAME

      Code Block
      SELECT * FROM pg_create_physical_replication_slot(SLOT_NAME, false, false) WHERE NOT EXISTS (SELECT * FROM pg_replication_slots WHERE slot_name = SLOT_NAME)
  3. Create Base Backup Files

    1. Generate the essential base backup files using the following command

      Code Block
      /opt/rh/rh-postgresql13/root/usr/bin/pg_basebackup -D tempBackupDir -F tar -X stream -R --progress --verbose -S slot_name 
    2. The aforementioned command will generate the subsequent files, which are to be transferred to the Standby in order to facilitate the cluster restoration process.

      1. base.tar: postgresql base files, including setting and etc

      2. pg_wal.tar: wal data files for standby to restore

      3. tblspc_xxxxx.tar: customized table space files

      4. backup_manifest: backup meta data, is used for pg_verifybackup to verify the backup

    3. Note: Different archive mode base backup, backups and log shipping backup backups also brings include the replication_slot to within the base backup files and transfer it to the standby afterwards.

  4. On Primary MP find and Tar the postgresql config files, Includingfollowing PostgreSQL configuration files on the primary server

    1. postgres.conf

    2. pg_ident.conf

    3. pg_hba.conf

  5. On Standby MP receive all files generated from Primary server Transfer Backup Files from Primary to Standby, which are generated on step 3 and step 2.b

  6. Data directory setup : Extract

    1. On the Standby, receive and extract all files generated from Step 2.b and

    placed to the target data folder assigned before triggering CSD
    1. Step 3. Place these files in the designated data folder, previously allocated before initiating CSD.

  7. Config directory setup:

    1. Extract the files from tar ball recieved on step the tarball received in Step 4 and put place them into the target config configuration directory on the standby server.

    2. Configure the PostgreSQL configuration in log shipping mode according to archive mode as per the CSD parameter and replication slot.

  8. If the OS is windows, register windows service for the cluster

  9. After setting up configuring the data director and config directorydirectories, restart the standby PostgreSQL server

  10. Apply Configuration Changes from CSD

    1. Applying the latest changes on configuration coming CSD and persisting configuration data on Control Center

Import configuration for streaming Mode