Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5u5n-0000Ms-EY for pgsql-admin@arkaria.postgresql.org; Thu, 05 Sep 2019 15:54:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i5u5m-00011A-7p for pgsql-admin@arkaria.postgresql.org; Thu, 05 Sep 2019 15:54:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5u5l-0000qg-F6 for pgsql-admin@lists.postgresql.org; Thu, 05 Sep 2019 15:54:37 +0000 Received: from resqmta-ch2-01v.sys.comcast.net ([2001:558:fe21:29:69:252:207:33]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5u5i-0002K3-0q for pgsql-admin@lists.postgresql.org; Thu, 05 Sep 2019 15:54:37 +0000 Received: from resomta-ch2-10v.sys.comcast.net ([69.252.207.106]) by resqmta-ch2-01v.sys.comcast.net with ESMTP id 5rdoioFIQrjWJ5u5cisNRF; Thu, 05 Sep 2019 15:54:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1567698868; bh=Tf+UTihGAaTTZRX/aJggNoACQdXzBqVrTm6BKWYqERM=; h=Received:Received:From:Message-Id:Content-Type:Mime-Version: Subject:Date:To; b=tcgAvt9A9pzhNhDNN6L2Afm5XcdWMbO9Rsfe48/WMdvweVlv0F7FhvjGjnB12CBJI MiEkFv5yROIJJE62cANuLBIV4US5a07jPUFvcUES63REo1U0qkuqgquqt/ZrSKOSSN 0XQc/0XowuSSMcu2pfGyhOh/EBn222XGzqxsWV/WBTzuGSr0588FX3GA+ZaOP+OgWf A+5S4qMR6VkUjCzcNvDZYdJ/wWyKVSwhIbkyqbUdAKOlqerCdat98kmKHrv7NO0t1r kw2eI2/DRW9E3TDrcIRUblvRK5jubU7VmsAIA+bBurbWjdyOiKOVaaCR+QzVqFY57F ulpo5s4c4h5pQ== Received: from [IPv6:2601:240:d080:12b4:e860:ada4:b710:bb5] ([IPv6:2601:240:d080:12b4:e860:ada4:b710:bb5]) by resomta-ch2-10v.sys.comcast.net with ESMTPA id 5u5ai6vZU8vGt5u5bipgqL; Thu, 05 Sep 2019 15:54:27 +0000 X-Xfinity-VMeta: sc=-100;st=legit From: John Wiencek Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_CF81736B-3D28-4713-BF09-61F53F2F2245" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Streaming replication issue Date: Thu, 5 Sep 2019 10:54:26 -0500 In-Reply-To: Cc: Luca Ferrari , soumitra bhandary , Pgsql-admin To: mallikarjun t References: X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_CF81736B-3D28-4713-BF09-61F53F2F2245 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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=3D$PGDATA --label=3Dstandby --host = 10.64.98.199--usernamerepuser --wal-method=3Dstream = --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 = wrote: >=20 > No I am connected salve server details to connect >=20 > On Thu, Sep 5, 2019, 8:52 PM Luca Ferrari > wrote: > On Thu, Sep 5, 2019 at 2:45 PM mallikarjun t > 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. > > >=20 > 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. >=20 > Luca --Apple-Mail=_CF81736B-3D28-4713-BF09-61F53F2F2245 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii 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=3D$PGDATA --label=3Dstandby= --host 10.64.98.199--usernamerepuser --wal-method=3Dstream = --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@gmail.com>= wrote:

No I am connected salve server details to = connect

On Thu, Sep 5, 2019, 8:52 PM Luca Ferrari <fluca1978@gmail.com>= wrote:
On Thu, Sep 5, 2019 at 2:45 PM mallikarjun t = <mallit333@gmail.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

= --Apple-Mail=_CF81736B-3D28-4713-BF09-61F53F2F2245--