postgresql icon indicating copy to clipboard operation
postgresql copied to clipboard

replication

Open ymsaout opened this issue 8 years ago • 4 comments

Hi,

Is there something to manage replication ? do you plan to accept PR for that ?

Thank you.

ymsaout avatar Jun 30 '16 06:06 ymsaout

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)

davidak avatar Mar 16 '17 10:03 davidak

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.

trotro avatar May 07 '20 17:05 trotro

You can find repmgr replication feature in #424

egmont1227 avatar Feb 24 '21 20:02 egmont1227