Re: Start-up script for few clusters: just add water?

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Eustace Scrubb <piotr(dot)kublicki(at)iop(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Start-up script for few clusters: just add water?
Date: 2010-04-26 21:11:11
Message-ID: 4BD6016F.7040208@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le 26/04/2010 13:45, Eustace Scrubb a écrit :
> [...]
> I've installed Postgres with few instances/clusters, however I've got a
> problem with start-up scripts for all clusters. As far as I know the file
> postgresql should be modified in the /etc/sysconfig/pgsql directory. The
> question is as follows:
> Can I paste few clusters in this file? Currently I've got something like
> this:
>
> PGPORT=5566
> PGDATA=/db/one_cluster
>
> Such script will start only one cluster during server rebooting. Can I just
> add more clusters in PGDATA in the file, something like this:
>
> PGPORT=5566
> PGDATA=/db/first_cluster
> PGPORT=5567
> PGDATA=/db/second_cluster
> PGPORT=5568
> PGDATA=/db/third_cluster
>
> Will it work?
>

According to the /etc/sysconfig/pgsql directory you're talking about, I
suppose you are on Fedora.

You need to create one init.d script by cluster and one file in the
/etc/sysconfig/pgsql directory per cluster.

Suppose I have a second cluster. I'll have to do this :

cd /etc/init.d
cp postgresql postgresql2
cd /etc/sysconfig/pgsql
cp postgresql postgresql2
$EDITOR postgresql2

In $EDITOR, I'll change the different environment values I want. For
example:
PGPORT=5567
PGDATA=/db/second_cluster

If I need a third cluster, I will do the exact same step but give a
different name for the init.d script (and also the PostgreSQL sysconf
file, don't forget they need to have the exact same name).

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Mead 2010-04-26 23:47:40 Re: Unable to run createlang (or psql for that matter)
Previous Message Scott Marlowe 2010-04-26 20:48:50 Re: ALTER Bigserial error