1

I want to setup Postgres replication on Windows. I followed the given youtube url step by step: youtube video.

For archive_command I use this:

archive_command = 'copy "%p" "\\\\ip-address of sharable drive\\soft\\\wal\\%f"' 

but when I look into the folder, folder is empty and WAL files are not transferred from pg_xlog to the desired location; it gives error access denied. In services.msc postgresql log on as network services.

services.msc

error log:

2018-04-30 16:34:06 IST LOG:  archive command failed with exit code 1
2018-04-30 16:34:06 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:34:07 IST LOG:  archive command failed with exit code 1
2018-04-30 16:34:07 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive1\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:34:08 IST LOG:  archive command failed with exit code 1
2018-04-30 16:34:08 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:34:08 IST WARNING:  archiving transaction log file "000000010000000E00000083" failed too many times, will try again later
2018-04-30 16:35:08 IST LOG:  archive command failed with exit code 1
2018-04-30 16:35:08 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:35:09 IST LOG:  archive command failed with exit code 1
2018-04-30 16:35:09 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:35:10 IST LOG:  archive command failed with exit code 1
2018-04-30 16:35:10 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:35:10 IST WARNING:  archiving transaction log file "000000010000000E00000083" failed too many times, will try again later
2018-04-30 16:36:10 IST LOG:  archive command failed with exit code 1
2018-04-30 16:36:10 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:36:11 IST LOG:  archive command failed with exit code 1
2018-04-30 16:36:11 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:36:12 IST LOG:  archive command failed with exit code 1
2018-04-30 16:36:12 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:36:12 IST WARNING:  archiving transaction log file "000000010000000E00000083" failed too many times, will try again later
2018-04-30 16:37:12 IST LOG:  archive command failed with exit code 1
2018-04-30 16:37:12 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:37:13 IST LOG:  archive command failed with exit code 1
2018-04-30 16:37:13 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:37:15 IST LOG:  archive command failed with exit code 1
2018-04-30 16:37:15 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:37:15 IST WARNING:  archiving transaction log file "000000010000000E00000083" failed too many times, will try again later 
2018-04-30 16:38:15 IST LOG:  archive command failed with exit code 1
2018-04-30 16:38:15 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:38:16 IST LOG:  archive command failed with exit code 1
2018-04-30 16:38:16 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:38:17 IST LOG:  archive command failed with exit code 1
2018-04-30 16:38:17 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:38:17 IST WARNING:  archiving transaction log file "000000010000000E00000083" failed too many times, will try again later
2018-04-30 16:39:17 IST LOG:  archive command failed with exit code 1
2018-04-30 16:39:17 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:39:18 IST LOG:  archive command failed with exit code 1
2018-04-30 16:39:18 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:39:19 IST LOG:  archive command failed with exit code 1
2018-04-30 16:39:19 IST DETAIL:  The failed archive command was: copy %\ip-address of sharable drive\soft\SUJITwal\000000010000000E00000083
2018-04-30 16:39:19 IST WARNING:  archiving transaction log file "000000010000000E00000083" failed too many times, will try again later
  • Can you also show us the error log? Do these "access denied" appear in the error log? Looks like a permission issue. – ypercubeᵀᴹ Apr 30 '18 at 8:33
  • Please edit the question and add the error text – ypercubeᵀᴹ Apr 30 '18 at 12:18
  • The NetworkService account, which you say is running Postgres, is unlikely to have permissions to access network resources, such as shared drives. – mustaccio Apr 30 '18 at 17:58
  • @mustaccio I attached a screenshot in description. If i changed network services with administration followed by youtube video then postgresql not started. What should be the step i follow for to access network sharable drive. – S Deshmukh May 2 '18 at 4:43
0

You just need to correct archive_command just replace IP-address of path to which wal files will be archived e.g archive_command = 'copy "%p" "\\10.10.0.123\\soft\\\wal\\%f"'

Also make sure the path permission is set to postgres user if not

chown postgres:postgres \\10.10.0.123\\soft\\\wal\\%f"' 

If still unable to get archive files check the connection to IP may be having connection issue

  • There is no chown command in Windows – a_horse_with_no_name May 28 '18 at 10:03
  • ya sorry ! he can use then properties of folder and change owneship there – Ashiq Ahamed May 28 '18 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.