469,959 Members | 1,905 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,959 developers. It's quick & easy.

2 postgresql processes on the same machine ?


Hi,

I am pretty new to the postgresql community.
My question may seem a little bit strange but
I'd like to know if it is possible to run 2
postgresql processes with 2 separate databases on the
same machine (change of the ports, different paths to
logs, ...)?

Thanks in advance for your answers.

Best Regards,

Jean-Guillaume LALANNE
Our name has changed. Please update your address book to the following format: "re*******@capgemini.com".

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
6 1528
On Thu, 2004-07-22 at 14:02, Jean-Guillaume LALANNE wrote:
....
I'd like to know if it is possible to run 2
postgresql processes with 2 separate databases on the
same machine (change of the ports, different paths to
logs, ...)?


Certainly.

Each running postmaster needs a different port and a different database
cluster directory ($PGDATA); as you suggest, a separate log file would
also be a good idea.

If they are running under separate usernames, you need to make sure that
they both have permission to write in the socket directory, or else have
different socket directories.

Oliver Elphick
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jean
My question may seem a little bit strange but
I'd like to know if it is possible to run 2
postgresql processes with 2 separate databases on the
same machine (change of the ports, different paths to
logs, ...)?


Yes, it easily possible (the necceary options are documented).
But if the issue is only about more than one database, you
don't need to, as postgres can serve more than one database.
(my postmaster serves 18 DBs).

Mit freundlichem Gruß / With kind regards
Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFA/76O1Xdt0HKSwgYRAlifAJ9jJW4jICXVnPIErXYpJfJv4u+wFwC dFT18
nbp5lSc8Ye3mLA50IKlZZMo=
=eP2g
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #3
Jean-Guillaume LALANNE wrote:
Hi,

I am pretty new to the postgresql community.
My question may seem a little bit strange but
I'd like to know if it is possible to run 2
postgresql processes with 2 separate databases on the
same machine (change of the ports, different paths to
logs, ...)?


Hello,

We are currently running five ;) (different versions) on our development
machine.

We have created separate admin user accounts for each (pgsql722, pgsql74
and so on) to make things easier. And we use 722 client tools (psql,
createdb) with 722 db and so on. I seem to remember we ran into some
problems when trying to cross versions which was the main reason for
separate user accounts but I cannot remember what those problems were
exactly.

When using matching version client tools there are no visible problems
whatsoever.

If there are some obscure problems this may cause, I'll gladly hear
about them myself because we also do it in one production environment
(two different postmasters).

Regards,

Michal Dobaczewski.
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #4

Thanks a lot for your quick answer.

It gonna help me a lot.

Best regards

Jean-Guillaume LALANNE

-----Message d'origine-----
De : Michal Dobaczewski [mailto:md**********@cc.com.pl]
Envoye : jeudi 22 juillet 2004 15:30
A : Jean-Guillaume LALANNE
Cc : pg***********@postgresql.org
Objet : Re: [GENERAL] 2 postgresql processes on the same machine ?
Jean-Guillaume LALANNE wrote:
Hi,

I am pretty new to the postgresql community.
My question may seem a little bit strange but
I'd like to know if it is possible to run 2
postgresql processes with 2 separate databases on the
same machine (change of the ports, different paths to
logs, ...)?


Hello,

We are currently running five ;) (different versions) on our development
machine.

We have created separate admin user accounts for each (pgsql722, pgsql74
and so on) to make things easier. And we use 722 client tools (psql,
createdb) with 722 db and so on. I seem to remember we ran into some
problems when trying to cross versions which was the main reason for
separate user accounts but I cannot remember what those problems were
exactly.

When using matching version client tools there are no visible problems
whatsoever.

If there are some obscure problems this may cause, I'll gladly hear
about them myself because we also do it in one production environment
(two different postmasters).

Regards,

Michal Dobaczewski.
Our name has changed. Please update your address book to the following format: "re*******@capgemini.com".

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #5
On Thu, 2004-07-22 at 06:02, Jean-Guillaume LALANNE wrote:
Hi,

I am pretty new to the postgresql community.
My question may seem a little bit strange but
I'd like to know if it is possible to run 2
postgresql processes with 2 separate databases on the
same machine (change of the ports, different paths to
logs, ...)?

Thanks in advance for your answers.

Best Regards,

Jean-Guillaume LALANNE
Yep, this is quite simple actually.

For example, say you want user X to have their own DB instance that they
can stop/start when ever they choose.

(logs into shell as new user)

[allison@vacant allison]$ initdb --username=admin -W pgdata
The files belonging to this database system will be owned by user
"allison".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.

creating directory pgdata... ok
creating directory pgdata/base... ok
creating directory pgdata/global... ok
creating directory pgdata/pg_xlog... ok
creating directory pgdata/pg_clog... ok
selecting default max_connections... 100
selecting default shared_buffers... 1000
creating configuration files... ok
creating template1 database in pgdata/base/1... ok
initializing pg_shadow... ok
Enter new superuser password:
Enter it again:
setting password... ok
enabling unlimited row size for system tables... ok
initializing pg_depend... ok
creating system views... ok
loading pg_description... ok
creating conversions... ok
setting privileges on built-in objects... ok
creating information schema... ok
vacuuming database template1... ok
copying template1 to template0... ok

Success. You can now start the database server using:

/usr/bin/postmaster -D pgdata
or
/usr/bin/pg_ctl -D pgdata -l logfile start

....then edit the file:
joe pgdata/postgresql.conf
Change #port = 5432
(port of your choice)

save file

then issue:
/usr/bin/pg_ctl -D pgdata -l logfile start
postmaster successfully started


Voila. :-)

-Robby

--
Robby Russell | Owner.Developer.Geek
PLANET ARGON | www.planetargon.com
Portland, OR | ro***@planetargon.com
503.351.4730 | blog.planetargon.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #6
In an attempt to throw the authorities off his trail, li***@klawitter.de (Holger Klawitter) transmitted:
Hi Jean
My question may seem a little bit strange but
I'd like to know if it is possible to run 2
postgresql processes with 2 separate databases on the
same machine (change of the ports, different paths to
logs, ...)?


Yes, it easily possible (the necceary options are documented).
But if the issue is only about more than one database, you
don't need to, as postgres can serve more than one database.
(my postmaster serves 18 DBs).


I have seen a number of good reasons to have multiple postmasters on a
single host, notably that cache is shared across all databases in a
single cluster; if different databases have very different access
patterns, one of them might destroy the usefulness of the cache.

That is quite likely to change with ARC in 7.5, but we're not there
quite yet.
--
"cbbrowne","@","cbbrowne.com"
http://cbbrowne.com/info/spiritual.html
Chad has brought us a brilliant new twist: "Nobody has ever been a bad
parent by buying Microsoft."
-- David Steinberg <st******@interchange.ubc.ca>
Nov 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by jini us | last post: by
19 posts views Thread by Alex Madon | last post: by
1 post views Thread by Richard Huxton | last post: by
7 posts views Thread by Luiz Guilherme Freitas de Paula | last post: by
1 post views Thread by phil campaigne | last post: by
2 posts views Thread by zhicheng wang | last post: by
1 post views Thread by Marcel Groner | last post: by
reply views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.