1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>Remote filesystems</title> 7 <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" /> 10 <link rel="up" href="env.html" title="Chapter��9.�� The Berkeley DB Environment" /> 11 <link rel="prev" href="env_encrypt.html" title="Encryption" /> 12 <link rel="next" href="env_faq.html" title="Environment FAQ" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Remote filesystems</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="env_encrypt.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��9.�� 23 The Berkeley DB Environment 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="env_faq.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="env_remote"></a>Remote filesystems</h2> 35 </div> 36 </div> 37 </div> 38 <p>When Berkeley DB database environment shared memory regions are backed by the 39filesystem, it is a common application error to create database 40environments backed by remote filesystems such as the Network File 41System (NFS), Windows network shares (SMB/CIFS) or the Andrew File 42System (AFS). Remote filesystems rarely support mapping files into 43process memory, and even more rarely support correct semantics for 44mutexes if the mapping succeeds. For this reason, we recommend database 45environment directories be created in a local filesystem.</p> 46 <p>For remote filesystems that do allow remote files to be mapped into 47process memory, database environment directories accessed via remote 48filesystems cannot be used simultaneously from multiple clients (that 49is, from multiple computers). No commercial remote filesystem of which 50we're aware supports coherent, distributed shared memory for 51remote-mounted files. As a result, different machines will see 52different versions of these shared region files, and the behavior is 53undefined.</p> 54 <p>Databases, log files, and temporary files may be placed on remote 55filesystems, as long as the remote filesystem fully supports standard 56POSIX filesystem semantics (although the application may incur a 57performance penalty for doing so). Further, read-only databases on 58remote filesystems can be accessed from multiple systems simultaneously. 59However, it is difficult (or impossible) for modifiable databases on 60remote filesystems to be accessed from multiple systems simultaneously. 61The reason is the Berkeley DB library caches modified database pages, and when 62those modified pages are written to the backing file is not entirely 63under application control. If two systems were to write database pages 64to the remote filesystem at the same time, database corruption could 65result. If a system were to write a database page back to the remote 66filesystem at the same time as another system read a page, a core dump 67in the reader could result.</p> 68 <div class="variablelist"> 69 <dl> 70 <dt> 71 <span class="term">FreeBSD note:</span> 72 </dt> 73 <dd>Some historic FreeBSD releases will return ENOLCK from fsync and close 74calls on NFS-mounted filesystems, even though the call has succeeded. 75To support Berkeley DB on these releases, the Berkeley DB code should be modified 76to ignore ENOLCK errors, or no Berkeley DB files should be placed on 77NFS-mounted filesystems on these systems. Note that current FreeBSD 78releases do not suffer from this problem.</dd> 79 <dt> 80 <span class="term">Linux note:</span> 81 </dt> 82 <dd>Some historic Linux releases do not support complete semantics for the 83POSIX fsync call on NFS-mounted filesystems. No Berkeley DB files should be 84placed on NFS-mounted filesystems on these systems. Note that current 85Linux releases do not suffer from this problem.</dd> 86 </dl> 87 </div> 88 </div> 89 <div class="navfooter"> 90 <hr /> 91 <table width="100%" summary="Navigation footer"> 92 <tr> 93 <td width="40%" align="left"><a accesskey="p" href="env_encrypt.html">Prev</a>��</td> 94 <td width="20%" align="center"> 95 <a accesskey="u" href="env.html">Up</a> 96 </td> 97 <td width="40%" align="right">��<a accesskey="n" href="env_faq.html">Next</a></td> 98 </tr> 99 <tr> 100 <td width="40%" align="left" valign="top">Encryption��</td> 101 <td width="20%" align="center"> 102 <a accesskey="h" href="index.html">Home</a> 103 </td> 104 <td width="40%" align="right" valign="top">��Environment FAQ</td> 105 </tr> 106 </table> 107 </div> 108 </body> 109</html> 110