Can I create a HA postreges cluster using two different nodes via NFS?

According to the postgresql 9.4 official doc this isn't a good idea but I don't find any other info on the web.

  • If you're not working on code, you're posting in the wrong forum. – amphetamachine Nov 7 '14 at 22:51

Short answer: NO!.

Longer answer: If you use synchronous NFS and you have robust STONITH / fencing, then with great caution you could run a shared-storage failover cluster over NFS without horribly corrupting your data. However, it won't do you any good for failure modes where the data is affected by the problem.

Shared-access SAS/SCSI, DRBD, shared-access SAN storage (iSCSI etc), or similar block-level sharing is slightly saner than using NFS, but still not safe.

If you don't already know what STONITH or fencing means, then see "short answer" above.

Use replication. Really.

| improve this answer | |
  • Replication means at least 2xstorage. – cresg820 Nov 9 '14 at 20:27
  • 2
    Yeah, exactly that's the idea behind replication - to have a replica. – dezso Nov 10 '14 at 12:07
  • @cresg820 More like 4x once you count the space for at least two complete backups that you should always have. If you can't afford the storage you can't really afford high availability / disaster recovery IMO. Shared storage will only help with a few failure modes and introduces more than it solves. If you insist on doing it make sure you really understand and test node isolation and fencing and you test your failover process. Otherwise it isn't just useless but probably hazardous. Use block level shared storage and make really sure it honours fsync too. – Craig Ringer Nov 10 '14 at 19:16
  • 1
    @cresg820 One small mistake will destroy your data completely. PostgreSQL does not support multiple instances sharing storage and will horribly corrupt the database if the old one isn't completely and permanently stopped/isolated before the new instance starts. PostgreSQL's usual protections against this can't work on shared file systems / shared network block storage. Much like if you mount an ext4 volume read/write from multiple places the outcome will be a total disaster. Really, use replication instead. – Craig Ringer Nov 10 '14 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy