Re: The case of PostgreSQL on NFS Server

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: shikase(at)air(dot)co(dot)jp
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: The case of PostgreSQL on NFS Server
Date: 2010-06-25 04:48:45
Message-ID: 4C24352D.7060104@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 25/06/2010 8:23 AM, Iwao Shikase wrote:
> Hi Roeleveld-san,
>
> Thank you for your advice. But My purpose is to test PostgreSQL
> which data cluster is in NFS server.
> As your says, Cluster Filesystem is one of answer of sharing files.
> But my company still want to use NFS server. So I want to know
> how to use PostgreSQL using NFS.
>
> By the way,The manual says, "if possible, mount NFS file systems
> synchronously (without caching) to avoid this".

It depends on the NFS implementation. Are you using a Linux NFS server?
Linux NFS client? What versions? Are they on the same machine and if
not, how are they connected? You're not providing enough information for
anyone to give you a useful answer.

In general, you should assume that NFS is just NOT SAFE, unless you can
prove a particular configuration IS safe by rigourous testing of both
client- and server- failure scenarios, including power loss, OS crashes,
etc.

> I want to know what means synchronously with out caching.
> In other word, which NFS options we must use follwoing the manual.
> sync ? or noac ? or both ?

Both.

You might be OK with async,ac *IF* you can guarantee that neither client
nor server will ever crash, lose their network connection to each other,
lose power, or otherwise malfunction in any way. In other words, even if
they're on the same computer, just don't do it.

For that matter, even with "sync,ac" it's hard to know if the NFS server
will really provide the proper write ordering. Your writes will probably
reach the NFS server in order, but whether the NFS server then writes
them to its disk in order - who knows. So if your NFS server crashes or
loses power, then EVEN if you disable all caching in the NFS procotol
you might still have data corruption.

NFS and databases: Just don't do it.

If your company only has NFS, now is a good opportunity to ask them for
iSCSI, ATA-over-Ethernet, network block device, a suitable clustering
file system, or SOME other way to access storage. It's incredibly hard,
if possible, to guarantee that a database will work properly over NFS
unless you know a lot about the details of the NFS client and server
involved - and any configuration that's safe will almost certainly also
be glacially slow.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim Montgomery 2010-06-25 05:03:01 Re: Need Some Recent Information on the Differences between Postgres and MySql
Previous Message Greg Smith 2010-06-25 02:42:44 Re: When to use Vacuum?