I created a PostgreSQL cluster in one host and shared it over NFS share to another host. Even though i can access the cluster using second host but can not use or log in to databases. Is it possible to use a single cluster by multiple hosts? so i can introduce it to clients as a single host and in case the first host that was used to create the cluster is down, the other host keeps the cluster running so clients would not face any connectivity or accessibility issue to that cluster.

  • 2
    You cannot share postgresql over NFS or any other file sharing protocol. This might help to get you started: wiki.postgresql.org/wiki/…
    – Eelke
    Aug 13 '16 at 12:30
  • Eelke, Thanks for the response. NFS was just an example the main thing that i want to do is to manage a single cluster with multiple hosts, is it possible? Aug 14 '16 at 3:26
  • @SayadXiarkakh No, it's not possible. Nov 7 '20 at 10:55

Use your PostgreSQL database with a shared disk it's a bad idea at all. Your database probably will crash and you WILL lose data.

If you need HA a solution based on shared disk(Like the RedHat Cluster Suite) do that by your storage device, creating a LUN and mapping it on both servers.

Take a look at this doc from EDB's Website:

Provide more details for a better solution.


No, you can not share a data directory over NFS.

This is a horrible idea if for no other reason than because fsync() assumes that there is only one buffer to the input device running on a single host which issues the fsync. It only ensures flushing buffers from the host you run it on. There is no way around this. You can not share a resource with two machines that use fsync.

Aside from all the buffering complexities, there are supported mechanisms to cluster PostgreSQL. I suggest reviewing the chapter on "High Availability, Load Balancing, and Replication" and also reviewing the wiki page "Replication, Clustering, and Connection Pooling".

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.