Skip to content

Commit

Permalink
Fix related to v13
Browse files Browse the repository at this point in the history
  • Loading branch information
ioguix committed Sep 7, 2021
1 parent 92292b0 commit f7e16a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
10 changes: 7 additions & 3 deletions extra/vagrant/3nodes-vip/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -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,
Expand Down
13 changes: 12 additions & 1 deletion extra/vagrant/3nodes-vip/provision/pgsql.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,14 +52,24 @@ 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
log_autovacuum_min_duration = 0
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"
Expand Down

0 comments on commit f7e16a0

Please sign in to comment.