I have a standby db server (SB1) that will soon become the master. SB1 is set up with streaming replication from the current master. I'm trying to set up a third server (SB2) as a slave/standby to SB1, so that when SB1 becomes the master, there will be a standby for it. First step is to get WAL files shipped from SB1->SB2.
Problem is I can't get the archive_command of SB1 to execute. The same archive_command on our current master calls into a script that scp's the WAL files to SB1. This works. I've also confirmed the script works from SB1->SB2 when run from the command line, as the postgres user, w/o a password request.
Furthermore, on SB1 I replaced the call to the script with a touch command, to see if archive_command was getting called at all:
# This script does the scp of the WAL file to the designated server/directory
#archive_command = '/opt/printra/sbin/handle_wal_files.sh %p db-backup /backup/WAL_ARCHIVE/auto'
archive_command = 'touch /var/lib/pgsql/testtouch'
and the testtouch file did not appear.
Here are some relevant settings from SB1:
postgres=# select * from pg_settings where name like 'archive%'; -[ RECORD 1 ]------------------------------------------------------------------------------------------ name | archive_command setting | touch /var/lib/pgsql/testtouch unit | category | Write-Ahead Log / Archiving short_desc | Sets the shell command that will be called to archive a WAL file. extra_desc | context | sighup vartype | string source | configuration file min_val | max_val | enumvals | boot_val | reset_val | touch /var/lib/pgsql/testtouch sourcefile | /var/lib/pgsql/9.3/data/postgresql.conf sourceline | 607 -[ RECORD 2 ]------------------------------------------------------------------------------------------ name | archive_mode setting | on unit | category | Write-Ahead Log / Archiving short_desc | Allows archiving of WAL files using archive_command. extra_desc | context | postmaster vartype | bool source | configuration file min_val | max_val | enumvals | boot_val | off reset_val | on sourcefile | /var/lib/pgsql/9.3/data/postgresql.conf sourceline | 604 -[ RECORD 3 ]------------------------------------------------------------------------------------------ name | archive_timeout setting | 0 unit | s category | Write-Ahead Log / Archiving short_desc | Forces a switch to the next xlog file if a new file has not been started within N seconds. extra_desc | context | sighup vartype | integer source | default min_val | 0 max_val | 1073741823 enumvals | boot_val | 0 reset_val | 0 sourcefile | sourceline |
postgres=# select version(); -[ RECORD 1 ]----------------------------------------------------------------------------------------------------------- version | PostgreSQL 9.3.19 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit I've bumped up logging to debug1 and have not seen anything that looks related to the archive_command. Bumping up to debug2 was really noisy and didn't seem to yield any useful info either. Any ideas? |