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:
- Disable SELinux on all nodes.
- Enable passwordless sudo.
- Configure passwordless SSH between all nodes.
- 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)" |
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 nameddemowill be created under the CLI’s cluster directory, and the JSON file will bedemo.jsoninside 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 be5432if 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
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
now in node one run the following command to start the cluster
./pgedge cluster init demo |
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; |
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
now run this command to load tables
pgbench -i --port=6432 lcdb |
in remaining node i have login to psql and observed that all tables got replicated to other nodes
Execute the test in parallel on every node and confirm table replication on each.
