Re: *** How can I install two postgresqls in the same machine? *****

From: "Spiegelberg, Greg" <gspiegelberg(at)cranel(dot)com>
To: "kitaeda" <kitaeda(at)infoeye(dot)net>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: *** How can I install two postgresqls in the same machine? *****
Date: 2006-07-14 13:16:46
Message-ID: 82E74D266CB9B44390D3CCE44A781ED90126C421@POSTOFFICE.cranel.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

We have done this here and it works well. In our case we have two
different rev's of PostgreSQL which we install as /path/to/pgsql-7.4.6
and /path/to/pgsql-8.1.3 but reference using links /path/to/pgsql-7.4
and /path/to/pgsql-8.1. Reason is you don't want to muck with your path
every time you upgrade and going from 7.4.x to 7.4.y or 8.1.x to 8.1.y
is seamless.

We also use different accounts for each database. Each user account
owns the PGDATA dir which also prevents corruption caused by confusion.
DB user starts database A but mistakenly starts B which is already
running. Different users prevents that.

Different ports are necessary or at least different IP's. Linux you'd
have eth0 as 10.1.1.1 and on same machine make a eth0:2 be 10.1.1.2.
Each postgres would bind to 5432 but on a different interface.

You'll need a different place for the socket. We've put them in the db
user home dir b/c you can't seem to get away from it and we don't use it
anyways.

Also visit the /etc/sysctl.conf or OS equivalent if you're not using
Linux and bump up the appropriate shared memory (typically
kernel.shmmax, kernel.shmall, kernel.shmmni) and semaphore (kernel.sem)
tunables.

Depending on disk and the nature of your database you'll need to
eventually think about what database lives on what disk or perhaps
placing the pg_xlog somewhere other than the default.

We've also wrapped the psql command with our own script which takes a
database name as a parameter, determines what IP & port to connect to
and also determines the version of postgres running so the proper psql
client is invoked. I don't know if it's a must but you'll be warned if
you try to connect to a 8.1 using a 7.4 client.

That's all I can think of now.

Anyone else?

Greg

> -----Original Message-----
> From: pgsql-admin-owner(at)postgresql(dot)org
> [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of kitaeda
> Sent: Friday, July 14, 2006 2:37 AM
> To: pgsql-admin(at)postgresql(dot)org
> Subject: [ADMIN] *** How can I install two postgresqls in the
> same machine? *****
>
> I want to install two postgresqls in the same machine.
> How can I do so?
> What do I have to specific configure options?
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jonah H. Harris 2006-07-14 15:08:05 Re: hooks for User login process
Previous Message Donald Fraser 2006-07-14 12:07:42 hooks for User login process