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.
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
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".