Re: Run 4 postgresql session on ONE server?

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Daniel Seichter <daniel(at)dseichter(dot)de>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Run 4 postgresql session on ONE server?
Date: 2003-06-13 21:55:32
Message-ID: Pine.LNX.4.33.0306131553120.21088-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, 12 Jun 2003, Daniel Seichter wrote:

> Hello,
> I only know the traditional way of using postgreSQL:
> In serverprocess with an "unlimited" number of databases.
> But:
> Is is possible to have 4 processes, for each database one, running on one
> linux server?
>
> The reason is the following:
> I only have one server on which a productive database is working and a
> second database, which will be set upped at the moment.
> On my productive database I can't test with the parameters so I am searching
> for a way, that I can do the following:
> - let running for each database one serverprocess on the same machine
> - having for each database one pg_hba.conf and postgresql.conf (on testdb's,
> I want to log every SQL-statement, which is on a productive database
> impossible to log)
>
> I know, that you shouldn't test on a productive server, but at the moment
> this is the only way I can do but I hope to get an test server or a new
> productive server as soon as the second database is ready.

Yes, you can do it. All you have to do is create four seperate accounts
for it to run under (pgsql1, pgsql2, pgsql3, pgsql4) and then in each of
those accounts, set up a different PGDATA value and initdb as that user.
Then edit each account's postgresql.conf to have a different port number
(I just incremented from 5432 to 5433 etc...) and start them up.

Then when you connect just specify the port of the database instance you
need. Since each one is running as a different user with different
postgresql.conf and pg_hba.conf files you can lock the production instance
down tight to prevent brain farts (oops, I just dropped a table in the
production database) and you're gold.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-06-13 22:54:41 Re: Run 4 postgresql session on ONE server?
Previous Message Michael Sheldon 2003-06-13 19:30:02 LAST REQUEST: Remove