PostgreSQL HA With Patroni: Looking at Failure Scenarios and How the Cluster Recovers From Them

Ғылым және технология

Fernando Laudares Camargos, and Jobin Augustine, presents "#PostgreSQL HA With Patroni: Looking at Failure Scenarios and How the Cluster Recovers From Them".
Over the last few years, Patroni has established itself as the main reference for #PostgreSQL High Availability and we are witnessing its adoption increase among our customers following this trend in popularity. It has not been, however, a straightforward journey for many of them: the robustness of the Patroni project was built on top of solid layers provided by different components and it is necessary to understand how they connect with each other and what happens when one of them "breaks".
Comment 💬, Share 🔗, Like 👍, and Subscribe ✅ to our channel 📺, and turn on the 🔔 to be alerted to new videos about #OpenSource #Databases... and many other things!
percona.tv/subscribe
In this talk, we are going to review the most common failure scenarios and how Patroni recovers the PostgreSQL cluster in each of these cases. We'll also discuss the most common mistakes we have observed and how you can avoid these.
You can find more information about #PostgreSQL #Databases and Percona Database Events in these links 👇👇👇
Postgresql Support ⏩ per.co.na/postgresql-support
Postgresql info ⏩ per.co.na/postgresql-info
Postgresql events ⏩ per.co.na/pl2020
Percona Distribution for PostgreSQL ⏩ per.co.na/postgresql
Monitor your PostgreSQL For Free ⏩ percona.tv/pmm-yt
Connect With us on our Social Networks 👇👇👇
Follow Percona on Twitter: per.co.na/twitter
Follow Percona on Facebook: per.co.na/facebook
Follow Percona on Instagram: per.co.na/instagram
Follow Percona on LinkedIn: per.co.na/linkedin

Пікірлер: 16

  • @martingoodson1651
    @martingoodson16513 жыл бұрын

    This was a very interesting video and a very concise intro to Patroni. Thank you very much for publishing it.

  • @phreshprince2947
    @phreshprince2947Ай бұрын

    This is great. Can you show what happens when a System ID mismatch occurs? I'm struggling to fix that.

  • @simonsomething2620
    @simonsomething26202 жыл бұрын

    Awesome vid guys. For the future, I'd reccomend showing it full-screen for better viewability. Went to the tub to keep watching on my phone but it's really difficult to see anything if the content is even smaller than it could've been.

  • @oschvr
    @oschvr2 жыл бұрын

    Thank you very much !! Very helpful

  • @kombergman
    @kombergman2 жыл бұрын

    Very interesting video, well done. However, could you upload a version without the top bar which forces the presentation to not use all of the screen?

  • @malymohsem285
    @malymohsem2855 ай бұрын

    Hello, I am using ubuntu 20.04 LTS. Do I need to change the ownership of `/etc/patroni/config.yml` file from root user to postgres user ? Cause I am getting some sort of errors

  • @DipsaDishNDiaries
    @DipsaDishNDiaries2 жыл бұрын

    how to setup the configuration in a way where, if leader site crashes - (network / server restart) Leader should wait for x seconds before electing a new leader. Where and which parameter is to configured ? tried tweaking ttl in yml file but no luck so far, it immediately switches over to another site

  • @deepaks5080
    @deepaks50802 жыл бұрын

    Is watchdog installation is mandatory in patroni setup ?, also can we use anyother alternative tool for haproxy which support the same functionality

  • @jobinaugustine5797

    @jobinaugustine5797

    2 жыл бұрын

    Patroni has built-in mechanism to protect against split brain. As the documentation says: "Under normal circumstances Patroni will try to achieve this (split-brain) by stopping PostgreSQL when leader lock update fails for any reason.However, this may fail to happen due to various reasons: 1. Patroni has crashed due to a bug, out-of-memory condition or by being accidentally killed by a system administrator. 2. Shutting down PostgreSQL is too slow. 3. Patroni does not get to run due to high load on the system, the VM being paused by the hypervisor, or other infrastructure issues. " So the watchdog is a protection for those conditions which is beyond the capabilities of Patroni. So watchdog is essential for the Production use of Patroni to protect the cluster. Regrading the second question, Any connection router can be used instead of haproxy. No restrictions there. Since HAProxy is very lightweight and fast, we don't see a reason for replacing the HAProxy.

  • @poojamayekar7725
    @poojamayekar77252 жыл бұрын

    This video helps me to understand basics of patroni, However I am struggling with configuring logical replication with patroni. Can you redirect me for such live presentation on logical replication setup with patroni?

  • @percona

    @percona

    2 жыл бұрын

    Hi Pooja. that is not something we would vouch for because it makes no sense: for a HA cluster, all nodes should be able to take the role of Primary, and for this to happen, they should all have the same data set and (in the case of PostgreSQL) the same configuration/specs ideally. Also, this article could help you to understand a bit more: www.percona.com/blog/2018/09/28/high-availability-for-enterprise-grade-postgresql-environments/

  • @cololabs
    @cololabs2 жыл бұрын

    Hey folks, I'm interested in reproducing this on my own, do you have the files in any public repo? Thanks!

  • @fernandolaudarescarmagos4805

    @fernandolaudarescarmagos4805

    2 жыл бұрын

    Hi Hernán, we did not publish the files but we wrote an accompanying blog post that provides the detailed steps of the procedure and should be helpful to you: www.percona.com/blog/2021/06/11/postgresql-ha-with-patroni-your-turn-to-test-failure-scenarios/

  • @cololabs

    @cololabs

    2 жыл бұрын

    @@fernandolaudarescarmagos4805 Thank you!! I'm getting familiar with Patroni and this was really helpful!

  • @rishidibban5851
    @rishidibban58512 жыл бұрын

    Hi, I m facing below error. i tried all possibilities but no luck. i can able to etcd and even i can start patroni without error. but when i m trying to check patroni status it is throwing below error. info = self._run_cycle() File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1266, in _run_cycle return self.post_bootstrap() File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1163, in post_bootstrap self.cancel_initialization() File "/usr/lib/python3/dist-packages/patroni/ha.py", line 1158, in cancel_initialization raise PatroniException('Failed to bootstrap cluster') patroni.exceptions.PatroniException: 'Failed to bootstrap cluster' patroni.service: Main process exited, code=exited, status=1/FAILURE patroni.service: Failed with result 'exit-code'.

  • @fernandolaudarescarmagos4805

    @fernandolaudarescarmagos4805

    2 жыл бұрын

    Hi Rishi, it's weird you can initialize the Patroni cluster but not check its status without it crashing, I haven't seen this happening yet. However, the error "Failed to bootstrap cluster" suggests the cluster has not bootstrapped correctly. You should find more information about this as well as etcd on the /var/log/syslog. Make sure it is not SELinux or AppArmor that is blocking ports. Also, you can find more details about the procedure used to create the cluster in the following blog post, which can maybe help with your troubleshooting: www.percona.com/blog/2021/06/11/postgresql-ha-with-patroni-your-turn-to-test-failure-scenarios/

Келесі