Running multiple instances off one set of binaries

Started by Karl Denningerabout 13 years ago3 messagesgeneral
Jump to latest
#1Karl Denninger
karl@denninger.net

Let's assume I want to run:

1. An instance of the database that is a replicated copy from another site.

2. A LOCAL instance that contains various things on the local machine
that are not shared.

Let's further assume all are to be 9.2 revs.

Am I correct in that I can do this by simply initdb-ing the second
instance with a different data directory structure, and when starting it
do so with a different data directory structure?

e.g. "initdb -D data"

and

"initdb -D data2"

And that as long as there are no collisions (E.g. port numbers) this
works fine?

--
-- Karl Denninger
/The Market Ticker ®/ <http://market-ticker.org&gt;
Cuda Systems LLC

#2Sergey Konoplev
gray.ru@gmail.com
In reply to: Karl Denninger (#1)
Re: Running multiple instances off one set of binaries

On Sat, Feb 9, 2013 at 7:39 PM, Karl Denninger <karl@denninger.net> wrote:

Am I correct in that I can do this by simply initdb-ing the second instance
with a different data directory structure, and when starting it do so with a
different data directory structure?

You are correct.

And that as long as there are no collisions (E.g. port numbers) this works
fine?

Sure.

--
Sergey Konoplev
Database and software architect
http://www.linkedin.com/in/grayhemp

Phones:
USA +1 415 867 9984
Russia, Moscow +7 901 903 0499
Russia, Krasnodar +7 988 888 1979

Skype: gray-hemp
Jabber: gray.ru@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sergey Konoplev (#2)
Re: Running multiple instances off one set of binaries

Sergey Konoplev <gray.ru@gmail.com> writes:

On Sat, Feb 9, 2013 at 7:39 PM, Karl Denninger <karl@denninger.net> wrote:

Am I correct in that I can do this by simply initdb-ing the second instance
with a different data directory structure, and when starting it do so with a
different data directory structure?

You are correct.

You also need a separate port number for the second instance (obviously,
only one of them can have 5432). Another point is that you may have to
twiddle the kernel's shmem settings to make enough shared memory
available for both installations. But people do this all the time.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general