https://developer.hashicorp.com/vagrant/downloads
vagrant up
- pg_basebackup -h 192.168.56.10 -U replica_user -X stream -v -R -W -D /var/lib/postgresql/14/main
- chown postgres -R /var/lib/postgresql/14/main/
- systemctl restart postgresql
ssh to first slave:
vagrant ssh slave1
- sudo -u postgres psql -c "SELECT client_addr, state FROM pg_stat_replication;"
- In this
Vagrantfile
we installed postgresql withtimescaledb
- Timescaledb installation: https://docs.timescale.com/self-hosted/latest/install/installation-linux/
- You can replace the
md5
withtrust
inpg_hba.conf
then you can runpg_basebackup
with-w
instead of-W
and don't send the password