Thread: Shared data dir for multiple postgresql nodes
Hi,
I'm asking this out of curiosity, if I have 2 postgres nodes on same server,
1. listening on port 5432
2. listening on port 5433
What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.
pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
Le jeu. 20 déc. 2018 à 09:41, Prince Pathria <prince.pathria@goevive.com> a écrit :
Hi,I'm asking this out of curiosity, if I have 2 postgres nodes on same server,1. listening on port 54322. listening on port 5433What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
Corruption is probably the first thing you'll have to assume.
--
Guillaume
then what is the point of multi master :)
if the server goes down, both go down.
Regards,
other than that, having multiple servers may act as noisy neighbors to each other.
Vijay
On Thu, Dec 20, 2018 at 2:11 PM Prince Pathria <prince.pathria@goevive.com> wrote:
Hi,I'm asking this out of curiosity, if I have 2 postgres nodes on same server,1. listening on port 54322. listening on port 5433What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
ah i did not see that -D /data/postgres on both.
yes on this.
--Corruption is probably the first thing you'll have to assume.
Vijay
On Thu, Dec 20, 2018 at 2:38 PM Vijaykumar Jain <vjain@opentable.com> wrote:
then what is the point of multi master :)if the server goes down, both go down.other than that, having multiple servers may act as noisy neighbors to each other.Regards,VijayOn Thu, Dec 20, 2018 at 2:11 PM Prince Pathria <prince.pathria@goevive.com> wrote:Hi,I'm asking this out of curiosity, if I have 2 postgres nodes on same server,1. listening on port 54322. listening on port 5433What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
On 20/12/18 11:09 π.μ., Vijaykumar Jain wrote:
ah i did not see that -D /data/postgres on both.yes on this.--Corruption is probably the first thing you'll have to assume.
Most likely 2nd PostgreSQL "master" will not even start.
Regards,VijayOn Thu, Dec 20, 2018 at 2:38 PM Vijaykumar Jain <vjain@opentable.com> wrote:then what is the point of multi master :)if the server goes down, both go down.other than that, having multiple servers may act as noisy neighbors to each other.Regards,VijayOn Thu, Dec 20, 2018 at 2:11 PM Prince Pathria <prince.pathria@goevive.com> wrote:Hi,I'm asking this out of curiosity, if I have 2 postgres nodes on same server,1. listening on port 54322. listening on port 5433What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
-- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt
Hi Prince,
pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
The first thing you can not run the same instance with a different port in the single data directory, as we suspect you are trying to run two instances with the different port in the same data directory.However, you can run two DB instance on the same server using different data directory with a different port, you may face below issue if you are planning to keep two DB instance on the same server.
Application, disk IO performance will decrease
Due to a cause of any disaster both the instance will crash.
Data loss,downtime,data corruption etc..
On Thu, Dec 20, 2018 at 2:11 PM Prince Pathria <prince.pathria@goevive.com> wrote:
Hi,I'm asking this out of curiosity, if I have 2 postgres nodes on same server,1. listening on port 54322. listening on port 5433What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
Thanks everyone!
On Thu, Dec 20, 2018 at 5:13 PM Shreeyansh Dba <shreeyansh2014@gmail.com> wrote:
The first thing you can not run the same instance with a different port in the single data directory, as we suspect you are trying to run two instances with the different port in the same data directory.Hi Prince,
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 startHowever, you can run two DB instance on the same server using different data directory with a different port, you may face below issue if you are planning to keep two DB instance on the same server.Application, disk IO performance will decreaseDue to a cause of any disaster both the instance will crash.Data loss,downtime,data corruption etc..On Thu, Dec 20, 2018 at 2:11 PM Prince Pathria <prince.pathria@goevive.com> wrote:Hi,I'm asking this out of curiosity, if I have 2 postgres nodes on same server,1. listening on port 54322. listening on port 5433What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
On 12/20/18 2:41 AM, Prince Pathria wrote:
I don't think Postgres will even let you install the second node in the same directory.
Also, you should name the directories /postgres/data Postgres expects to be installed in a directory named "data".
In fact, if you install Postgres from postgresql.org packages, it'll install it in "X.Y/data", where X is the major version number, and Y is the minor version number.
Hi,I'm asking this out of curiosity, if I have 2 postgres nodes on same server,1. listening on port 54322. listening on port 5433What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
I don't think Postgres will even let you install the second node in the same directory.
Also, you should name the directories /postgres/data Postgres expects to be installed in a directory named "data".
In fact, if you install Postgres from postgresql.org packages, it'll install it in "X.Y/data", where X is the major version number, and Y is the minor version number.
--
Angular momentum makes the world go 'round.
Angular momentum makes the world go 'round.
Le jeu. 20 déc. 2018 à 16:28, Ron <ronljohnsonjr@gmail.com> a écrit :
On 12/20/18 2:41 AM, Prince Pathria wrote:Hi,I'm asking this out of curiosity, if I have 2 postgres nodes on same server,1. listening on port 54322. listening on port 5433What issue's I might face if I do it like this? Assuming I'm doing this for multimaster approach.pg_ctl -D /data/postgres -o "-p 5432" -l /var/log/pg1 start
pg_ctl -D /data/postgres -o "-p 5433" -l /var/log/pg2 start
I don't think Postgres will even let you install the second node in the same directory.
Also, you should name the directories /postgres/data Postgres expects to be installed in a directory named "data".
No, the directory's name doesn't matter.
In fact, if you install Postgres from postgresql.org packages, it'll install it in "X.Y/data", where X is the major version number, and Y is the minor version number.
--
Guillaume.
On Thu, 20 Dec 2018 09:28:26 -0600 Ron <ronljohnsonjr@gmail.com> wrote: > On 12/20/18 2:41 AM, Prince Pathria wrote: > > Hi, > > I'm asking this out of curiosity, if I have 2 postgres nodes on same server, > > 1. listening on port 5432 > > 2. listening on port 5433 > > > > What issue's I might face if I do it like this? Assuming I'm doing this > > for multimaster approach. > > > > |pg_ctl -D /data/postgres-o "-p 5432"-l /var/log/pg1start| > > | > > |pg_ctl -D /data/postgres-o "-p 5433"-l /var/log/pg2 start|| > > I don't think Postgres will even let you install the second node in the same > directory. Well, with little insanity, you could. I already faced some corruptions based on this recipe because of bad architectures. First easy situation to imagine: shared rw storage with autofailover and no fencing. Shake, wait and observe. > Also, you should name the directories /postgres/data Postgres expects to be > installed in a directory named "data". PostgreSQL does not expect such thing...or maybe I don't understand what you mean. > In fact, if you install Postgres from postgresql.org packages, it'll install > it in "X.Y/data", where X is the major version number, and Y is the minor > version number. This is mostly packager decision...and a good one in fact :)