Basic postgresql set up
Architecture
Machine | Ip Address | Role |
---|---|---|
postgres1 | 10.1.0.101 | Postgres, Patroni, HAProxy, Etcd |
postgres2 | 10.1.0.102 | Postgres, Patroni |
postgres3 | 10.1.0.103 | Postgres, Patroni |
Install etcd:
Install packages:
-
Install
postgresql-15
,patroni
,etcd
on all nodes: -
(Optional) Install haproxy on
haproxy
node:
Configuring:
Etcd on node postgres1
- Start the
etcd
service to apply the changes on nodepostgres1
- Check the etcd cluster members on node
postgres1
Etcd on node postgres2
Etcd on node postgres3
Patroni on node postgres1
Patroni on node postgres2
- Config HAProxy on node haproxy:
- Test
Pooling connection with pgBouncer
- Install
Migration guide:
- First install all necessary packages by following the above steps
- Mount the stackgres data disk to the node