We are preparing to add repmgr to an existant Postgresql 9.3 two nodes streaming replication cluster.
Previously we had a serious problem that affected our main business, the problem was the delay between master and slave, which we resolved by adjusting the configuration as following:
master postgresql config:
archive_timeout = 60
synchronous_commit = on
synchronous_standby_names = 'slave1'
archive_command = 'test ! -f /walshare/%f && cp %p /walshare/%f'
the slave recovery.conf:
standby_mode = 'on'
primary_conninfo = 'host=master port=5432 user=repuser password=xxx application_name=slave1'
restore_command = 'cp /walshare/%f "%p"'
slave1 mount /walshare through NFS from master :
postgres@slave1:~$ mount -t nfs
master:/walshare on /walshare type nfs (rw,noatime,nolock,bg,nfsvers=4,intr,tcp,actimeo=1800,addr=xx.xx.xx.xx,clientaddr=xx.xx.xx.xx)
Through the activation of the synchronous commit we finally resolved the delay problem between master and slave.
No we want to reconfigure the current cluster to be managed by repmgr for easy administration tasks and failover.
I've create a new VMs (with PG-9.4) and plan to migrate database from old cluster to the new one.
To avoid pg_xlog disk space issue I decided to put pg_xlog directory in a separate logical volume on the same volume groupe as PGDATA logical volume.
/dev/mapper/datavg-pgsqllv mounted on /var/lib/pgsql
/dev/mapper/datavg-pgxloglv mounted on /var/lib/pgsql/9.4/data/pg_xlog
My questions are:
- Is that repmgr natively activate synchronous commit, or should I add it manually in the master postgresql.conf?
- With synchronous commit on, Master fails if slave not responding, how repmgr manage such as situation?
- When repmgr create new slave (clone master), does it remove the /var/lib/pgsql/9.4/data/pg_xlog and recreate a new one?
- Having pgsqllv and pgxloglv on the same volume groupe doesn't impact I/O performance? should i use dedicate disk for pg_xlog?
- Following the repmgr official documentation, wal_keep_segments = 5000 which requires 80 GB required on pg_xlog, 80Gb is fixe or the minimum space should I create my logical volume bigger enough 100Gb for example the manage pg_xlog disk space growth?
appreciat your help,