Обсуждение: multiple instances on one box?

Поиск
Список
Период
Сортировка

multiple instances on one box?

От
Tim Ellis
Дата:
Hi,

Hopefully not a FAQ, but I wonder, how do I start multiple Postgres
instances on one computer?

To elaborate, I want to start one Postgres listening on say 7000 for
$DATA=/opt/pgdata1 and another Postgres listening on say 7100 for
$DATA=/opt/pgdata2.

Thanks,
Tim Ellis
DBA, Gamet

Re: multiple instances on one box?

От
Andrew Perrin
Дата:
What's the reason for doing this? Just use separate databases -- if
necessary, with different users given permissions on each -- in the same
postmaster instance.

ap

----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists@perrin.socsci.unc.edu * andrew_perrin (at) unc.edu


On Mon, 3 Jun 2002, Tim Ellis wrote:

> Hi,
>
> Hopefully not a FAQ, but I wonder, how do I start multiple Postgres
> instances on one computer?
>
> To elaborate, I want to start one Postgres listening on say 7000 for
> $DATA=/opt/pgdata1 and another Postgres listening on say 7100 for
> $DATA=/opt/pgdata2.
>
> Thanks,
> Tim Ellis
> DBA, Gamet
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>


Re: multiple instances on one box?

От
Naomi Walker
Дата:
At 12:18 PM 6/3/2002 , Andrew Perrin wrote:
>What's the reason for doing this? Just use separate databases -- if
>necessary, with different users given permissions on each -- in the same
>postmaster instance.

We will be using separate instances for failover purposes in our clustered
environment.



Re: multiple instances on one box?

От
Andrew Perrin
Дата:
I won't claim to understand that fully, but just would say that I'd be
worried if a postmaster went down -- worried enough that I'd want to have
backup hardware in a mission-critical situation, not just a backup
postmaster instance. What's the theoretical case in which a postmaster
dies or is inaccessible but the same machine could serve the same database
with a different process?

ap

----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists@perrin.socsci.unc.edu * andrew_perrin (at) unc.edu


On Mon, 3 Jun 2002, Naomi Walker wrote:

> At 12:18 PM 6/3/2002 , Andrew Perrin wrote:
> >What's the reason for doing this? Just use separate databases -- if
> >necessary, with different users given permissions on each -- in the same
> >postmaster instance.
>
> We will be using separate instances for failover purposes in our clustered
> environment.
>
>
>


Re: multiple instances on one box?

От
Tom Lane
Дата:
Tim Ellis <Tim.Ellis@gamet.com> writes:
> Hopefully not a FAQ, but I wonder, how do I start multiple Postgres
> instances on one computer?

Isn't it in the FAQ?  Just give them different port numbers and
data directories, and away you go.  (As long as you don't exceed
kernel limits on total size of shared memory, total number of
semaphores, open files, etc.)

I concur with Andrew Perrin's concerns about why you are doing this,
though.  I can think of a couple of valid reasons:

1. You want to run multiple Postgres versions.  (That's why I have
three or four postmasters running here.)

2. You want airtight separation between two instances, eg because
you are doing C-code development in one of the instances and so you
occasionally crash it.

But as a mechanism for redundancy against hardware failures it doesn't
seem particularly useful.

            regards, tom lane

Re: multiple instances on one box?

От
Tim Ellis
Дата:
On Mon, 3 Jun 2002 15:18:26 -0400 (EDT)
Andrew Perrin <clists@perrin.socsci.unc.edu> wrote:

> > To elaborate, I want to start one Postgres listening on say 7000 for
> > $DATA=/opt/pgdata1 and another Postgres listening on say 7100 for
> > $DATA=/opt/pgdata2.
>
> What's the reason for doing this? Just use separate databases -- if
> necessary, with different users given permissions on each -- in the same
> postmaster instance.

Easy mobility of databases from one computer to another.

Theory says different databases within one instance and different
instances have the same expressive power. Therefore, theory would dictate,
moving a database between instances is as easy as moving instances between
computers.

Reality is that moving a database from one instance to another is more
difficult than moving an instance from one computer to another. The former
requires specialised tools that are complicated and error-prone. The
latter requires generic tools (you know, like 'scp') that are simple.

In saying that, I make an assumption: that Postgres is similar to Sybase
or Oracle and that once a database achieves a certain complexity, the
tools (that allow database migration on small example databases) don't
scale to multi-gigabyte multi-hundred relations databases.

YMMV.

I'm still interested in knowing if running multiple instances on a single
computer is possible and how to do it. :)

--
Tim Ellis
DBA, Gamet

Re: multiple instances on one box?

От
"Sander Steffann"
Дата:
I have seen one reason myself for this: running multiple versions of
PostgreSQL on one machine. I have tried this once myself, to try out a new
version while still providing our customers with the old version.

Sander.

----- Original Message -----
From: "Andrew Perrin" <clists@perrin.socsci.unc.edu>
To: "Tim Ellis" <Tim.Ellis@gamet.com>
Cc: <pgsql-admin@postgresql.org>
Sent: Monday, June 03, 2002 9:18 PM
Subject: Re: [ADMIN] multiple instances on one box?


> What's the reason for doing this? Just use separate databases -- if
> necessary, with different users given permissions on each -- in the same
> postmaster instance.
>
> ap
>
> ----------------------------------------------------------------------
> Andrew J Perrin - http://www.unc.edu/~aperrin
> Assistant Professor of Sociology, U of North Carolina, Chapel Hill
> clists@perrin.socsci.unc.edu * andrew_perrin (at) unc.edu
>
>
> On Mon, 3 Jun 2002, Tim Ellis wrote:
>
> > Hi,
> >
> > Hopefully not a FAQ, but I wonder, how do I start multiple Postgres
> > instances on one computer?
> >
> > To elaborate, I want to start one Postgres listening on say 7000 for
> > $DATA=/opt/pgdata1 and another Postgres listening on say 7100 for
> > $DATA=/opt/pgdata2.
> >
> > Thanks,
> > Tim Ellis
> > DBA, Gamet
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
>