[vox-tech] Is NFS unsafe? [Was: Clusters, renderfarms and MySQL...]
Bill Broadley
bill at broadley.org
Tue Mar 5 08:52:03 PST 2013
On 03/04/2013 02:46 PM, timriley at appahost.com wrote:
> NFS has been an easy way to implement growth and has been reliable in
> the
> three decades I've been using it.
I've been reasonably happy with NFS for the last 20 years or so, but I
never tried running a database on it.
I attended a talk by one of the lead MySQL developers at one of the
Moscone Linux World/expos. At the end of the talk someone inquired
about NFS for mysql storage. The room went silent, and the developer
said don't do that. Many people chuckled. The speaker and the crowd
seemed to all agree that Mysql over NFS was a bad bad idea.
The problems is that while NFS has file locking that certain situations
require byte range locking, which is not available.
Have things changed?
A paragraph from the Mysql docs (5.6.1):
> Even when the preceding precautions are observed, this kind of setup >
works only with MyISAM and MERGE tables, and not with any of the
> other storage engines. Also, this warning against sharing a data
> directory among servers always applies in an NFS environment.
> Permitting multiple MySQL servers to access a common data directory
> over NFS is a very bad idea. The primary problem is that NFS is the
> speed bottleneck. It is not meant for such use. Another risk with NFS
> is that you must devise a way to ensure that two or more servers do
> not interfere with each other. Usually NFS file locking is handled by
> the lockd daemon, but at the moment there is no platform that
> performs locking 100% reliably in every situation.
Elsewhere the mysql docs:
It is not a good idea to configure InnoDB to use data files or log
files on NFS volumes.
> In Kyle Rankin's (http://www.linuxjournal.com/users/kyle-rankin)
> book, "The Official ubuntu Server Book" (copyright 2009,
[snip]
I'm all for NFS, but not for things that require byte range locking.
Did Kyle address mysql on NFS specifically? Or just NFS?
> The vulnerability presented here is having multiple MySQL servers
> accessing the same table across NFS. Of course, don't do that.
Certainly that's even worse, pretty much guaranteeing corruptions unless
all databases are using the tables read-only.
Everything I've seen on best practices for MySQL say to use local disk
or to use a block device like iSCSI for reasonably behavior when being
used with a database.
More information about the vox-tech
mailing list