Skip to content

RootDBA

DBA expertise: PostgreSQL, SQL Server & MySQL

Menu
  • Home
  • blog
  • PostgreSql
  • MySql
  • Sql Server
  • About AHMED – Root DBA
Menu

How to install pgEdge Distributed Postgres

Posted on September 13, 2025September 13, 2025 by AHMED

pgEdge delivers multi-primary (aka master-master) Postgres replication, so every node is read/write. Unlike Patroni or traditional streaming replication—where one primary handles writes and the rest are read-only—pgEdge lets all nodes accept writes.
That enables true geo-distribution for lower latency and better performance, and it simplifies operations: fewer failovers, less downtime, and no single leader to babysit.

pgEdge recently went open source, a big step for the Postgres ecosystem, which has long lacked a mainstream multi-primary HA option. See the linked guide for deployment scenarios and how to put pgEdge to work.

https://docs.pgedge.com/platform/prerequisites/configuring

prerequisites

for this installation guide i will preform it on three node running rocky Linux 9
check the link to see which are supported OS

https://docs.pgedge.com/platform/prerequisites/platforms

Requirements for a successful installation:

  1. Disable SELinux on all nodes.
  2. Enable passwordless sudo.
  3. Configure passwordless SSH between all nodes.
  4. tables must have primary key
    full list of prerequisites check the following link https://docs.pgedge.com/platform/prerequisites/configuring

Installing pgedge

in here we will use the cli way but you can do manual way for installation

cli way is interactive way and straighforawd and does install postgrsql , pgbackrest and all remaining extenstion

in first node run the following command

python3 -c "$(curl -fsSL https://downloads.pgedge.com/platform/repos/download/install.py)"

Pasted image 20250913155354.png

Pasted image 20250913155516.png

once done on first node run the same command on remaining node

in node one switch to directory cd ~/pgedge

run the below command to start interactive shell for building the cluster

./pgedge cluster json-create demo 3 lcdb admin StrongPass! --port=6432
  • Executable & module:
    • ./pgedge – the pgEdge CLI.
    • cluster – you’re using the “cluster” module.
    • json-create – subcommand that builds the JSON config. (
  • Positional arguments (in order):
    • demo → CLUSTER_NAME. A folder named demo will be created under the CLI’s cluster directory, and the JSON file will be demo.json inside it. (
    • 3 → NUM_NODES. You’re defining a 3-node cluster.
    • lcdb → DB. Name of the database to create on each node. (
    • admin → USR. Superuser name for that DB.
    • StrongPass! → PASSWD. Password for the superuser.
  • Flag used:
    • --port=6432 → Base port for the primary nodes; valid 1–65535; default would be 5432 if you didn’t set it.

That’s it—your line builds a 3-node cluster config named demo, DB lcdb, superuser admin with the given password, listening on port 6432.
run the follwoing command to create

cd ~/pgedge
./pgedge cluster init demo

the installation will ask you for following

  • enable pgbaclkrest
  • nodes public and private ip
  • pg version to install
  • spock version
    Pasted image 20250913155910.png

Pasted image 20250913160218.png
note for each node it will have different port for connecting
for me node 1 will be 6432 , node 2 will be 6433 and node 3 will be 6433

run this command ./pgedge cluster list-nodes demo to see the list of nodes and there name and port

Pasted image 20250913161126.png

now in node one run the following command to start the cluster

./pgedge cluster init demo

Pasted image 20250913160430.png

now login to any of the nodes through psql and run the following command which will show nodes , what is getting replicated

SELECT sub_id, sub_name, sub_slot_name, sub_replication_sets  FROM spock.subscription;

Pasted image 20250913161536.png

Testing replication

for testing we will pgbench on database created during cluster build lcdb

go to directory /home/ahmed/demo/n1/pgedge/pg16/

load binary in you shell for psql and pgbench to function

Pasted image 20250913160903.png

now run this command to load tables

pgbench -i --port=6432 lcdb

Pasted image 20250913160946.png

in remaining node i have login to psql and observed that all tables got replicated to other nodes

Pasted image 20250913161233.png

Execute the test in parallel on every node and confirm table replication on each.

0
Visited 84 times, 1 visit(s) today
Category: PostgreSql, Postgresql Dba Guide

Post navigation

← How to Capture SQL Server Deadlocks Using Extended Events
Hunting SQL Server Deadlocks with PSBlitz (by VladDBA) →
© 2025 RootDBA | Powered by Minimalist Blog WordPress Theme