Re: Streaming replication issue

From: John Wiencek <jwiencek3(at)comcast(dot)net>
To: mallikarjun t <mallit333(at)gmail(dot)com>
Cc: Luca Ferrari <fluca1978(at)gmail(dot)com>, soumitra bhandary <soumitra(dot)bhandary(at)hotmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Streaming replication issue
Date: 2019-09-05 15:54:26
Message-ID: E28CBC70-3EB7-45AB-B3BC-882FEBDCECCF@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

H

When you set up streaming replication your read-only replica should be created using pg_basebackup.

for example;

Run this from the streamed/slave server. Set variable $PGDATA. Make sure directory structure exits and is empty( no file in $PGDATA on slave server)

pg_basebackup --pgdata=$PGDATA --label=standby --host 10.64.98.199--usernamerepuser --wal-method=stream --write-recovery-conf.

Your PGDATA direetory on the streamed/salve server needs to be empty. The basebackup will copy ALL files from the master to the slave. This would include PostgreSQL.conf , pg_hba.conf and all associated files for the databases.

Therefore the streaming/slave server will be EXACTLY the same as the master. Same users, same port, same data.

Reagards

John Wiencek

> On Sep 5, 2019, at 10:27 AM, mallikarjun t <mallit333(at)gmail(dot)com> wrote:
>
> No I am connected salve server details to connect
>
> On Thu, Sep 5, 2019, 8:52 PM Luca Ferrari <fluca1978(at)gmail(dot)com <mailto:fluca1978(at)gmail(dot)com>> wrote:
> On Thu, Sep 5, 2019 at 2:45 PM mallikarjun t <mallit333(at)gmail(dot)com <mailto:mallit333(at)gmail(dot)com>> wrote:
> > I want connect to sever by using following command /opt/edb/as9.6/bin/psql
> >
> >
> > role "postgres" not a log in permission error message I am getting , I am try to put port number along with that
> > error: could not connect to the server, locally running this port number 5432.
> >
>
> I'm sorry but it is quite hard to understand what you are doing.
> If I'm getting right, from you description, you are replicating your
> server and trying to connect as 'postgres' to such clone, but how can
> the clone has a user that did not existed (or did not have
> permissions) on the original server too?
> I thinm you should connect to the "new master" with the same "old
> master" credentials.
>
> Luca

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Juan José Santamaría Flecha 2019-09-05 16:08:39 Re: Streaming replication issue
Previous Message mallikarjun t 2019-09-05 15:27:45 Re: Streaming replication issue