Replicate local changes only.
Fix: conditional -D flag on final output
Add dendrite_sync stored procedure
This software will guide you through a PostgreSQL logical replication setup that works for redundancy.
I built this because I needed a replication for communitary infraestructures (such as cheap SBCs, and home-networks with dynamic IPs) that could run over different architectures. It's intended to be solid enough as to behave correctly without any human intervention after initial setup in most cases, albeit there's no warranty implied.
sed
that allows the -i
flag (like GNU and BusyBox sed)As root user.
On first-run
make
make install
Whenever you want to replicate a database
./setup.sh [options] <database>
Run it without a database parameter to see available options. -D
is safe to
use and will make setup faster.
I use it for redundancy over different computer architectures, on almost every other case streaming replication is usually recommended. If you don't know which replication model to use, probably you want streaming replication, which is not what this is for.
With the psql
command you can explore tables using \dt
, check constraints
of each table with \d+ <table>
.
Yes, for instance you could listen the primary server from the secondary one
and update a DNS server record if it's down. Also running the pglr_seq_sync
stored procedure might be a nice idea for data consistency.
Here is an example
of what I'm using.
Depending on your application and setup, it might.
GNU GPL v3 only.