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