Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install and configure pgbackrest on patroni cluster #3251

Merged
merged 70 commits into from
Nov 22, 2023

Conversation

conbrad
Copy link
Collaborator

@conbrad conbrad commented Nov 22, 2023

closes: #2751

  • Adjusts patroni Dockerfile and build to include pgbackrest
    • Image build includes object store configuration for pgbackrest to connect and write files
    • Docker image writes pgbackrest global configuration
    • post init script called by patroni enables archive mode / command in postgres, and creates the stanza

pgbackrest terminology:

Test Links:

Landing Page
MoreCast 2.0
Percentile Calculator
MoreCast
C-Haines
FireBat
FireBat bookmark
Auto Spatial Advisory (ASA)
HFI Calculator

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7331738) 81.94% compared to head (322cca4) 81.94%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3251   +/-   ##
=======================================
  Coverage   81.94%   81.94%           
=======================================
  Files         275      275           
  Lines        9489     9489           
  Branches      445      445           
=======================================
  Hits         7776     7776           
  Misses       1594     1594           
  Partials      119      119           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@conbrad conbrad requested review from dgboss and brettedw November 22, 2023 00:20
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p -m 777 /var/log/pgbackrest \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Folders for pgbackrest are created up front and modified so the non-root user that runs in openshift can access these files when issuing pgbackrest commands

echo "Restarting postgres to init config"
pg_ctl restart -D /home/postgres/pgdata/pgroot/data
echo "Creating pgbackrest stanza"
pgbackrest --stanza="$NAME-cluster-1" --pg1-path=/home/postgres/pgdata/pgroot/data --pg1-port=5432 stanza-create
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering where/how the $NAME gets set? Does $NAME have to be demo in order to match the stanza parameter on line 5 above?

Copy link
Collaborator

@dgboss dgboss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Thanks for taking this one on!

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@conbrad conbrad temporarily deployed to production November 22, 2023 19:26 Inactive
@conbrad conbrad merged commit d260d42 into main Nov 22, 2023
32 checks passed
@conbrad conbrad deleted the task/patroni-pgbackrest branch November 22, 2023 19:52
conbrad added a commit that referenced this pull request Nov 23, 2023
vanislekahuna pushed a commit to vanislekahuna/wps that referenced this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Patroni: Enable pgbackrest backups and wal streaming
2 participants