All Templates / Storage

PostgreSQL HA with Repmgr

PostgreSQL HA with Repmgr

Instant Postgres cluster for high availability and redundancy

Deploy PostgreSQL HA with Repmgr

pgpool

bitnami/pgpool:latest

Just deployed

pg-0

bitnami/postgresql-repmgr:16

Just deployed

/bitnami/postgresql

pg-1

bitnami/postgresql-repmgr:16

Just deployed

/bitnami/postgresql

pg-2

bitnami/postgresql-repmgr:16

Just deployed

/bitnami/postgresql

Deploy a PostgreSQL HA Cluster with replication manager by EDB, for a more highly available and redundant data layer.

How it works

This template deploys 4 services -

  • (3) PostgreSQL nodes
  • (1) Pgpool-II service

The PostgreSQL nodes are automatically configured with repmgr and joined to a cluster. Since Postgres doesn't include a native failover, repmgr is included.

Pgpool-II is a PostgreSQL proxy which can also handle failovers when they occur in the cluster.

Inter-node communication

All communication between nodes is done over the private network.

Configuration Tuning

The PostgreSQL nodes and Pgpool-II are deployed from bitnami images. As such, you can leverage the customizable environment variables available in both -

Connecting to the Cluster

Within the service variables for the Pgpool service, you will find connection strings named DATABASE_URL and DATABASE_PUBLIC_URL. These can be used for connecting to the cluster via the private or public network.

We strongly encourage you to use the private connection string defined in DATABASE_URL to avoid egress fees.

Deployment Regions

By default, each of the 3 Postgres nodes are deployed into US-West. You can move them to your preferred region(s) once deployed into your project, from the service settings.

From a disaster preparedness standpoint, it is common practice to deploy the nodes into different regions.

Service Source

PostgreSQL nodes- As of now, the PostgreSQL nodes deploy from a forked repository in the railwayapp-templates Github while we await a PR review by bitnami. Once our PR has been merged and the image published via Bitnami, we will update the source

Pgpool-II - Pgpool deploys directly from the bitnami/pgpool image in Docker Hub.

More Resources


Deploy Now

Details

Railway Templates

Created on Jul 25, 2024

46 total projects

8 active projects

100% success on recent deploys

Storage



More templates in this category

View Template
ReadySet

ReadySet

A lightweight caching engine for Postgres


Milo

View Template
EdgeDB

EdgeDB

EdgeDB template based on their Docker deployment guide


Ajit Krishna

View Template
Apache Kvrocks

Apache Kvrocks

A drop-in replacement for Redis to store data on a volume.


Bram