Search code examples
databasepostgresql-9.0

Error in archive_command in Windows 7


I have done these steps:

  1. Opened postgresql.conf
  2. Set these parameters:

    wal_level = archive
    archive_mode =on
    archive_command = ''copy %p \\\\192.168.1.10\\Archive\\wals\\%f''
    

Where 192.168.1.10 is my PC IP address and Archive is a shared folder in D drive.

When I restart postgres service I found the archived files in Archive folder.

That's what I want to do.

But now I want to store the archived files in another PC having the IP address "192.168.1.41" for that I did these steps:

  1. I create a folder Archive and a sub folder WALs within it.
  2. make it shareable and full access for every one.
  3. update the archive_command = ''copy %p \\\\192.168.1.41\\Archive\\wals\\%f'' in my PC

Now when I restart the postgres service no archived files are received in remote PC "192.168.1.41".

When I open the pg_log folder to see the log file I found the error somthing like:

  The failed archive command was: 
     copy pg_xlog\000000010000000000000009 \\192.168.1.41\PGArchivewals\000000010000000000000009
    The referenced account is currently locked out and may not be logged on to.

Solution

  • Set the firewall on on both the PC(master and slave) and check the permission for the account by which you are accessing the postgres database