Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUgZH-004tGj-Ri for pgsql-general@arkaria.postgresql.org; Fri, 19 Jul 2024 05:54:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sUgZG-009ysG-1v for pgsql-general@arkaria.postgresql.org; Fri, 19 Jul 2024 05:54:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUgZF-009ys8-LH for pgsql-general@lists.postgresql.org; Fri, 19 Jul 2024 05:54:10 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sUgZD-000KYi-5s for pgsql-general@postgresql.org; Fri, 19 Jul 2024 05:54:09 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-664b4589b1aso12672437b3.1 for ; Thu, 18 Jul 2024 22:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721368445; x=1721973245; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+K0LYsVABWXGogoK0x8n5QPu7ZU/ir6+yx1vwUjPbAU=; b=kTwNGQdpsgPHjafMBIu8F6lFiQOnIooCnCfoCuT4hZx2qKTwoFHsuGUUzpOEesb7iP v8zXrqa9wCrR4Xr86wgj6/9gQ+gQTcI/UfNWrp9CHC/JoO36l9u3jFHA6pc7WUvYq+aF t20OCUHM7rK4yCOQfHcSKYABtFnAuBU3A8qtYC5oQgu+KFFHR0f59Q/B1e0lB7HA3ep7 IFjRsD4s9lMnNqLcQ7eWSUgtET3HlyXiLUWTEnkUuPJiVw8/c6UOjg1RTo+bxcrwUgks zb6q/54Bh+L3eTds4/lTMQPOgASHMKTPQ+owqrrNsGaC8gW3sEFgFSTCj5UWp+3mR7LD xGpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721368445; x=1721973245; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+K0LYsVABWXGogoK0x8n5QPu7ZU/ir6+yx1vwUjPbAU=; b=kx6vJ7lDBqomILCOgXqI4FvBwJZyYUPFzo4b5eQqWieMhQWxWajsu51SFPRjRs6/Ih MyaxM7Mo93ew7tUOlut8cYATCQVVzqE34jIi0e+XNpiGPIgAZ7E6FTcAEA3UUXOVRPBE 6RjlKw3NkTNCQLV28IFaHnV6wgXB2mj60ZM3pX7/3SYN3FqUUT6v1cslImOIqBIUqV89 dfxUgWjdJSdjeGixxouYdJNBHUpj3rxnBWyifg8dSez0Eq+nG0wAOdCRUlvVIe5gWEoJ NzTwevWrOqJ9Xma09kBTUlrG276RbUcn+Pju9LYZaW5uQVwBoM8rYg2/9gVZhzRV7oTW GeCA== X-Forwarded-Encrypted: i=1; AJvYcCW6VeIiuXwnCeGtYimYXgDI/h56DPLmCMjdHPhgPhwqh+0eyOMrsPT3kN0VTyITT3F4kSGGLJPWCZFOO/Dn8KbbPKcQpmFi2tLG+pZy X-Gm-Message-State: AOJu0YzvBTh2Ot3j5OSMXYrwOq2uPmLqyV6hf/vT4WRSaudxMLsrzo6O /gbxyaSpF7UDRGsuP2zS7ghsgazQD+U2GHarv07KEbixEX1qmaQImNShL4IA4qw8V2ECZ0Wbrka dJwmb1GmBeGYxqNn9KRDX1pRcW/WupJJ0I+A= X-Google-Smtp-Source: AGHT+IFC91pJ+6mSZRCh8Fxajze9SWADykiuR1JXUzCNMhqMdQFi1tXL/8FJooD/d63e5sbhDVF2YYzq8hGQRH2zqBA= X-Received: by 2002:a05:690c:113:b0:664:56a2:1376 with SMTP id 00721157ae682-6660f318c28mr39388947b3.21.1721368445420; Thu, 18 Jul 2024 22:54:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: azeem subhani Date: Fri, 19 Jul 2024 10:53:53 +0500 Message-ID: Subject: Re: PgbackRest and EDB Query To: Kashif Zeeshan Cc: KK CHN , pgsql-general Content-Type: multipart/alternative; boundary="000000000000b78ca6061d935266" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b78ca6061d935266 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, passwordless connection can be established using ssh key, and when you don't specify the ssh key in command using -i switch:* -i /path/to/your/private/key* You simply need to set the SSH key as the default key which I have explained earlier, how to do that. As you are currently trying through following command, without specifying an ssh key for passwordless connection. From the EDB Postgres Advanced Server nodes $ sudo -u enterprisedb ssh pgbackrest@backup-server On Fri, Jul 19, 2024 at 10:06=E2=80=AFAM Kashif Zeeshan wrote: > Hi > > On Thu, Jul 18, 2024 at 6:10=E2=80=AFPM KK CHN wrote= : > >> >> >> Hi list, >> >> Thank you all for your inputs, I am trying pgbacrest with >> Enterprised DB. Locally pgbackrest works for EDB but when I am trying = for >> remote repository I am facing an issue ( from the remote host to EDB >> server password less authentication part ) >> >> Trying to use a remote host as Repo Server I am facing the issue of >> passwordless authentication(Public key private key). >> >> 1. From the EDB server I added the user pgbackrest directory and >> generated ssh-keys and copied the id_rsa.pub to the Repo server >> (pgbackrest user's .ssh dir with necessary permissions) >> everything(passwordless auth) working to one side. >> >> From the EDB Postgres Advanced Server nodes >> $ sudo -u enterprisedb ssh pgbackrest@backup-server >> >> This works from EDB server machine without any issue(password less auth >> works) >> >> >> >> 2 But from the reposerver >> $sudo -u pgbackrest ssh enterprisedb@EDB_Server_IP unable to do >> password less auth( Its asking password for enterpridb@EDB_Server ) >> >> How to do the passwordless auth from the Repo server to the EDB server >> for the default "enterprisedb" user of EDB ? ( enterprisedb user doesn'= t >> have any home dir I mean /home/enterprisedb, so I am not sure where to >> create .ssh dir and authorized_keys for passwordless auth ) >> > Please make sure that the passwordless connection is made between both > from EDB Server to Repo Server and from Repo Server to EDB Server. > For this you need to generate the ssh keys on both EDB server abd Repo > Servers and copy the id_rsa.pub from EDB Server to Repo Server and vise > versa. > I hope this helps. > > Regards > Kashif Zeeshan > >> >> Any one who has already tackled this kindly guide me on how to achieve >> this . >> >> >> Thank you, >> Krishane >> >> >> >> >> >> >> >> On Wed, Jul 17, 2024 at 9:07=E2=80=AFPM Kashif Zeeshan >> wrote: >> >>> Hi >>> >>> On Wed, Jul 17, 2024 at 5:21=E2=80=AFPM KK CHN wro= te: >>> >>>> Hi , >>>> >>>> I am trying pgbackrest(2.52.1) with postgresql( version 16) on a la= b >>>> setup on RHEL-9. Both PostgreSQL server and a remote Repository host >>>> configured with pgbackrest and everything working fine as specified in= the >>>> documentation. >>>> >>>> note: here I am running postgres server and pgbackrest everything as >>>> postgres user and no issues in backup and recovery. >>>> >>>> >>>> >>>> Query >>>> 1. Is it possible to use PgBackrest with EnterpriseDB(EDB -16) for >>>> the backup and recovery process? Or pgback works only with the communi= ty >>>> PostgreSQL database ? >>>> >>> It support both community PG and EDB PG. >>> >>>> >>>> >>>> [ when I ran initdb script of EDB while installing EDB it creates the >>>> enterpisedb as user and edb as initial database by the script. ] >>>> >>> Enterprisedb is the default user created by EDB. >>> >>>> >>>> >>>> when I try to create the stanza on the EDB server it throws error >>>> (pasted at bottom ). >>>> >>>> >>>> >>>> NOTE: >>>> I know that my EDB running on port 5444 instead of 5432 and the >>>> dbname =3D edb instead of postgres, and user as enterpisedb instead o= f >>>> postgres how to specify these changes in the stanza creation step if = EDB >>>> Supports pgbackrest tool ? >>>> >>> You can enter this connection information in the PbBackRest Conf file >>> for the stanza you create for your EDB Instance. >>> >>> e.g >>> >>> [global]repo1-path=3D/var/lib/edb/as15/backups >>> [demo]pg1-path=3D/var/lib/edb/as15/datapg1-user=3Denterprisedbpg1-port= =3D5444pg-version-force=3D15 >>> >>> Refer to following edb documentation >>> >>> >>> https://www.enterprisedb.com/docs/supported-open-source/pgbackrest/03-q= uick_start/ >>> >>> >>>> OR Am I doing a waste exercise [if pgbackrest won't go ahead with >>>> EDB ] ? >>>> >>>> >>>> Any hints much appreciated. >>>> >>>> Thank you, >>>> Krishane >>>> >>>> >>>> ERROR: >>>> root@uaterssdrservice01 ~]# sudo -u postgres pgbackrest >>>> --stanza=3DOD_DM2 --log-level-console=3Dinfo stanza-create >>>> 2024-07-17 17:42:13.935 P00 INFO: stanza-create command begin 2.52.1= : >>>> --exec-id=3D1301876-7e055256 --log-level-console=3Dinfo --log-level-fi= le=3Ddebug >>>> --pg1-path=3D/var/lib/pgsql/16/data --repo1-host=3D10.x.y.7 >>>> --repo1-host-user=3Dpostgres --stanza=3DOD_DM2 >>>> WARN: unable to check pg1: [DbConnectError] unable to connect to >>>> 'dbname=3D'postgres' port=3D5432': connection to server on socket >>>> "/tmp/.s.PGSQL.5432" failed: No such file or directory >>>> Is the server running locally and accepting connections on tha= t >>>> socket? >>>> ERROR: [056]: unable to find primary cluster - cannot proceed >>>> HINT: are all available clusters in recovery? >>>> 2024-07-17 17:42:13.936 P00 INFO: stanza-create command end: aborted >>>> with exception [056] >>>> [root@uaterssdrservice01 ~]# >>>> >>>> >>>> >>>> >>>> --=20 Thanks Azeem Subhani --000000000000b78ca6061d935266 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

passwordless connection = can be established using ssh key, and when you don't specify the ssh ke= y in command using -i switch: -i /path/to/your/private/key
You simply need to set the SSH key as the default key which I have explaine= d earlier, how to do that.

As you are c= urrently trying through following command, without specifying an ssh key fo= r passwordless connection.
From the EDB Postgres Advanced Server nodes
$ sudo =
-u enterprisedb ssh pgbackrest@backup=
-server



On Fri, Jul 19, 2024 at 10:06=E2=80=AFA= M Kashif Zeeshan <kashi.zeesh= an@gmail.com> wrote:
Hi=C2=A0

On Thu, Jul 18, 2024= at 6:10=E2=80=AFPM KK CHN <kkchn.in@gmail.com> wrote:


Hi list,=C2=A0

Thank = you all for your=C2=A0 inputs, I am trying pgbacrest=C2=A0with Enterprised= =C2=A0DB.=C2=A0 Locally pgbackrest works for=C2=A0 EDB but when I am trying= for remote repository I am facing an issue ( from the remote host to=C2=A0= EDB server=C2=A0 password less authentication part )

<= div>Trying to=C2=A0 use a remote host=C2=A0 as Repo Server I am facing the = issue of=C2=A0 passwordless=C2=A0 authentication(Public key private key).

1.=C2=A0 From the EDB server=C2=A0 I=C2=A0 added th= e user pgbackrest directory and generated ssh-keys and copied the id_rsa.pu= b=C2=A0 =C2=A0to=C2=A0 the Repo server (pgbackrest user's .ssh dir with= necessary permissions) everything(passwordless auth) working to one side.<= /div>
F=
rom the EDB Postgres Advanced Server nodes
$ sudo =
-u enterprisedb ssh pgbackrest@backup=
-server
This works from=C2=A0 EDB server machine without any issue(password l= ess auth works)



2 Bu= t=C2=A0 =C2=A0from the reposerver=C2=A0 =C2=A0 =C2=A0=C2=A0
$sudo= -u pgbackrest=C2=A0 =C2=A0ssh enterprisedb@EDB_Server_IP=C2=A0 =C2=A0 =C2= =A0 =C2=A0unable to do password less auth( Its asking password for enterpri= db@EDB_Server )

How to do the passwordless auth=C2= =A0 from the=C2=A0 Repo server to the EDB server=C2=A0 for the default &quo= t;enterprisedb" user of=C2=A0 EDB ? ( enterprisedb user doesn't ha= ve any home dir=C2=A0 I mean /home/enterprisedb, so I am not sure where to = create .ssh dir and authorized_keys for=C2=A0 passwordless auth=C2=A0 )=C2= =A0
Please make sure that the passwordless con= nection is made between both from EDB Server to Repo Server and from Repo S= erver to EDB Server.
For this you need to generate the=C2=A0 ssh = keys on both EDB server abd Repo Servers and copy the id_rsa.pub from EDB S= erver to Repo Server and vise versa.
I hope this helps.

Regards
Kashif Zeeshan

Any one w= ho has already tackled this kindly guide=C2=A0 me on how to achieve this .<= /div>


Thank you,=C2=A0
Krishane=





=


On Wed, Jul 17, 2024 at 9:07=E2=80=AFPM Kashif Zeeshan <= kashi.zeeshan@= gmail.com> wrote:
Hi=C2=A0

On Wed, Jul 17, 2024= at 5:21=E2=80=AFPM KK CHN <kkchn.in@gmail.com> wrote:
Hi ,=C2=A0

I am trying pgbackrest(2.52.1)=C2=A0 with postgresql( version 16)=C2=A0 o= n=C2=A0 a lab setup on=C2=A0RHEL-9. Both=C2=A0 PostgreSQL server and a remo= te Repository host configured with pgbackrest and everything=C2=A0working f= ine as specified in the documentation.=C2=A0=C2=A0

note:=C2=A0 here I am running postgres server and pgbackrest everything as= postgres user and no issues in=C2=A0 backup and recovery.=C2=A0
=


Query
1. Is it possi= ble to use=C2=A0 PgBackrest with=C2=A0 EnterpriseDB(EDB -16) for the backup= and recovery process?=C2=A0Or pgback works only with the community=C2=A0 P= ostgreSQL database ?
It support both community= PG and EDB PG.=C2=A0


[ when I ran=C2=A0 in= itdb script of EDB while installing EDB it creates the enterpisedb=C2=A0 as= user and edb as initial=C2=A0 database by the script. ]
Enterprisedb=C2=A0is the default user created by EDB.=C2=A0<= /div>


when I try to create the stanza = on the EDB server it throws error=C2=A0 (pasted at bottom ).

=


NOTE:=C2=A0
I know that= =C2=A0 my EDB=C2=A0 running on=C2=A0 port 5444 instead of=C2=A0 5432 and th= e dbname =3D edb instead of postgres, and user as=C2=A0 enterpisedb instead= of postgres how to specify these changes in the stanza creation step if=C2= =A0 EDB Supports pgbackrest tool ?=C2=A0 =C2=A0
You can enter this connection information in the PbBackRest Conf file for= the stanza you create for your EDB Instance.
=C2=A0
e.= g
[global]
repo1-path=3D/var/lib/edb/as15/backups

[demo]
pg1-path=
=3D/var/lib/edb/as15/data
pg1-user=
=3Denterprisedb
pg1-port=
=3D5444
pg-version-forc=
e=3D15
Refer t= o following edb documentation

=C2=A0
OR=C2=A0 = =C2=A0Am I doing a waste exercise=C2=A0 [if pgbackrest won't go ahead w= ith EDB ] ?


Any hints much apprecia= ted.=C2=A0

Thank you,
Krishane


ERROR:
root@uaterssdrservice01 ~]#= sudo -u postgres pgbackrest --stanza=3DOD_DM2 --log-level-console=3Dinfo = =C2=A0stanza-create
2024-07-17 17:42:13.935 P00 =C2=A0 INFO: stanza-crea= te command begin 2.52.1: --exec-id=3D1301876-7e055256 --log-level-console= =3Dinfo --log-level-file=3Ddebug --pg1-path=3D/var/lib/pgsql/16/data --repo= 1-host=3D10.x.y.7 --repo1-host-user=3Dpostgres --stanza=3DOD_DM2
WARN: u= nable to check pg1: [DbConnectError] unable to connect to 'dbname=3D= 9;postgres' port=3D5432': connection to server on socket "/tmp= /.s.PGSQL.5432" failed: No such file or directory
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 Is the server running locally and accepting connections on that = socket?
ERROR: [056]: unable to find primary cluster - cannot proceed=C2=A0 =C2=A0 =C2=A0 =C2=A0HINT: are all available clusters in recovery?2024-07-17 17:42:13.936 P00 =C2=A0 INFO: stanza-create command end: abort= ed with exception [056]
[root@uaterssdrservice01 ~]#

<= /div>





--
Thanks
Azeem Subhani
--000000000000b78ca6061d935266--