postgresql

Tomasz Kłoczko kloczek at rudy.mif.pg.gda.pl
Thu Jul 18 03:11:35 CEST 2002


On Wed, 17 Jul 2002, wrobell wrote:

> > > ------------------------------------
> > > In other words, database cluster is usually dir/file structure
> > > under /var/lib/pgsql. Let's continue. :-]
> > > 
> > > It is impossible to create Postgresql *clean* multi database cluster
> > > solution with PLD, currently. However, as many of us know, it is not
> > > the fault of this RDBMS:
> > > - every db cluster exists in separate directory
> > > - every db cluster is configured with files in db cluster directory
> > >   (pg_hba.conf, pg_ident.conf, postgresql.conf)
> > > - every postgresql instance has its own pid file
> > >   (postmaster.pid)
> > > - every postgresql instance has its own postmaster options file
> > >   (postmaster.opts)
> > > 
[..]
> > Some usefull (probably) proposition on implementation level: IMHO instead
> > list in /etc/sysconfig/postgresql::DATA_DIRS directories/cluster names
> > better will be use subdirctories names in /var/lib/pgsql use as
> > cluster names if /etc/sysconfig/postgresql::MULTI_CLUSTER=yes
> Let's make it simple. When DATA_DIRS contains only one
> directory then it is, as you called it, in single cluster mode.

OK.

> And my point is that there should be no default db cluster defined.
> If admin wants to create db cluster, he does it with initdb
> and he has to *configure* it, so it should not be created with
> /etc/rc.d/init.d/postgresql script, too.
> Creating db cluster should look like:
> - create
> - configure and add entry to DATA_DIRS
> - start
> and not:
> - add entry to DATA_DIRS (set PG_DATA_DIR as it is now or whatever)
> - start (de facto create and no configure (sic!) then start)
> Where 'start' means running '/etc/rc.d/init.d/postgresql start' command.
> 
> Let's look at cvs by analogy. We do not create default repository, ain't it?

Looks prity good.

> > Where do you want put per cluste confifuration files ?
> Look into postgresql.conf in your db cluster dir. Then create
> another db cluster with, for example 'initdb -D /var/lib/pgsql_001'
> and compare directories. Starting postgresql should be easy with
> following commands:
> 
>     pg_ctl -D /var/lib/pgsql start      # there is your db cluster, I think
>     pg_ctl -D /var/lib/pgsql_001 start  # change port in postgresql.conf!

Separiation directiories, separation configurations seems done (in plan).
Olny was rest pid files managing. Proposition: make /var/lock/subsys/psql/
and store in this directory /var/lock/subsys/<cluster_name>.pid files.

And next: instead list DATA_DIRS better will be use DATA_CLUSTERS and use
in this variable not full directories names but subdirectories/cluster
names as list subdirectories in /var/lib/pgsql for each cluster and
as <cluster_name> in /var/lock/subsys/<cluster_name>.pid.

So in this model will not be distinguishing between multi and single
cluster postgresql runing (single cluster will be only special case
multi cluster with only one cluster runed/configured) .. :) (?)

Probably will be also neccessary extending
{start|stop|restart|reload|status} init script targets for allow operate
on only one selected cluster.

kloczek
-- 
-----------------------------------------------------------
*Ludzie nie mają problemów, tylko sobie sami je stwarzają*
-----------------------------------------------------------
Tomasz Kłoczko, sys adm @zie.pg.gda.pl|*e-mail: kloczek at rudy.mif.pg.gda.pl*



More information about the pld-devel-en mailing list