Thread: Running Multiple Postmasters

Running Multiple Postmasters

From
"Clay Luther"
Date:
I am wondering if it is possible, or even advisable, to run two postmasters on a single system.
 
For example, we have an embedded system with a normal runtime partition (called the "A") in which the PGDATA is /var/lib/pgsql/data. We also have a offline partition which is a copy of the runtime partition, but is mounted under /partB -- PGDATA here is /partB/var/lib/pgsql/data.
 
During upgrades, we will alter the installation on the B partition, then swap the paritions after a reboot.
 
However, during upgrades, we may need to migrate data from the A partition databases to the B partition databases.
 
For database migrations, I was hoping I could do the following (remember, a postmaster is already running on /var/lib/pgsql/data):
 
1) Alter the the postgresql.conf of the B partition PGDATA, setting the tcp/ip port to 54321.
2) Start the "B" postmaster, pg_ctl -D /partB/var/lib/pgsql/data start
3) Use ODBC/JDBC to perform necessary migration from A databases to B databases.
4) pg_ctl -D /partB/var/lib/pgsql/data stop
5) Set B postgresql.conf tcp/ip port to 5432.
6) Reboot (higher level systems will automatically swap the A and B partitions, so B becomes A and A becomes the new B).
 
Conceptually clear, but I wanted to know if there was anything I needed to be worried about.
 
Thanks.
 
---
Clay
(972) 813-5004



I've stopped 272 spam messages. You can too!
One month FREE spam protection at www.cloudmark.com
Cloudmark SpamNet - Join the fight against spam!
 
Attachment

Re: Running Multiple Postmasters

From
"Froggy / Froggy Corp."
Date:
Hi,

    I actually run with 2 posmasters, 7.2 & 7.4 with different "physical"
/var/lig/pgsql/data & /var/lig/pgsql/data2 with no problem. They have
different TCP/IP port and run well.
    The $PG_DATA$ is not needed if you use "pg_ctl -D" form, so you can run
many postmaster at same times.

    A question about that, there is an utility to use 2 different
postmaster in production with same version ?

regards,

> Clay Luther wrote:
>
> I am wondering if it is possible, or even advisable, to run two
> postmasters on a single system.
>
> For example, we have an embedded system with a normal runtime
> partition (called the "A") in which the PGDATA is /var/lib/pgsql/data.
> We also have a offline partition which is a copy of the runtime
> partition, but is mounted under /partB -- PGDATA here is
> /partB/var/lib/pgsql/data.
>
> During upgrades, we will alter the installation on the B partition,
> then swap the paritions after a reboot.
>
> However, during upgrades, we may need to migrate data from the A
> partition databases to the B partition databases.
>
> For database migrations, I was hoping I could do the following
> (remember, a postmaster is already running on /var/lib/pgsql/data):
>
> 1) Alter the the postgresql.conf of the B partition PGDATA, setting
> the tcp/ip port to 54321.
> 2) Start the "B" postmaster, pg_ctl -D /partB/var/lib/pgsql/data start
> 3) Use ODBC/JDBC to perform necessary migration from A databases to B
> databases.
> 4) pg_ctl -D /partB/var/lib/pgsql/data stop
> 5) Set B postgresql.conf tcp/ip port to 5432.
> 6) Reboot (higher level systems will automatically swap the A and B
> partitions, so B becomes A and A becomes the new B).
>
> Conceptually clear, but I wanted to know if there was anything I
> needed to be worried about.
>
> Thanks.
>
> ---
> Clay
> claycle@cisco.com
> (972) 813-5004
>
> ----------------------------------------------------------------------
> I've stopped 272 spam messages. You can too!
> One month FREE spam protection at www.cloudmark.com
> [Cloudmark SpamNet - Join the fight against spam!]
>

Re: Running Multiple Postmasters

From
"Joshua D. Drake"
Date:
Hello,

We do it all the time at Command Prompt. That is how we do the managed shared hosting. Every customer gets a private
data directory that is on its own TCP port.

J


Clay Luther wrote:
I am wondering if it is possible, or even advisable, to run two postmasters on a single system.
 
For example, we have an embedded system with a normal runtime partition (called the "A") in which the PGDATA is /var/lib/pgsql/data. We also have a offline partition which is a copy of the runtime partition, but is mounted under /partB -- PGDATA here is /partB/var/lib/pgsql/data.
 
During upgrades, we will alter the installation on the B partition, then swap the paritions after a reboot.
 
However, during upgrades, we may need to migrate data from the A partition databases to the B partition databases.
 
For database migrations, I was hoping I could do the following (remember, a postmaster is already running on /var/lib/pgsql/data):
 
1) Alter the the postgresql.conf of the B partition PGDATA, setting the tcp/ip port to 54321.
2) Start the "B" postmaster, pg_ctl -D /partB/var/lib/pgsql/data start
3) Use ODBC/JDBC to perform necessary migration from A databases to B databases.
4) pg_ctl -D /partB/var/lib/pgsql/data stop
5) Set B postgresql.conf tcp/ip port to 5432.
6) Reboot (higher level systems will automatically swap the A and B partitions, so B becomes A and A becomes the new B).
 
Conceptually clear, but I wanted to know if there was anything I needed to be worried about.
 
Thanks.
 
---
Clay
(972) 813-5004



I've stopped 272 spam messages. You can too!
One month FREE spam protection at www.cloudmark.com
Cloudmark SpamNet - Join the fight against spam!
 


-- 
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL
Attachment