From: MichaelDBA <MichaelDBA@sqlexec.com>
To: Erika Knihti-Van Driessche <erika.knihti@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Multiple postgresql clusters with same version and separate binaries
Date: Fri, 04 Jan 2019 09:32:44 -0500
Message-ID: <5C2F6E8C.7070402@sqlexec.com> (raw)
In-Reply-To: <CALgXhV_8SKtraLOYWtJcqL4_9X9i9WT94Wx2-1sp99ZyvJy6WQ@mail.gmail.com>
References: <CALgXhV_8SKtraLOYWtJcqL4_9X9i9WT94Wx2-1sp99ZyvJy6WQ@mail.gmail.com>
To put it simply: you cannot run different major versions of PostgreSQL
with the same binaries. 3 things need to be separate. You named 2 of
them: data directory and port. The 3rd one is separate binary locations
for each PG cluster instance running on the same host.
What I do is create a separate .profile_pgsql file for each PG cluster
instance. This file contains all the stuff necessary to distinguish
between multiple PG clusters. Here is an example for a specific Linux
distro...
export VERSION=9.6
export PGROOT=/usr/pgsql-$VERSION
export PGBASE=/var/lib/pgsql/$VERSION
export PATH=$PGROOT/bin:$PGROOT/share:$PATH
export PGLIB=$PGROOT/lib
export MANPATH=$PGROOT/share/man:$MANPATH
export LD_LIBRARY_PATH=$PGROOT/bin:$PGBASE/share:$PATH
export PGDATA=$PGBASE/data
export PGPASSFILE=~/.pgpass
export PGUSER=postgres
export PGDATABASE=postgres
export PGPORT=5432
Regards,
Michael Vitale
> Erika Knihti-Van Driessche <mailto:erika.knihti@gmail.com>
> Friday, January 4, 2019 9:21 AM
> Hi,
>
> I have 10+ postgresql clusters (v 9.6) running on one machine - each
> having their own data directory and port. They all share same binaries
> though, and this is now giving me some headache.. I cannot shutdown
> all clusters at the same time, so upgrading them is quite impossible.
>
> I know that running several versions of postgres is possible on one
> machine - I suppose this would also work out with same version running
> on different locations, like /db1/PostgreSQL/10, /db2/PostgreSQL/10..
> etc..? Has anyone any experience with this kind of problem?
>
> All help and ideas appreciated! :-)
>
> Thanks,
> Erika
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: MichaelDBA@sqlexec.com, erika.knihti@gmail.com, pgsql-admin@lists.postgresql.org, pgsql-general@lists.postgresql.org
Subject: Re: Multiple postgresql clusters with same version and separate binaries
In-Reply-To: <5C2F6E8C.7070402@sqlexec.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox