Thread: Running multiple instances off one set of binaries
Let's assume I want to run: 1. An instance of the database that is a replicated copy from another sit= e. 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? --=20 -- Karl Denninger /The Market Ticker =AE/ <http://market-ticker.org> Cuda Systems LLC
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
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