| 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>Managing Replication Files</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="rep.html" title="Chapter 12. Berkeley DB Replication" /> |
| 11 | <link rel="prev" href="group_membership.html" title="Managing Replication Manager Group Membership" /> |
| 12 | <link rel="next" href="rep_mgrmulti.html" title="Running Replication Manager in multiple processes" /> |
| 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">Managing Replication Files</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="group_membership.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 12. |
| 26 | Berkeley DB Replication |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="rep_mgrmulti.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="rep_filename"></a>Managing Replication Files</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <p> |
| 42 | Whether you use the Base API or the Replication Manager, |
| 43 | replication creates a set of internal files that are normally stored |
| 44 | on-disk in your environment home directory. These files contain |
| 45 | metadata which is necessary for replication operations, and so you |
| 46 | should never delete these files. |
| 47 | </p> |
| 48 | <p> |
| 49 | You can cause these files to not be stored on disk, but instead to |
| 50 | be held entirely in-memory, by specifying the <a href="../api_reference/C/repconfig.html#config_DB_REP_CONF_INMEM" class="olink">DB_REP_CONF_INMEM</a> |
| 51 | flag to the <a href="../api_reference/C/repconfig.html" class="olink">DB_ENV->rep_set_config()</a> method. Doing this can improve your |
| 52 | application's data throughput by avoiding the disk I/O associated |
| 53 | with these metadata files. However, in the event that your |
| 54 | application is shut down, the contents of these files are lost. This |
| 55 | results in some loss of functionality, including an increased |
| 56 | chance that elections will fail, or that the wrong site will win an |
| 57 | election. See the <a href="../api_reference/C/repconfig.html#config_DB_REP_CONF_INMEM" class="olink">DB_REP_CONF_INMEM</a> flag description for more |
| 58 | information. |
| 59 | </p> |
| 60 | <p> |
| 61 | Note that turning on <a href="../api_reference/C/repconfig.html#config_DB_REP_CONF_INMEM" class="olink">DB_REP_CONF_INMEM</a> means that Replication |
| 62 | Manager cannot store group membership changes persistently. This is |
| 63 | because Replication Manager stores group membership information in |
| 64 | an internal database, which is held in memory when |
| 65 | <a href="../api_reference/C/repconfig.html#config_DB_REP_CONF_INMEM" class="olink">DB_REP_CONF_INMEM</a> is turned on. For this reason, if your |
| 66 | Replication Manager application requires replication metadata to be |
| 67 | stored in memory, then you must manually identify all the sites in |
| 68 | your replication group using the <code class="literal">DB_LEGACY</code> site |
| 69 | configuration attribute. Be aware that this configuration needs to |
| 70 | be made permanent. (Normally, <code class="literal">DB_LEGACY</code> is used |
| 71 | only on a temporary basis for the purpose of upgrading old |
| 72 | Replication Manager applications.) |
| 73 | </p> |
| 74 | <p> |
| 75 | Do the following: |
| 76 | </p> |
| 77 | <div class="orderedlist"> |
| 78 | <ol type="1"> |
| 79 | <li> |
| 80 | <p> |
| 81 | Shut down all the sites in your replication group. |
| 82 | </p> |
| 83 | </li> |
| 84 | <li> |
| 85 | <p> |
| 86 | For every site in your replication group: |
| 87 | </p> |
| 88 | <div class="orderedlist"> |
| 89 | <ol type="a"> |
| 90 | <li> |
| 91 | <p> |
| 92 | Configure a <a href="../api_reference/C/db_site.html" class="olink">DB_SITE</a> handle for the local site. |
| 93 | Use <a href="../api_reference/C/dbsite_set_config.html" class="olink">DB_SITE->set_config()</a> to indicate that this |
| 94 | is a legacy site by setting the |
| 95 | <code class="literal">DB_LEGACY</code> parameter. |
| 96 | </p> |
| 97 | </li> |
| 98 | <li> |
| 99 | <p> |
| 100 | Configure a <a href="../api_reference/C/db_site.html" class="olink">DB_SITE</a> handle for <span class="emphasis"><em>every |
| 101 | other site</em></span> in the replication |
| 102 | group. Set the <code class="literal">DB_LEGACY</code> |
| 103 | parameter for each of these handles. |
| 104 | </p> |
| 105 | <p> |
| 106 | Please pay careful attention to this step. To |
| 107 | repeat: a <a href="../api_reference/C/db_site.html" class="olink">DB_SITE</a> handle MUST be configured |
| 108 | for EVERY site in the replication group. |
| 109 | </p> |
| 110 | </li> |
| 111 | </ol> |
| 112 | </div> |
| 113 | </li> |
| 114 | <li> |
| 115 | <p> |
| 116 | Restart all the sites in the replication group. |
| 117 | </p> |
| 118 | </li> |
| 119 | </ol> |
| 120 | </div> |
| 121 | <p> |
| 122 | Alternatively, you can store persistent environment metadata files, |
| 123 | including those required by replication, in a location other than |
| 124 | your environment home directory. Doing so can help improve I/O |
| 125 | throughput by placing these files on a spindle that is not being |
| 126 | used for other environment data I/O. You do this using the |
| 127 | <a href="../api_reference/C/envset_metadata_dir.html" class="olink">DB_ENV->set_metadata_dir()</a> method. |
| 128 | </p> |
| 129 | <p> |
| 130 | Note that you must configure the handling of your environment |
| 131 | metadata consistently across your entire replication group. That |
| 132 | is, if you place your replication metadata in-memory on one |
| 133 | site, then it must be placed in-memory on all the sites in the |
| 134 | group. Similarly, if you place your replication metadata files in a |
| 135 | non-standard directory location on one site, then they must be |
| 136 | placed in the exact same directory location on all the sites in |
| 137 | your group. |
| 138 | </p> |
| 139 | </div> |
| 140 | <div class="navfooter"> |
| 141 | <hr /> |
| 142 | <table width="100%" summary="Navigation footer"> |
| 143 | <tr> |
| 144 | <td width="40%" align="left"><a accesskey="p" href="group_membership.html">Prev</a> </td> |
| 145 | <td width="20%" align="center"> |
| 146 | <a accesskey="u" href="rep.html">Up</a> |
| 147 | </td> |
| 148 | <td width="40%" align="right"> <a accesskey="n" href="rep_mgrmulti.html">Next</a></td> |
| 149 | </tr> |
| 150 | <tr> |
| 151 | <td width="40%" align="left" valign="top">Managing Replication Manager Group Membership </td> |
| 152 | <td width="20%" align="center"> |
| 153 | <a accesskey="h" href="index.html">Home</a> |
| 154 | </td> |
| 155 | <td width="40%" align="right" valign="top"> Running Replication Manager in multiple processes</td> |
| 156 | </tr> |
| 157 | </table> |
| 158 | </div> |
| 159 | </body> |
| 160 | </html> |