Re: Running 2 postmaster Instances on different ports

From: "Wim Bertels" <wim(dot)bertels(at)dontlikespam(dot)khleuven(dot)be>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Running 2 postmaster Instances on different ports
Date: 2004-10-05 20:43:55
Message-ID: 1097009037.291692@seven.kulnet.kuleuven.ac.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> 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.
"

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Simon Riggs 2004-10-05 20:55:31 Re: Enabling --log-update
Previous Message Mike Darretta 2004-10-05 20:29:35 Re: Migrating Data Between PG Tables