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 1tKHQI-007ppz-VL for pgsql-admin@arkaria.postgresql.org; Sun, 08 Dec 2024 13:34: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 1tKHPH-001ROi-Oi for pgsql-admin@arkaria.postgresql.org; Sun, 08 Dec 2024 13:33:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKHPG-001ROV-GK for pgsql-admin@lists.postgresql.org; Sun, 08 Dec 2024 13:33:08 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tKHPA-001fUp-Ct for pgsql-admin@lists.postgresql.org; Sun, 08 Dec 2024 13:33:06 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2e56750bb0dso2551598a91.0 for ; Sun, 08 Dec 2024 05:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; t=1733664779; x=1734269579; darn=lists.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=9RNxfdJwOebeVnc3zpG+DByu5kKiPujaAx1vPTgJaKg=; b=kEfRI9H2fpHkwMz6IoEL10k3p03gvkEcNh+Rq/tJ8aH7zW+8cUQwipXDaFnUH1mCgp Td6KaD2//U1mN5K7UPRKKENNpyqIRHU6FNAjtWMcv8aMe2vEhbRnk4YVsGqRdoGfnj53 CW09UdHPM2bsTjFliCX8Drf2u17s4ntr3KNiMod847E0Am85rxV1XRC2+oQrdyyG3Rkw R9HLOQfxYprI1aVmucEgV2m92D7yoROBsxJXHLs2+kTKzBvetJ9FExpvDZkrJhoKVybA cgXDIn4XaxAKoRs+6cOb4xnj+Of86DfxIRx51MVGF1Wbdz6DpzhFXGy9nYIqvoyQyYET 7BXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733664779; x=1734269579; 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=9RNxfdJwOebeVnc3zpG+DByu5kKiPujaAx1vPTgJaKg=; b=nmc7FKhbzGj6LOzbdh3hgx79v/dYrj5qKAnxmxtUDQm0zU04ChJk4fSwuN9c62fkkk jobHehJmP4ek5RRMN0iYUwhjerVzV7WXb/+Yjr+Tuf6wtDZVNl041eS2Z3UnicFKUtVR pvA8rziIIXXW1j40baTFeaUuv2kY4Gn/UGFigNWAEuFq29Ir1uuAiyTGxQfVXqxLurNj sZywO0PYY+WhizOcakAAcXtfTP2xJAW6foUTVtvOovrBpTX1CTrUdqWC0qbWTxYs/vh4 M1k6dtBahNrOBJpc46XiwYeU71caVF5TPXTEDK+0EMmP4ClAF/keeKPQr8YmnXlshpKh GlWw== X-Gm-Message-State: AOJu0YxxFf1c/C//F7gnX85VDuvOuGzGZEHIk7dYKEcs8eKk7bEh4Kc/ 3ZrzOQiwTWBMFa/J3ATylCNdzCFXBlGTQXdPGWamuH2Oiu6qj0kK4NIYOlaPoKHZMm3r31EaT2c LhDJPyhpkRsfYiCFtWBfHZhjDzDpiZCp9aOxz+g== X-Gm-Gg: ASbGncv7JmVR90NxDAGFL6Ayb7VvObNR8V90Q5TUwxa+xRuZF2Mx2vmMljjYmHSaW5t RZK1ykaBYl1ivw6c8cIczG2StpKiwMw== X-Google-Smtp-Source: AGHT+IEDrjLn/gwrPU6J1iMFO5uc/lh/vs0f5yVX+YPQv0hOMug+AgT3CQIfSkGTMpxeFZYF6vZBMleE/W+8dyolY/I= X-Received: by 2002:a17:90b:558e:b0:2ee:c5ea:bd91 with SMTP id 98e67ed59e1d1-2ef6aadb4d6mr15163717a91.29.1733664778868; Sun, 08 Dec 2024 05:32:58 -0800 (PST) MIME-Version: 1.0 References: <7882d3da-3445-4c80-a766-1246e55415da@netcologne.de> In-Reply-To: <7882d3da-3445-4c80-a766-1246e55415da@netcologne.de> From: Shawn McKee Date: Sun, 8 Dec 2024 08:32:48 -0500 Message-ID: Subject: Re: Postgres compatibility with RHEL To: vrms Cc: pgsql-admin@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000004def520628c24987" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004def520628c24987 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Siddhartha, We just did something similar. We had Postrgresql 11 on CentOS 7.9 and needed to get to RHEL 9.4 We set up new hardware as RHEL 9.4 and installed Postgresql 15.10 on it but didn't initialize the DB. - dnf install --enablerepo=3Dpgdg15 postgresql15.x86_64 postgresql15-contrib.x86_64 postgresql15-libs.x86_64 postgresql15-server.x86_64 - (version 15.10-1PGDG) You can get the repos set up on CentOS 7 via: yum --disablerepo=3D* -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-red= hat-repo-latest.noarch.rpm We then upgraded the CentOS 7.9 system using the --link option: /usr/pgsql-15/bin/pg_upgrade --link --verbose &> ~/pg_upgrade_15.log On our DB, this took only about 9 seconds (we run just a couple DBs but one has is tracking 30 million file details) but we have the DB on NVMe devices= . Once you have the master CentOS 7.9 version on Postgresql 15, you can set up the RHEL 9.4 version as a slave standby node using pg_basebackup. You can google for guides like https://medium.com/@wasiualhasib/postgresql-15-master-slave-configuration-u= sing-streaming-replication-step-by-step-a4ccb2ba7083 Once you are synchronized, you can shutdown the master, shutdown the slave, reconfigure the slave to be the former master (change hostname and IP adddress(es)) and bring it back up. To get to 16 you can run the pg_upgrade command similarly to how you did the original master on CentOS 7.9. This process should minimize the amount of time you have to be down. Shawn On Sat, Dec 7, 2024 at 11:43=E2=80=AFAM vrms wrote: > I believe the best way would be to > > 1. setup a new rhel9 server with pg16 > 2. get a dump (pg_dumpall) from the old machine onto the new machine > 3. restore that dump > 4. copy pg_hba.conf and postgresql.conf over to the new machine > 4.1. make sure to keep the new postgresql.conf and adjust custom > settings you may have on the old machine with making sure those settings > have not changed > > If you want to do this close to zero downtime, you could set up logical > replication to the new pg16 machine and once that is finished switch over > and promote that to be the new main. > > > > On 04.12.24 14:03, Siddhartha Jain wrote: > > Hi, > > Please let me know if Postgresql 16 is compatible with RHEL 7.9 version > and RHEL 9.1 version. > I need to upgrade postgres from 11.22 to 16.6 and need information for > that as the OS version is going to upgrade from 7.9 to 9.1. > Also, let me know the strategies if any to upgrade both RHEL and DB. > > Thanks, > Siddhartha > > --0000000000004def520628c24987 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Siddhartha,

We just did something similar.=C2= =A0 =C2=A0We had Postrgresql 11 on CentOS 7.9 and needed to get to RHEL 9.4=

We set up new hardware as RHEL 9.4 and installed = Postgresql 15.10 on it but didn't initialize the DB.=C2=A0=C2=A0
<= div>
  • dnf install --enabler= epo=3Dpgdg15 postgresql15.x86_64 postgresql15-contrib.x86_64 postgresql15-l= ibs.x86_64 postgresql15-server.x86_64

  • (version 15.10-1PGDG)

You can get the repos set up on CentOS 7 via:
<= div>We then upgraded the CentOS 7.9 system using the --link option:

/usr/pgsql-15/bin/pg_upgrad= e --link=C2=A0 --verbose &> ~/pg_upgrade_15.log

On our DB, this took = only about 9 seconds (we run just a couple DBs but one has is tracking 30 m= illion file details) but we have the DB on NVMe devices.

Once you have the master CentOS 7.9 version on Postgresql 15, you ca= n set up the RHEL 9.4 version as a slave standby node using pg_basebackup.= =C2=A0 =C2=A0You can google for guides like=C2=A0https://medium.com/@wasiualhasib/pos= tgresql-15-master-slave-configuration-using-streaming-replication-step-by-s= tep-a4ccb2ba7083

Once you are synchronized, yo= u can shutdown=C2=A0the master, shutdown the slave, reconfigure the slave t= o be the former master (change hostname and IP adddress(es)) and bring it b= ack up.

To get to 16 you can run the pg_upgrade co= mmand similarly to how you did the original master on CentOS 7.9.=C2=A0 =C2= =A0This process should minimize the amount of time you have to be down.

Shawn

=C2=A0=C2=A0

On Sat, Dec 7, 2024 at 11:43=E2=80=AFAM vrms <vrms@netcologne.de> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex"> =20 =20 =20
I believe the best way would be to

=C2=A0 1. setup a new rhel9 server with pg16
=C2=A0 2. get a dump (pg_dumpall) from the old machine onto the new machine
=C2=A0 3. restore that dump
=C2=A0 4. copy pg_hba.conf and postgresql.conf over to the new machine<= br> =C2=A0 4.1. make sure to keep the new postgresql.conf and adjust custom settings you may have on the old machine with making sure those settings have not changed

If you want to do this close to zero downtime, you could set up logical replication to the new pg16 machine and once that is finished switch over and promote that to be the new main.



On 04.12.24 14:03, Siddhartha Jain wrote:
=20
Hi,

Please let me know if Postgresql 16 is compatible with RHEL 7.9 version and RHEL 9.1 version.
I need to upgrade postgres from 11.22 to 16.6 and need information for that as the OS version is going to upgrade from 7.9 to 9.1.=C2=A0
Also, let me know the strategies if any to upgrade both RHEL and DB.=C2=A0

Thanks,
Siddhartha=C2=A0
--0000000000004def520628c24987--