Re: How to run more the one database at once ?

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Michelle Konzack <linux4michelle(at)freenet(dot)de>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to run more the one database at once ?
Date: 2003-05-16 19:20:21
Message-ID: Pine.LNX.4.33.0305161258560.4710-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 23 Apr 2003, Michelle Konzack wrote:

> Hello,
>
> I need to run 8 seperately databases at the same time and independant.
> I have for each database a partition so no database can kill the other.
>
> I am using Debian GNU/Linux 3.0 with Kernel 2.4.19

There are two ways to do this.

You can use a single cluster with multiple data stores, or you can run
multiple clusters.

To do this with one cluster on multiple stores, do something like this:

Put this in your .bash_profile for the postgres superuser:

export PGDATA1 = /mnt/raid1/d1
export PGDATA2 = /mnt/raid1/d2
export PGDATA3 = /mnt/raid1/d3
export PGDATA4 = /mnt/raid1/d4
export PGDATA5 = /mnt/raid1/d5
export PGDATA6 = /mnt/raid1/d6
export PGDATA7 = /mnt/raid1/d7
export PGDATA8 = /mnt/raid1/d8

Then, su - to the postgres superuser to set those, or just run the
.bash_profile script by hand...

After that, you can issue these commands:

initlocation $PGDATA1
initlocation $PGDATA2
initlocation $PGDATA3
initlocation $PGDATA4
initlocation $PGDATA5
initlocation $PGDATA6
initlocation $PGDATA7
initlocation $PGDATA8

createdb -D PGDATA1 dbname1
createdb -D PGDATA2 dbname2
createdb -D PGDATA3 dbname3
createdb -D PGDATA4 dbname4
createdb -D PGDATA5 dbname5
createdb -D PGDATA6 dbname6
createdb -D PGDATA7 dbname7
createdb -D PGDATA8 dbname8

and then you've got 8 databases on 8 different drives under one
postmaster, all answering on port 5432 if you turn on tcp sockets.

If you want seperate postmasters, you'll do best setting up individual
accounts for each postmaster, and having them each answer on a differnet
port.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-05-16 19:23:54 Re: MSSQL -> PostgreSQL
Previous Message scott.marlowe 2003-05-16 18:54:46 Re: Datatype Definition