Postgresql – How to solve the “split brain” issue with only 2 physical servers

failoverpostgresql

I have 2 physical servers, each will contain 2 VMs; a VM with Postgres (9.2) running, and a VM running some Python software (which will connect to the Postgres server). I'm not tied to anything in terms of types of failover tools, etc. Is there a way to avoid having a split brain problem given that I only have 2 physical servers?

My current understanding is that when my master Postgres server (or the machine that it resides on) dies the slave database will resume the role of the master. If the master server was turned back on again, it will think it's still master… Is this problem handled by modern Postgres versions, or is it still a serious issue, and if so, why don't more people talk about it? It seems rare to find anything about it.

Best Answer

Decouple your physical/virtual server questions and focus more on understanding failover in Postgres.

I believe you've already read the following, but if not, see failover mechanisms at a high level: http://www.postgresql.org/docs/9.0/static/warm-standby-failover.html

and then look into a way to implement "shoot the other in the head" and a heartbeat, even if that just means sharing a storage backend ( see: https://dba.stackexchange.com/tags/drbd/info , http://wiki.postgresql.org/wiki/Shared_Storage )

Related Topic