pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wim Bertels <wim.bertels@dontlikespam.khleuven.be>
To: pgsql-admin@postgresql.org
Subject: Re: Running 2 postmaster Instances on different ports
Date: Tue, 5 Oct 2004 22:43:55 +0200
Message-ID: <1097009037.291692@seven.kulnet.kuleuven.ac.be> (raw)
References: <cjukma$nab$1@ikaria.belnet.be>

> Environement: debian, postgresql 7.4.5
>
> This is my problem:
> "/etc/init.d/postgresql2 restart
> Stopping PostgreSQL database server: postmasterpg_ctl: could not find
> /var/lib/postgres/data2/postmaster.pid
> Is postmaster running?
> .
> Starting PostgreSQL database server: postmaster(FAILED)
> ERROR: pg_ctl: Another postmaster may be running.  Trying to start
> postmaster anyway.
> pg_ctl: cannot start postmaster
> Examine the log output."
>
> The problem seems to be the "/etc/postmaster.conf",
> this file seems to be used by both postmaster instances,
> but since both postmaster instances have different data-dirs (two
> different clusters), this is a problem. I would like the two clusters to
> be started at boottime automatically.
>
> I changed all the references in the "/etc/init.d/postgresql2" script to
> the files in data-dir of second instance (with an adapted copy
> postmaster.conf), but still this doesnt do the trick.
>
> How do i solve this problem?

for now i just adapted a copy of the config files,
made a adapted copy of postgresql script under init.d,
and made an adapted copy of the postmaster-startup script
, so it works, but not in elegant, well manageable way
(->it would be better just needing the config files, all located in the data
dirs would the most easy and readible i suppose?)

its maybe debian specific:
eg:
"topic: running cleanly multiple instances of the postmaster (thus having
multiple cluster dbs)
[-> simple putted: thus needing multiple config files]

at this moment debian is set up with a single /etc/postgresql dir for the
configuration of postgres.
the instances starting the services read from this dir.
(the files in this dir are symbollicaly linked, doenst matter).

the problem arises when one tries to start another instance of the
postmaster on a different port,
this can be done, no problem, but not in such a nice way a the first
instance (eg i like a clean script that ensures me a running instance at
startup). why? because this instance also reads from the same
/etc/postgresql dir , but the eg the data dir is different, the connection
port is different and so on..

the solution (in my opinion): don't put the config files under the
/etc/postgresql dir, just put symbolic links to the data dir of every
cluster db; in this datadir the right config files can then be found for the
appropiate instance,
and the meaning of the /etc dir remains valid.
"





view thread (2+ messages)

Message-ID: <1097009037.291692@seven.kulnet.kuleuven.ac.be>
Permalink:  ../1097009037.291692@seven.kulnet.kuleuven.ac.be/
Also on:    postgresql.org/message-id/1097009037.291692@seven.kulnet.kuleuven.ac.be

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: wim.bertels@dontlikespam.khleuven.be
  Subject: Re: Running 2 postmaster Instances on different ports
  In-Reply-To: <1097009037.291692@seven.kulnet.kuleuven.ac.be>
  References: <cjukma$nab$1@ikaria.belnet.be> <1097009037.291692@seven.kulnet.kuleuven.ac.be>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox