Обсуждение: Running Multiple Postmasters

Поиск
Список
Период
Сортировка

Running Multiple Postmasters

От
John Allgood
Дата:
Hello

    I am building a server to run 9 databases. Can I run a seperate
postmaster for each of the 9 databases. I would be setting the port
number to a different value for each db of course. The reason I wish to
do this is so that I can install about three databases on a seperate
disk and put the other on seperate disk as well. I want to be able to
build scripts to shutdown and start each database individually. Example
below. I would also put the WAL on seperate disk as well which I will do
with links. I this something I can do.

Disk 1

DB1    postmaster 5432
DB2          *          5433
DB3          *          5434

Disk 2

DB4          *          5435
DB5          *          5436
DB6          *          5437

Disk 3


Thanks
John Allgood - ESC
Systems Administrator
770.535.5049

Re: Running Multiple Postmasters

От
Jean-Marc Pigeon
Дата:
Bonjour John Allgood,
> Hello
>
>    I am building a server to run 9 databases. Can I run a seperate
> postmaster for each of the 9 databases. I would be setting the port
> number to a different value for each db of course. The reason I wish to
> do this is so that I can install about three databases on a seperate
> disk and put the other on seperate disk as well. I want to be able to
> build scripts to shutdown and start each database individually. Example
> below. I would also put the WAL on seperate disk as well which I will do
> with links. I this something I can do.
    No problem to do this, we are doing the same (each designer
    getting its own data-base) for test purpose.

    command like:
    /usr/bin/postmaster -D //regulus/reg2/dbm -p 1622 -B512 -o -S2048
    where -D and -p parameter are different for each data-base.
    (we are starting postmater from inside the application itself
     such we are sure application is working on the proper base and port)
     Be sure to create a full data-base structure in the proper area.


--
A bientot
==========================================================================
Jean-Marc Pigeon              Internet:   Jean-Marc.Pigeon@safe.ca
SAFE Inc.                Phone: (514) 493-4280  Fax: (514) 493-1946
       REGULUS,  a real time accounting/billing package for ISP
           REGULUS' Home base <"http://www.regulus.safe.ca">
==========================================================================

Re: Running Multiple Postmasters

От
"scott.marlowe"
Дата:
On Thu, 26 Feb 2004, John Allgood wrote:

> Hello
>
>     I am building a server to run 9 databases. Can I run a seperate
> postmaster for each of the 9 databases. I would be setting the port
> number to a different value for each db of course. The reason I wish to
> do this is so that I can install about three databases on a seperate
> disk and put the other on seperate disk as well.

Up to here, there's no need for seperate postmasters, as you can easily
install different databases onto different disk spaces.

If this is your only reason, look into:

http://www.postgresql.org/docs/7.4/static/manage-ag-alternate-locs.html

Plus it gives you the advantage that you have one database cluster to
manage and your tuning only needs to take into account a server handling
one database.

That said, it's pretty easy to put multiple instances on one machine.

The way I do it, is to create a seperate account for each instance to run
in, so that by looking at the prompt I know which database I'm
administering, and no matter how much I might fat finger things, if I'm
logged in as pgsql01 and try to delete the files for pgsql02 I can't do
it, I don't have permission to.

Then you just have a line like this in rc.local for each database to get
it started.

su - pgsql1 -c -- 'pg_ctl start -l $PGDATA/pgsql.log'

I'm not sure anymore (it's been a while since I did it last) if you have
to include a port number anywhere in there.  I think the pg_ctl /
postgresql.conf file handle all that though.


Re: Running Multiple Postmasters

От
John Allgood
Дата:

Jean-Marc Pigeon wrote:

>Bonjour John Allgood,
>
>
>>Hello
>>
>>   I am building a server to run 9 databases. Can I run a seperate
>>postmaster for each of the 9 databases. I would be setting the port
>>number to a different value for each db of course. The reason I wish to
>>do this is so that I can install about three databases on a seperate
>>disk and put the other on seperate disk as well. I want to be able to
>>build scripts to shutdown and start each database individually. Example
>>below. I would also put the WAL on seperate disk as well which I will do
>>with links. I this something I can do.
>>
>>
>    No problem to do this, we are doing the same (each designer
>    getting its own data-base) for test purpose.
>
>    command like:
>    /usr/bin/postmaster -D //regulus/reg2/dbm -p 1622 -B512 -o -S2048
>    where -D and -p parameter are different for each data-base.
>    (we are starting postmater from inside the application itself
>     such we are sure application is working on the proper base and port)
>     Be sure to create a full data-base structure in the proper area.
>
Hello Again

    What I have done is modified the basic startup script on redhat and
change the PGDATA and PGPORT to the corresponding port number and db
path. For my other startup parameters I have modified the
postgresql.conf in each database structure file this way I can start and
stop the databases easily. Just curious are you running the databases
from servers or workstations.

Thanks