Re: Streaming replication - slave not getting promoted

From: Jayadevan M <maymala(dot)jayadevan(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Streaming replication - slave not getting promoted
Date: 2015-01-05 02:54:47
Message-ID: CAFS1N4hFkTQAcr+bXBj2tKmmuDqm6DKmoHeHmcjaKXgUmsLnpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 4, 2015 at 8:01 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 01/04/2015 06:09 AM, Jayadevan M wrote:
>
>> Hi,
>> I have streaming replication set up, with PostgreSQL 9.3. The entries in
>> recovery.conf on the slave are as follows -
>> standby_mode = 'on'
>> primary_conninfo = 'host=127.0.0.1 port=2345 user=postgres
>> password=password'
>> restore_command = 'cp /pgdata/archive/%f "%p"'
>> trigger_file = ‘/tmp/down.trg’
>>
>> In postgresql.conf on the slave, I have set
>> hot_standby = on
>>
>> Replication is working fine. The trigger file does get created by the
>> failover script when I shut down the primary. But I just keep getting
>> these entries in the log file in the slave and it does not get promoted.
>> FATAL: could not connect to the primary server: could not connect to
>> server: Connection refused
>>
>> Any suggestions?
>>
>
> Try pg_ctl promote on the standby server to see if it works at all:
>
> http://www.postgresql.org/docs/9.3/interactive/app-pg-ctl.html
>
> If it does then maybe your standby cannot 'see' the trigger file.
>
>
> That was indeed the case. I had copied/pasted the code in Microsoft Word
and then copied/pasted from Word to recovery.conf. Word intelligently (?)
changed the 'quote' type around the file name.
I changed log_min_messages to debug2 and saw that the trigger file name was
not coming up right.

Thanks.
Regards,
Jayadevan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-01-05 03:20:48 Re: Streaming replication - slave not getting promoted
Previous Message Flyingfox Lee 2015-01-05 02:38:03 Re: group by of multi columns