[pgpool-general: 8223] Patch for follow_primary.sh.sample
Jon SCHEWE
jon.schewe at raytheon.com
Fri Jun 17 03:10:21 JST 2022
Working on an upgrade I noticed that this change that we made locally isn't in the latest sample scripts. I think this is something that is generic enough that it's useful to others.
--- follow_primary.sh.sample.orig 2022-06-16 13:07:55.894946094 -0500
+++ follow_primary.sh.sample 2022-06-16 13:08:42.555015914 -0500
@@ -38,6 +38,8 @@
PCP_PORT=9898
REPL_SLOT_NAME=${NODE_HOST//[-.]/_}
+SSH_OPTIONS='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_rsa_pgpool'
+
echo follow_primary.sh: start: Standby node ${NODE_ID}
# Check the connection status of Standby
@@ -89,7 +91,7 @@
cat > ${RECOVERYCONF} << EOT
primary_conninfo = 'host=${NEW_PRIMARY_NODE_HOST} port=${NEW_PRIMARY_NODE_PORT} user=${REPLUSER} application_name=${NODE_HOST} passfile=''/var/lib/pgsql/.pgpass'''
recovery_target_timeline = 'latest'
-restore_command = 'scp ${NEW_PRIMARY_NODE_HOST}:${ARCHIVEDIR}/%f %p'
+restore_command = 'scp ${SSH_OPTIONS} ${NEW_PRIMARY_NODE_HOST}:${ARCHIVEDIR}/%f %p'
primary_slot_name = '${REPL_SLOT_NAME}'
EOT
@@ -120,7 +122,7 @@
cat > ${RECOVERYCONF} << EOT
primary_conninfo = 'host=${NEW_PRIMARY_NODE_HOST} port=${NEW_PRIMARY_NODE_PORT} user=${REPLUSER} application_name=${NODE_HOST} passfile=''/var/lib/pgsql/.pgpass'''
recovery_target_timeline = 'latest'
-restore_command = 'scp ${NEW_PRIMARY_NODE_HOST}:${ARCHIVEDIR}/%f %p'
+restore_command = 'scp ${SSH_OPTIONS} ${NEW_PRIMARY_NODE_HOST}:${ARCHIVEDIR}/%f %p'
primary_slot_name = '${REPL_SLOT_NAME}'
EOT
Jon Schewe
More information about the pgpool-general
mailing list