Link to home
Start Free TrialLog in
Avatar of Shaun Wingrin
Shaun WingrinFlag for South Africa

asked on

How 2 separate 2 instances of PostgreSQLon same linux CentOS server?

Is there a way to run two instances of PostgreSQL (on different ports) so that we can stop and start each of them and not effect the other?
SOLUTION
Avatar of Kamran Arshad
Kamran Arshad
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of earth man2
earth man2
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shaun Wingrin

ASKER

How do you install the source to a different directory?
Do you keep the name of the executable the same? Kinldy elaborate on how one goes about installing. I'm not expert at Linux or postgresql.
As for the startup script - is it more than a case of changing the directory of the PostgreSQL?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tx so far. I downloaded:
http://wwwmaster.postgresql.org/download/mirrors-ftp?file=%2Fsource%2Fv8.3.3%2Fpostgresql-8.3.3.tar.gz

This is what I used:

./configure --prefix=/home/shaunw/postgre --with-CXX --enable-odbc --with-maxbackends=10000 --with-pgport=5434 --with-odbcinst=/home/shaunw/postgre/odbc --enable-syslog --with-java

, however see my results.
______________
RESULTS: (The rest seemed ok).
__
configure: WARNING: option ignored: --enable-odbc
configure: WARNING: option ignored: --enable-syslog
configure: WARNING: option ignored: --with-CXX
configure: WARNING: option ignored: --with-java
configure: WARNING: option ignored: --with-maxbackends
configure: WARNING: option ignored: --with-odbcinst

____________________________________________
And then when running: make , got a lot of the following type of error...
____________________________________________

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv  -fpic -DFRONTEND -DUNSAFE_STAT_OK -I. -I../../../src/include -D_GNU_SOURCE  -I../../../src/port  -c -o fe-auth.o fe-auth.c


any ideas please?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ran make install and it ran through what seems to be fine. However I cannot find the data directory or the postgre.conf file. this is the install listing.

[shaunw@messaging postgre]# ls
bin  doc  include  lib  man  share


How do I specify the data directory?
Where are the conf files?

I understand that --prefix=/home/shaunw/postgre is all that was needed to ensure that the installation sits at above directory?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tx. This is progress. Now get this error when try to create the databse:

[shaunw@messaging bin]$ pg_ctl -D /home/shaunw/postgre/a1db start
server starting
[shaunw@messaging bin]$ LOG:  database system was shut down at 2008-09-22 14:04:37 SAST
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections

[shaunw@messaging bin]$ createdb -D /home/shaunw/postgre/a1db testdb
ERROR:  tablespace "/home/shaunw/postgre/a1db" does not exist
STATEMENT:  CREATE DATABASE testdb TABLESPACE "/home/shaunw/postgre/a1db";

createdb: database creation failed: ERROR:  tablespace "/home/shaunw/postgre/a1db" does not exist
[shaunw@messaging bin]$