Обсуждение: archive_cleanup_command recovery.conf Standby server error

Поиск
Список
Период
Сортировка

archive_cleanup_command recovery.conf Standby server error

От
chinnaobi
Дата:
Streaming replication in the standby has successfully started (windows 2008
server) but, the configuration in the recovery.conf :

archive_cleanup_command='pg_archivecleanup \\\\10.1.18.16\\DB_Stream_Share\\
%r'

standby server log file says error as below :

2012-02-28 10:59:01 MYT FATAL:  the database system is starting up
2012-02-28 10:59:01 MYT LOG:  database system was shut down in recovery at
2012-02-28 10:58:59 MYT
2012-02-28 10:59:01 MYT LOG:  entering standby mode
2012-02-28 10:59:01 MYT LOG:  restored log file "000000010000000000000027"
from archive
2012-02-28 10:59:01 MYT LOG:  redo starts at 0/27000020
2012-02-28 10:59:01 MYT LOG:  consistent recovery state reached at
0/28000000
2012-02-28 10:59:01 MYT LOG:  database system is ready to accept read only
connections
2012-02-28 10:59:01 MYT LOG:  unexpected pageaddr 0/20000000 in log file 0,
segment 40, offset 0
2012-02-28 10:59:02 MYT LOG:  streaming replication successfully connected
to primary
'pg_archivecleanup' is not recognized as an internal or external command,

operable program or batch file.

2012-02-28 11:04:01 MYT WARNING:  archive_cleanup_command "pg_archivecleanup
\\NOBE-HGG-SRV-04\DB_Stream_Share\ %r": return code 1
'pg_archivecleanup' is not recognized as an internal or external command,

operable program or batch file.

2012-02-28 11:09:01 MYT WARNING:  archive_cleanup_command "pg_archivecleanup
\\NOBE-HGG-SRV-04\DB_Stream_Share\ %r": return code 1
'pg_archivecleanup' is not recognized as an internal or external command,

operable program or batch file.

2012-02-28 11:14:01 MYT WARNING:  archive_cleanup_command "pg_archivecleanup
\\NOBE-HGG-SRV-04\DB_Stream_Share\ %r": return code 1

What is the correct command there ???

Thanks in advance for any help..

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/archive-cleanup-command-recovery-conf-Standby-server-error-tp5520966p5520966.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: archive_cleanup_command recovery.conf Standby server error

От
Adrian Klaver
Дата:
On Monday, February 27, 2012 10:36:08 pm chinnaobi wrote:
> Streaming replication in the standby has successfully started (windows 2008
> server) but, the configuration in the recovery.conf :
>
> archive_cleanup_command='pg_archivecleanup
> \\\\10.1.18.16\\DB_Stream_Share\\ %r'
> What is the correct command there ???
>

pg_archivecleanup is an external module you will need to install it:

http://www.postgresql.org/docs/9.1/interactive/pgarchivecleanup.html

Here  is the page on modules:
http://www.postgresql.org/docs/9.1/interactive/contrib.html

Not sure how this is handled on Windows and if the module is included in the
installer stack.

--
Adrian Klaver
adrian.klaver@gmail.com

Re: archive_cleanup_command recovery.conf Standby server error

От
chinnaobi
Дата:
Hi Adrian,

The pg_archivecleanup.exe is already installed with postgresql 9.1, it is
under bin folder. I tried manually to run the command pg_archivecleanup.exe
\\\\10.1.18.16\\DB_Stream_Share\\ %r -- it didnt recognize the path
pg_archivecleanup.exe \\10.1.18.16\DB_Stream_Share\ %r --it didnt recognize
the path

I gave this path directly in the recovery.conf yet the same, there is
something missing ..

What is that ? please help me around this ..

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/archive-cleanup-command-recovery-conf-Standby-server-error-tp5520966p5524854.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: archive_cleanup_command recovery.conf Standby server error

От
dhaval jaiswal
Дата:
Try to give the full path of pg_archivecleanup.exe
e.g:
archive_cleanup_command = '/usr/local/pgsql/bin/pg_archivecleanup <PATH>  %r'


> Date: Wed, 29 Feb 2012 04:40:17 -0800
> From: chinnaobi@gmail.com
> To: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] archive_cleanup_command recovery.conf Standby server error
>
> Hi Adrian,
>
> The pg_archivecleanup.exe is already installed with postgresql 9.1, it is
> under bin folder. I tried manually to run the command pg_archivecleanup.exe
> \\\\10.1.18.16\\DB_Stream_Share\\ %r -- it didnt recognize the path
> pg_archivecleanup.exe \\10.1.18.16\DB_Stream_Share\ %r --it didnt recognize
> the path
>
> I gave this path directly in the recovery.conf yet the same, there is
> something missing ..
>
> What is that ? please help me around this ..
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/archive-cleanup-command-recovery-conf-Standby-server-error-tp5520966p5524854.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

Re: archive_cleanup_command recovery.conf Standby server error

От
chinnaobi
Дата:
Dear Dhaval,

I tried as you told as below archive_cleanup_command='c:\\Program
files\\postgresql\\9.1\\pg_archivecleanup.exe
\\\\10.1.18.16\\DB_Stream_Share\\ %r'

this didnt work  gave a error in the log file.

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/archive-cleanup-command-recovery-conf-Standby-server-error-tp5520966p5525452.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: archive_cleanup_command recovery.conf Standby server error

От
Adrian Klaver
Дата:
On 02/29/2012 04:40 AM, chinnaobi wrote:
> Hi Adrian,
>
> The pg_archivecleanup.exe is already installed with postgresql 9.1, it is
> under bin folder. I tried manually to run the command pg_archivecleanup.exe
> \\\\10.1.18.16\\DB_Stream_Share\\ %r -- it didnt recognize the path

When using pg_archivecleanup from the command line %r is not used.

See below for more information:

http://www.postgresql.org/docs/9.1/interactive/pgarchivecleanup.html




> pg_archivecleanup.exe \\10.1.18.16\DB_Stream_Share\ %r --it didnt recognize
> the path

What was the exact error message?

>
> I gave this path directly in the recovery.conf yet the same, there is
> something missing ..
>
> What is that ? please help me around this ..

I don't use Postgres on Windows so I am going to be of limited use here.
If it me though I would investigate/do the following:

1) Does the user you are running pg_archivecleanup as have rights to the
WAL archive directory?

2) Copy the archived WAL files to another less convoluted path and see
if it is a path problem.

>
> --
> View this message in context:
http://postgresql.1045698.n5.nabble.com/archive-cleanup-command-recovery-conf-Standby-server-error-tp5520966p5524854.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>


--
Adrian Klaver
adrian.klaver@gmail.com

Re: archive_cleanup_command recovery.conf Standby server error

От
chinnaobi
Дата:
1. I tried with below command in recovery.conf with the exe pointing to the
location where it is present.
Result:

2012-02-29 19:56:49 MYT WARNING:  archive_cleanup_command ""D:\Program Files
(x86)\PostgreSQL\9.1\data\pg_archivecleanup.exe" -d
\\NOBE-HGG-SRV-04\DB_Stream_Share\ %r": return code 1
'D:\Program' is not recognized as an internal or external command,

operable program or batch file.

It is clearly the path is not recognized by the exe.

2. I tried manually running in the DOS command

D:\Program Files (x86)\PostgreSQL\9.1\data\pg_archivecleanup.exe -d
"\\NOBE-HGG-SRV-04\DB_Stream_Share\" %r

Error: Pg_archivecleanup: must specify restartfilename

3. pg_archivecleanup.exe -d "\\NOBE-HGG-SRV-04\DB_Stream_Share\" %r
error: Invalid filename input

4. Tried pg_archivecleanup.exe -d "d:\DB_Stream_Share\" %r
Error: archive location doesn't exist tried with \\ as well same
5. Tried  pg_archivecleanup.exe -d
"d:\DB_Stream_Share\000000001000000000002D" %r
Error: must specify restartfilename

archive_Cleanup_command:the command it runs is the DOS command ??
The tool is not able to recognize the path

Adrian,
 clearly the share or the folder WAL files have permissions to everyone.
Please let me know if you got something on this ..


--
View this message in context:
http://postgresql.1045698.n5.nabble.com/archive-cleanup-command-recovery-conf-Standby-server-error-tp5520966p5530337.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: archive_cleanup_command recovery.conf Standby server error

От
Adrian Klaver
Дата:
On Friday, March 02, 2012 12:28:48 am chinnaobi wrote:
> 1. I tried with below command in recovery.conf with the exe pointing to the
> location where it is present.
> Result:
>
> 2012-02-29 19:56:49 MYT WARNING:  archive_cleanup_command ""D:\Program
> Files (x86)\PostgreSQL\9.1\data\pg_archivecleanup.exe" -d
> \\NOBE-HGG-SRV-04\DB_Stream_Share\ %r": return code 1
> 'D:\Program' is not recognized as an internal or external command,

Would seem it is having problem with space in path name and is trying to run
D:\Program as a program and failing.  Try quoting that part of the path i.e
"Program Files (x86)"

>
> operable program or batch file.
>
> It is clearly the path is not recognized by the exe.

>
> 2. I tried manually running in the DOS command
>
> D:\Program Files (x86)\PostgreSQL\9.1\data\pg_archivecleanup.exe -d
> "\\NOBE-HGG-SRV-04\DB_Stream_Share\" %r
>
> Error: Pg_archivecleanup: must specify restartfilename

Again please read the information in the link below:

http://www.postgresql.org/docs/9.1/interactive/pgarchivecleanup.html

Running from the command line is different from running from recovery.conf

The Error is telling you what to do and the link will give you the information
on how to do it.

>
> 3. pg_archivecleanup.exe -d "\\NOBE-HGG-SRV-04\DB_Stream_Share\" %r
> error: Invalid filename input
>
> 4. Tried pg_archivecleanup.exe -d "d:\DB_Stream_Share\" %r
> Error: archive location doesn't exist tried with \\ as well same
> 5. Tried  pg_archivecleanup.exe -d
> "d:\DB_Stream_Share\000000001000000000002D" %r
> Error: must specify restartfilename
>
> archive_Cleanup_command:the command it runs is the DOS command ??
> The tool is not able to recognize the path

Just the same problem repeated. As stated before %r is not recognized when the
program is run from the command line.

>
> Adrian,
>  clearly the share or the folder WAL files have permissions to everyone.
> Please let me know if you got something on this ..
>

--
Adrian Klaver
adrian.klaver@gmail.com