473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1699
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: jini us | last post by:
Hi, I am starting a new project where I intend to use embedded database server in my win32 application. I intend to use VC++ microsoft studio 6.0 as my development environment. The...
19
by: Alex Madon | last post by:
Hello, I am testing a web application (using the DBX PHP function to call a Postgresql backend). I have 375Mb RAM on my test home box. I ran ab (apache benchmark) to test the behaviour of the...
1
by: Richard Huxton | last post by:
On Thursday 12 February 2004 20:25, Prashanthi Muthyala wrote: > Hi Richard Hi Prashanthi - nice to hear from you again. I've taken the liberty of cc-ing the general list on this, since there...
6
by: Lee Harr | last post by:
I have a database where I remove the schema public. When I try to use the createlang script, it fails like this ... >createdb foo CREATE DATABASE >psql foo -c "select version()" version...
7
by: Luiz Guilherme Freitas de Paula | last post by:
Hi everyone, Anyone have PostgreSQL running on a cluster? I'm trying to run on a OpenMosix 2-machine cluster but the processes are not migrating. All the load is concentrating in one machine....
1
by: phil campaigne | last post by:
On Mon, 1 Mar 2004, phil campaigne wrote: >> Nigel J. Andrews wrote: >> > > >>> >On Mon, 1 Mar 2004, Phil Campaigne wrote: >>> > >>> >
9
by: Andy B | last post by:
If I bought one of these boxes/OS combos as a postgresql database server, would postgresql be able to make the best use of it with a huge (e.g. 40GB) database? Box: HP ProLiant DL585, with ...
2
by: zhicheng wang | last post by:
Dear all i have a dedicated server mainly running postgresql, currently rh-posgtresql-7.3.6.7 (and samba, ypbind etc). The server is a dual processor machine and the OS is RHEL AS 3. I am...
1
by: Marcel Groner | last post by:
I have a problem with postgresql runnung on smp kernel. setup: master: ------- - Pentium 4 (hyperthreading) - 2 GB Memory - os: fedora core 1 - kernel: 2.4.22-1.2188.nptlsmp
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.