Streaming Replication woes

Lists: pgsql-general
From: Sean Patronis <spatronis(at)add123(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Streaming Replication woes
Date: 2011-11-04 14:50:00
Message-ID: 4EB3FB98.8040409@add123.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I am running Postgres 9.1

I have followed the howto here:
http://wiki.postgresql.org/wiki/Streaming_Replication

I am attempting to replicate an existing database.

On the Master, I get the following error in the postgres log file:

FATAL: must be replication role to start walsender

On the slave I get this:
FATAL: could not connect to the primary server: FATAL: must be
replication role to start walsender

I have googled both of those log entries to no avail.

note that the sender process on the master is not running.

What simple step am I missing?


From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: Sean Patronis <spatronis(at)add123(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Streaming Replication woes
Date: 2011-11-04 14:56:17
Message-ID: CA+h6Ahgu=zMDJ=vDcm2yyKJCPZOzKDQCQFaYyUM36qSdCN2rqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

*
*
On Fri, Nov 4, 2011 at 8:20 PM, Sean Patronis <spatronis(at)add123(dot)com> wrote:

> I am running Postgres 9.1
>
> I have followed the howto here:
> http://wiki.postgresql.org/wiki/Streaming_Replication
>
> I am attempting to replicate an existing database.
>
> On the Master, I get the following error in the postgres log file:
>
> FATAL: must be replication role to start walsender
>
>
>
On the slave I get this:
> FATAL: could not connect to the primary server: FATAL: must be
> replication role to start walsender
>
> I have googled both of those log entries to no avail.
>
> note that the sender process on the master is not running.
>
> What simple step am I missing?
>
>
>
Step 3 from wiki. and reload PG-instance

- *3.* Set up connections and authentication so that the standby server
can successfully connect to the *replication* pseudo-database on the
primary.

$ $EDITOR postgresql.conf

listen_addresses = '192.168.0.10'

$ $EDITOR pg_hba.conf

# The standby server must have superuser access privileges.
host replication postgres 192.168.0.20/22 trust

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/


From: Sean Patronis <spatronis(at)add123(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Streaming Replication woes
Date: 2011-11-04 15:19:01
Message-ID: 4EB40265.6040902@add123.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 11/04/2011 10:59 AM, Thom Brown wrote:
> On 4 November 2011 16:50, Sean Patronis<spatronis(at)add123(dot)com> wrote:
>> I am running Postgres 9.1
>>
>> I have followed the howto here:
>> http://wiki.postgresql.org/wiki/Streaming_Replication
>>
>> I am attempting to replicate an existing database.
>>
>> On the Master, I get the following error in the postgres log file:
>>
>> FATAL: must be replication role to start walsender
>>
>>
>> On the slave I get this:
>> FATAL: could not connect to the primary server: FATAL: must be replication
>> role to start walsender
>>
>> I have googled both of those log entries to no avail.
>>
>> note that the sender process on the master is not running.
>>
>> What simple step am I missing?
> What have you got primary_conninfo set to on the standby in
> recovery.conf? Are you trying to use a regular user? If so, you will
> have to grant it REPLICATION permissions on the primary, which was
> introduced in 9.1.
>

The primary_conninfo in the recovery.conf is set to :
primary_conninfo = 'host=192.168.127.12 port=5432 user=postgres'

So I should just have to grant the postgres user REPLICATION
permissions, and be good?


From: Thom Brown <thom(at)linux(dot)com>
To: Sean Patronis <spatronis(at)add123(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Streaming Replication woes
Date: 2011-11-04 15:25:03
Message-ID: CAA-aLv6am=SYQbbYAvKAOC1AdrsF36m+wz-10EP54bUATb52LQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 4 November 2011 17:19, Sean Patronis <spatronis(at)add123(dot)com> wrote:
> On 11/04/2011 10:59 AM, Thom Brown wrote:
>>
>> On 4 November 2011 16:50, Sean Patronis<spatronis(at)add123(dot)com>  wrote:
>>>
>>> I am running Postgres 9.1
>>>
>>> I have followed the howto here:
>>> http://wiki.postgresql.org/wiki/Streaming_Replication
>>>
>>> I am attempting to replicate an existing database.
>>>
>>> On the Master, I get the following error in the postgres log file:
>>>
>>> FATAL:  must be replication role to start walsender
>>>
>>>
>>> On the slave I get this:
>>> FATAL:  could not connect to the primary server: FATAL:  must be
>>> replication
>>> role to start walsender
>>>
>>> I have googled both of those log entries to no avail.
>>>
>>> note that the sender process on the master is not running.
>>>
>>> What simple step am I missing?
>>
>> What have you got primary_conninfo set to on the standby in
>> recovery.conf?  Are you trying to use a regular user?  If so, you will
>> have to grant it REPLICATION permissions on the primary, which was
>> introduced in 9.1.
>>
>
>
> The primary_conninfo in the recovery.conf is set to :
> primary_conninfo      = 'host=192.168.127.12 port=5432 user=postgres'
>
> So I should just have to grant the postgres user REPLICATION permissions,
> and be good?

Well the postgres user will be a superuser, so doesn't need to be
granted such a permission.

Have you got the necessary entry in pg_hba.conf as Raghavendra
highlighted? It will need configuring to accept a connection from the
IP address of the standby server.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
Cc: Sean Patronis <spatronis(at)add123(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Streaming Replication woes
Date: 2011-11-04 15:31:53
Message-ID: CA+U5nM+nu=ov=88AEhkcr9a68i0NW2Nba0UkvcYB42tEw+dR_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Fri, Nov 4, 2011 at 2:56 PM, Raghavendra
<raghavendra(dot)rao(at)enterprisedb(dot)com> wrote:

> # The standby server must have superuser access privileges.
> host replication postgres 192.168.0.20/22 trust

I strongly recommend you don't use those settings, since they result
in no security at all.

It won't block you from getting replication working, but it won't
block anyone else either.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


From: Sean Patronis <spatronis(at)add123(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Streaming Replication woes
Date: 2011-11-04 15:43:55
Message-ID: 4EB4083B.9020807@add123.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 11/04/2011 11:25 AM, Thom Brown wrote:
> On 4 November 2011 17:19, Sean Patronis<spatronis(at)add123(dot)com> wrote:
>> On 11/04/2011 10:59 AM, Thom Brown wrote:
>>> On 4 November 2011 16:50, Sean Patronis<spatronis(at)add123(dot)com> wrote:
>>>> I am running Postgres 9.1
>>>>
>>>> I have followed the howto here:
>>>> http://wiki.postgresql.org/wiki/Streaming_Replication
>>>>
>>>> I am attempting to replicate an existing database.
>>>>
>>>> On the Master, I get the following error in the postgres log file:
>>>>
>>>> FATAL: must be replication role to start walsender
>>>>
>>>>
>>>> On the slave I get this:
>>>> FATAL: could not connect to the primary server: FATAL: must be
>>>> replication
>>>> role to start walsender
>>>>
>>>> I have googled both of those log entries to no avail.
>>>>
>>>> note that the sender process on the master is not running.
>>>>
>>>> What simple step am I missing?
>>> What have you got primary_conninfo set to on the standby in
>>> recovery.conf? Are you trying to use a regular user? If so, you will
>>> have to grant it REPLICATION permissions on the primary, which was
>>> introduced in 9.1.
>>>
>>
>> The primary_conninfo in the recovery.conf is set to :
>> primary_conninfo = 'host=192.168.127.12 port=5432 user=postgres'
>>
>> So I should just have to grant the postgres user REPLICATION permissions,
>> and be good?
> Well the postgres user will be a superuser, so doesn't need to be
> granted such a permission.
>
> Have you got the necessary entry in pg_hba.conf as Raghavendra
> highlighted? It will need configuring to accept a connection from the
> IP address of the standby server.
>
I have both these entries on the pg_hba.conf Master server:
host replication all 192.168.127.6/32 trust
host all all 192.168.127.6/32 trust

and still cannot get replication to start.

I can make normal postgresql database connections fine to the master
database from the slave with these pg_hba.conf settings, so it is surely
not a firewall issue.


From: Sean Patronis <spatronis(at)add123(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [BULK] Re: Streaming Replication woes
Date: 2011-11-04 15:45:53
Message-ID: 4EB408B1.8060206@add123.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 11/04/2011 11:31 AM, Simon Riggs wrote:
> On Fri, Nov 4, 2011 at 2:56 PM, Raghavendra
> <raghavendra(dot)rao(at)enterprisedb(dot)com> wrote:
>
>> # The standby server must have superuser access privileges.
>> host replication postgres 192.168.0.20/22 trust
> I strongly recommend you don't use those settings, since they result
> in no security at all.
>
> It won't block you from getting replication working, but it won't
> block anyone else either.
>
I agree, you should use the default trust of that network. But at this
point, I just want it to replicate in this test environment. I can lock
it down after it is working.