From f7e16a08428556fd830644f55a4e3d981ef42e86 Mon Sep 17 00:00:00 2001 From: Jehan-Guillaume de Rorthais Date: Tue, 7 Sep 2021 01:51:43 +0200 Subject: [PATCH] Fix related to v13 --- extra/vagrant/3nodes-vip/Vagrantfile | 10 +++++++--- extra/vagrant/3nodes-vip/provision/pgsql.bash | 13 ++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/extra/vagrant/3nodes-vip/Vagrantfile b/extra/vagrant/3nodes-vip/Vagrantfile index c3ce473..e0e1f9f 100644 --- a/extra/vagrant/3nodes-vip/Vagrantfile +++ b/extra/vagrant/3nodes-vip/Vagrantfile @@ -81,8 +81,12 @@ Vagrant.configure(2) do |config| ############################################################################ # system setup for all nodes - config.vm.provision 'file', source: 'provision/id_rsa', destination: '/home/vagrant/.ssh/id_rsa' - config.vm.provision 'file', source: 'provision/id_rsa.pub', destination: '/home/vagrant/.ssh/id_rsa.pub' + config.vm.provision 'ssh-prv', type: 'file', + source: 'provision/id_rsa', + destination: '/home/vagrant/.ssh/id_rsa' + config.vm.provision 'ssh-pub', type: 'file', + source: 'provision/id_rsa.pub', + destination: '/home/vagrant/.ssh/id_rsa.pub' (pg_nodes + [log_node]).each do |node| config.vm.define node do |conf| @@ -110,7 +114,7 @@ Vagrant.configure(2) do |config| # cluster setup pg_nodes.each do |node| config.vm.define node do |conf| - conf.vm.provision 'pacemaker', type: 'shell', + conf.vm.provision 'pcmk', type: 'shell', path: 'provision/pacemaker.bash', args: [ pgver, hapass, base_ip, ssh_login, vm_prefix, host_ip, pgdata ] + pg_nodes, diff --git a/extra/vagrant/3nodes-vip/provision/pgsql.bash b/extra/vagrant/3nodes-vip/provision/pgsql.bash index b4720e9..a429090 100755 --- a/extra/vagrant/3nodes-vip/provision/pgsql.bash +++ b/extra/vagrant/3nodes-vip/provision/pgsql.bash @@ -18,6 +18,7 @@ rm -rf "${PGDATA}" if [ "$NODENAME" == "$PRIM_NODE" ]; then # init instance + PGSETUP_INITDB_OPTIONS="--data-checksums" "/usr/pgsql-${PGVER}/bin/postgresql-${PGVER}-setup" initdb # pg_hba setup @@ -51,7 +52,6 @@ if [ "$NODENAME" == "$PRIM_NODE" ]; then max_wal_senders = 10 hot_standby = on hot_standby_feedback = on - wal_keep_segments = 256 log_destination = 'syslog,stderr' log_checkpoints = on log_min_duration_statement = 0 @@ -59,6 +59,17 @@ if [ "$NODENAME" == "$PRIM_NODE" ]; then log_replication_commands = on EOC + if [ "${PGVER%%.*}" -lt 13 ]; then + # recovery.conf setup + cat <<-'EOC' >> "${CUSTOMDIR}/custom.conf" + wal_keep_segments = 64 + EOC + else + cat <<-'EOC' >> "${CUSTOMDIR}/custom.conf" + wal_keep_size = 1GB + EOC + fi + if [ "${PGVER%%.*}" -lt 12 ]; then # recovery.conf setup cat<<-EOC > "${CUSTOMDIR}/recovery.conf.pcmk"