postgresql
postgresql copied to clipboard
replication
Hi,
Is there something to manage replication ? do you plan to accept PR for that ?
Thank you.
Yes. I set up streaming replication (async) with this role and it works just fine.
Have a look at the vars:
https://github.com/ANXS/postgresql/blob/master/defaults/main.yml#L203
I used this tutorial for orientation on the config and the instructions for the initial backup.
https://www.howtoforge.com/tutorial/postgresql-replication-on-ubuntu-15-04/
On the standby i executed this commands manually:
systemctl stop postgresql
rm -rf /var/lib/postgresql/9.6/main/
su - postgres
pg_basebackup -h master -D /var/lib/postgresql/9.6/main -U replication -v --progress --checkpoint=fast --xlog-method=stream -R
cd /var/lib/postgresql/9.6/main
vim recovery.conf
+ trigger_file = '/tmp/postgresql.trigger.5432'
exit
systemctl start postgresql
(Used Ubuntu 16.04 and Ansible 2.2)
Hi, I have a playbook to enable streaming replication. But It’s not idempotent, because the replication is done from scratch. If someone is willing to help, I can work on it.
You can find repmgr replication feature in #424