
{"id":6736,"date":"2025-01-22T13:55:28","date_gmt":"2025-01-22T13:55:28","guid":{"rendered":"https:\/\/test.opensource-db.in\/wp1\/?p=6736"},"modified":"2025-02-19T05:58:53","modified_gmt":"2025-02-19T05:58:53","slug":"step-by-step-guide-to-postgresql-ha-with-patroni-part-i","status":"publish","type":"post","link":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/","title":{"rendered":"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">High availability (HA) in PostgreSQL refers to the ability of the database system to remain operational and accessible with minimal downtime, even in the event of a failure. In industries like the banking and financial sector, e-commerce , healthcare sector etc ., where uptime is critical for operations, ensuring that your PostgreSQL database remains highly available is essential. Considering banking sector, downtime or database unavailability in banking systems can lead to significant disruptions, such as delayed transactions, loss of data, financial discrepancies, and damage to the business&#8217;s reputation. For these sectors, maintaining continuous access to customer accounts, transaction processing, and other critical financial services availability is paramount.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To achieve high availability, PostgreSQL typically employs replication and automatic failover. In the context of banking systems, the goal is to ensure that if one database node fails, another can seamlessly take over without impacting transaction processing or application functionality. This ensures uninterrupted service to customers and provides continuous access to vital financial data. In our previous blogs, we have discussed about one of the HA architecture based on <a href=\"https:\/\/test.opensource-db.in\/wp1\/setting-up-high-availability-with-repmgr\/\">repmgr<\/a>. In this blog , let&#8217;s discuss another HA architecture based on Patroni.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Patroni<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Patroni<\/strong> is widely used for high availability (HA) in PostgreSQL clusters due to its ability to provide automated failover, leader election via distributed consensus mechanisms and DCS(Distributed configuration store). It simplifies PostgreSQL high availability setups by managing the cluster&#8217;s state and ensuring that a PostgreSQL instance remains available even in the event of failures on other nodes. Here are some of the advantages using Patroni as a HA tool:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automatic failover and recovery<\/li>\n\n\n\n<li>Leader Election via consensus<\/li>\n\n\n\n<li>Flexible in terms choosing consensus<\/li>\n\n\n\n<li>OpenSource tool<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-1024x576.png\" alt=\"\" class=\"wp-image-6738\" srcset=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-1024x576.png 1024w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-300x169.png 300w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-768x432.png 768w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-1536x864.png 1536w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-176x99.png 176w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-142x80.png 142w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-394x222.png 394w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-915x515.png 915w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture-1240x698.png 1240w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/ANB-DB-Architecture.png 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s discuss the remaining components in the architecture : <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>HAproxy<\/strong>  A high-performance load balancer used to route traffic between the primary and standby PostgreSQL instances. It ensures that database connections are always directed to the current primary, providing failover capabilities by switching connections to a new primary in the event of a failure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>PgBouncer<\/strong> A lightweight connection pooler for PostgreSQL that improves the performance of database connections by pooling and reusing database connections. It is particularly useful in environments with high connection churn and can be used with Patroni to optimize database connection management.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>etcd<\/strong> A distributed key-value store used by Patroni for managing cluster state and leader election. It helps the nodes to communicate and decide which PostgreSQL instance is the leader (primary) and which ones are standbys. For this purpose, there are a lot of options besides etcd  too, like consul, zookeeper etc. Here we&#8217;ll focus the discussion exclusively on using etcd with Patroni.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How these components work together<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We are considering 5 server in this architecture, 3 in one region and 2 in other region. In the first region , I will be deploying 2 <code>PostgreSQL<\/code> nodes along with <code>patroni<\/code>, <code>etcd<\/code> and <code>pgbouncer<\/code> and also one node with <code>haproxy<\/code> . In the second region, we will have one node for <code>PostgreSQL<\/code> similar to what we have in the first region and one for <code>haproxy<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"6ac6\">As&nbsp;<code>Patroni<\/code> installed on each&nbsp;<code>PostgreSQL<\/code>&nbsp;node in the cluster, both the management of the PostgreSQL database and the updating of the distributed consensus system are within the bot&#8217;s (i.e.,  <strong>etcd<\/strong>&#8216;s) capabilities. Etcd needs to be set up in a high availability (HA) mode that enables its individual nodes to come to a consensus regarding the status of the cluster.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"9507\">With the etcd installed in the three PostgreSQL nodes, the primary database (i.e., the leader) is determined to be the PostgreSQL instance that sets the Etcd key first. Etcd utilizes a Raft-based consensus method to guard against the occurrence of race situations. Following the receipt of confirmation that it is in possession of the key, a bot will configure the PostgreSQL instance to function as the primary database. The election of a primary will be visible to all other nodes, at which point their bots will configure their PostgreSQL instances to function as replicas.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"37f8\"><code>HAProxy<\/code>&nbsp;monitors changes in the master\/slave nodes and connects to the appropriate master node when clients request a connection. It determines which node is the master by calling the Patroni REST API. The Patroni REST API is configured to run on port 8008 in each database node. And also it balances the load , shifting writes to the primary and reads to the standby&#8217;s.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"37f8\"><code>pgbouncer<\/code> helps manage and optimize the connections between the haproxy and the PostgreSQL database, especially in high-traffic environment. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"37f8\">This architecture is designed to provide a robust, self-managing database cluster where high availability is a paramount concern. By employing Patroni, etcd, and HAProxy in unison, the setup achieves automatic failover, efficient load balancing, and consistent replication, thereby delivering a resilient and high-performing database environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"8725\"><strong>Failover Times<\/strong>: Failover times may not always be instantaneous, depending on the cluster\u2019s state and the reasons for failover. There may be a short period of unavailability while a new leader is elected and the cluster is reconfigured.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">They are different types to install , there are <code>yum install<\/code> and rpm based installation. Here , I used the rpm based installation as the PostgreSQL nodes were created in an air-gapped environment, and did not have direct access to the internet. The first go-to repo is <code>pgdg<\/code> ( I&#8217;m assuming PostgreSQL is already installed, and not covering the installation of PostgreSQL here):<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>HAProxy<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here are the installation steps. I&#8217;m attaching the link to the rpm along with requisite dependencies.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#To know the dependencies of haproxy\nyum deplist haproxy\n#To download the rpm \nwget https:\/\/download.postgresql.org\/pub\/repos\/yum\/common\/pgdg-rhel8-extras\/redhat\/rhel-8-x86_64\/haproxy-3.1.1-1PGDG.rhel8.x86_64.rpm\n#To install the downloaded rpm\nrpm -ivh haproxy-3.1.1-1PGDG.rhel8.x86_64.rpm\n#To verify the installation\nhaproxy --version<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Patroni with etcd<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here I&#8217;m giving the installation of patroni along with etcd<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#To know the dependencies of patroni\nyum deplist patroni\nyum deplist etcd\n#To download the rpm for patroni and etcd \nwget https:\/\/download.postgresql.org\/pub\/repos\/yum\/common\/redhat\/rhel-8-x86_64\/patroni-4.0.4-1PGDG.rhel8.noarch.rpm\nwget https:\/\/download.postgresql.org\/pub\/repos\/yum\/common\/pgdg-rhel8-extras\/redhat\/rhel-8-x86_64\/etcd-3.5.9-1.rhel8.x86_64.rpm\n# To install the downloaded rpms\nrpm -ivh patroni-4.0.4-1PGDG.rhel8.noarch.rpm\nrpm -ivh etcd-3.5.9-1.rhel8.x86_64.rpm\n#To verify the installation\npatroni --version\netcd --version<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">PgBouncer<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#To know the dependencies of pgbouncer\nyum deplist pgbouncer\n#To download the rpm for pgbouncer \nwget https:\/\/download.postgresql.org\/pub\/repos\/yum\/common\/redhat\/rhel-8.9-x86_64\/pgbouncer-1.24.0-42PGDG.rhel8.x86_64.rpm\n# To install the downloaded rpms\nrpm -ivh pgbouncer-1.24.0-42PGDG.rhel8.x86_64.rpm\n#To verify the installation\npgbouncer --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Stay tuned for for the configuration part and the testing the cluster resilience in the next blog.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To summarize this blog presented a robust High Availability (HA) architecture for PostgreSQL leveraging <code>Patroni<\/code>,<code> <strong>etcd<\/strong><\/code>, <code>HAProxy<\/code>, and <code>PgBouncer<\/code> to ensure minimal downtime and high resilience. We discussed how each component plays a crucial role in achieving HA: <code>Patroni<\/code> handles automatic failover, leader election, and replication management; <strong>etcd<\/strong> serves as a distributed key-value store enabling consensus and state management; <code>HAProxy<\/code> provides load balancing and ensures traffic is directed to the correct node; and <code>PgBouncer<\/code> optimizes connection pooling to improve performance in high-traffic environments. This architecture is especially critical in sectors like banking, healthcare, and e-commerce, where continuous database availability is paramount. By combining these components, we ensure automatic recovery from failures, efficient database connection management, and high scalability. The installation process is simple, and by implementing this solution, organizations can maintain reliable, fault-tolerant systems. In the upcoming blog, we will delve deeper into the configuration and testing of this HA setup to ensure everything functions seamlessly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>High availability (HA) in PostgreSQL refers to the ability of the database system to remain operational and accessible with minimal [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":6760,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1,23,42,89],"tags":[],"class_list":["post-6736","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-others","category-postgresql-14","category-postgresql-15","category-postgresql-16"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Step-by-Step Guide to PostgreSQL HA with Patroni: Part I - OpenSource DB<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I - OpenSource DB\" \/>\n<meta property=\"og:description\" content=\"High availability (HA) in PostgreSQL refers to the ability of the database system to remain operational and accessible with minimal [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/\" \/>\n<meta property=\"og:site_name\" content=\"OpenSource DB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-22T13:55:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-19T05:58:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"945\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Venkat Akhil\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@opensource_db\" \/>\n<meta name=\"twitter:site\" content=\"@opensource_db\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Venkat Akhil\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/\"},\"author\":{\"name\":\"Venkat Akhil\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328\"},\"headline\":\"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I\",\"datePublished\":\"2025-01-22T13:55:28+00:00\",\"dateModified\":\"2025-02-19T05:58:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/\"},\"wordCount\":1083,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png\",\"articleSection\":[\"Others\",\"PostgreSQL 14\",\"PostgreSQL 15\",\"PostgreSQL 16\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/\",\"name\":\"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I - OpenSource DB\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png\",\"datePublished\":\"2025-01-22T13:55:28+00:00\",\"dateModified\":\"2025-02-19T05:58:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#primaryimage\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png\",\"width\":1800,\"height\":945},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/test.opensource-db.in\/wp1\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/\",\"name\":\"OpenSource DB\",\"description\":\"Your Trusted OpenSource Databases partner\",\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/test.opensource-db.in\/wp1\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\",\"name\":\"OPENSOURCE DB PRIVATE LIMITED\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png\",\"width\":368,\"height\":120,\"caption\":\"OPENSOURCE DB PRIVATE LIMITED\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/\",\"https:\/\/x.com\/opensource_db\",\"https:\/\/www.youtube.com\/channel\/UCmTI5h\",\"https:\/\/www.linkedin.com\/company\/opensource-db\",\"https:\/\/www.instagram.com\/opensource_db\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328\",\"name\":\"Venkat Akhil\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g\",\"caption\":\"Venkat Akhil\"},\"url\":\"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I - OpenSource DB","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I - OpenSource DB","og_description":"High availability (HA) in PostgreSQL refers to the ability of the database system to remain operational and accessible with minimal [&hellip;]","og_url":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/","og_site_name":"OpenSource DB","article_publisher":"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","article_published_time":"2025-01-22T13:55:28+00:00","article_modified_time":"2025-02-19T05:58:53+00:00","og_image":[{"width":1800,"height":945,"url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png","type":"image\/png"}],"author":"Venkat Akhil","twitter_card":"summary_large_image","twitter_creator":"@opensource_db","twitter_site":"@opensource_db","twitter_misc":{"Written by":"Venkat Akhil","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#article","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/"},"author":{"name":"Venkat Akhil","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328"},"headline":"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I","datePublished":"2025-01-22T13:55:28+00:00","dateModified":"2025-02-19T05:58:53+00:00","mainEntityOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/"},"wordCount":1083,"commentCount":0,"publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png","articleSection":["Others","PostgreSQL 14","PostgreSQL 15","PostgreSQL 16"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/","url":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/","name":"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I - OpenSource DB","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#website"},"primaryImageOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#primaryimage"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png","datePublished":"2025-01-22T13:55:28+00:00","dateModified":"2025-02-19T05:58:53+00:00","breadcrumb":{"@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#primaryimage","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png","width":1800,"height":945},{"@type":"BreadcrumbList","@id":"https:\/\/test.opensource-db.in\/wp1\/step-by-step-guide-to-postgresql-ha-with-patroni-part-i\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/test.opensource-db.in\/wp1\/"},{"@type":"ListItem","position":2,"name":"Step-by-Step Guide to PostgreSQL HA with Patroni: Part I"}]},{"@type":"WebSite","@id":"https:\/\/test.opensource-db.in\/wp1\/#website","url":"https:\/\/test.opensource-db.in\/wp1\/","name":"OpenSource DB","description":"Your Trusted OpenSource Databases partner","publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/test.opensource-db.in\/wp1\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/test.opensource-db.in\/wp1\/#organization","name":"OPENSOURCE DB PRIVATE LIMITED","url":"https:\/\/test.opensource-db.in\/wp1\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png","width":368,"height":120,"caption":"OPENSOURCE DB PRIVATE LIMITED"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","https:\/\/x.com\/opensource_db","https:\/\/www.youtube.com\/channel\/UCmTI5h","https:\/\/www.linkedin.com\/company\/opensource-db","https:\/\/www.instagram.com\/opensource_db\/"]},{"@type":"Person","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328","name":"Venkat Akhil","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g","caption":"Venkat Akhil"},"url":"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/"}]}},"rttpg_featured_image_url":{"full":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png",1800,945,false],"landscape":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png",1800,945,false],"portraits":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png",1800,945,false],"thumbnail":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1-150x150.png",150,150,true],"medium":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1-300x158.png",300,158,true],"large":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1-1024x538.png",1024,538,true],"1536x1536":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1-1536x806.png",1536,806,true],"2048x2048":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png",1800,945,false],"ultp_layout_landscape_large":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png",1200,630,false],"ultp_layout_landscape":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png",870,457,false],"ultp_layout_portrait":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png",600,315,false],"ultp_layout_square":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/01\/image-17-1.png",600,315,false]},"rttpg_author":{"display_name":"Venkat Akhil","author_link":"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/business\/others\/\" rel=\"category tag\">Others<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-14\/\" rel=\"category tag\">PostgreSQL 14<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-15\/\" rel=\"category tag\">PostgreSQL 15<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-16\/\" rel=\"category tag\">PostgreSQL 16<\/a>","rttpg_excerpt":"High availability (HA) in PostgreSQL refers to the ability of the database system to remain operational and accessible with minimal [&hellip;]","_links":{"self":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/6736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/comments?post=6736"}],"version-history":[{"count":12,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/6736\/revisions"}],"predecessor-version":[{"id":6758,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/6736\/revisions\/6758"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/media\/6760"}],"wp:attachment":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/media?parent=6736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/categories?post=6736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/tags?post=6736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}