Debian Codegraph @

docs/programmer_reference/rep_init.html

raw symbols SCIP
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>Initializing a new site</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="rep_mastersync.html" title="Synchronizing with a master" />
12 <link rel="next" href="rep_bulk.html" title="Bulk transfer" />
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">Initializing a new site</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="rep_mastersync.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_bulk.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_init"></a>Initializing a new site</h2>
38 </div>
39 </div>
40 </div>
41 <p>By default, adding a new site to a replication group only requires the
42 client to join. Berkeley DB will automatically perform internal
43 initialization from the master to the client, bringing the client into
44 sync with the master.</p>
45 <p>
46 However, depending on the network and infrastructure, it can be
47 advantageous in a few instances to use a "hot backup" to initialize a
48 client into a replication group. Clients not wanting to automatically
49 perform internal initialization should call the <a href="../api_reference/C/repconfig.html" class="olink">DB_ENV-&gt;rep_set_config()</a> method to
50 turn off the <a href="../api_reference/C/repconfig.html#config_DB_REP_CONF_AUTOINIT" class="olink">DB_REP_CONF_AUTOINIT</a> flag. Turning off this
51 configuration flag causes Berkeley DB to
52 return <a href="../api_reference/C/repmessage.html#repmsg_DB_REP_JOIN_FAILURE" class="olink">DB_REP_JOIN_FAILURE</a> to the application's <a href="../api_reference/C/repmessage.html" class="olink">DB_ENV-&gt;rep_process_message()</a> method instead of
53 performing internal initialization.
54
55 </p>
56 <p>To use a hot backup to initialize a client into a replication group,
57 perform the following steps:</p>
58 <div class="orderedlist">
59 <ol type="1">
60 <li>Do an archival backup of the master's environment, as described in
61 <a class="xref" href="transapp_archival.html" title="Database and log file archival">Database and log file archival</a>. The backup can either be a conventional backup or a hot
62 backup.</li>
63 <li>Copy the archival backup into a clean environment directory on the
64 client.</li>
65 <li>Run catastrophic recovery on the client's new environment, as described
66 in <a class="xref" href="transapp_recovery.html" title="Recovery procedures">Recovery procedures</a>.</li>
67 <li>Reconfigure and reopen the environment as a client member of the
68 replication group.</li>
69 </ol>
70 </div>
71 <p>If copying the backup to the client takes a long time relative to the
72 frequency with which log files are reclaimed using the
73 <a href="../api_reference/C/db_archive.html" class="olink">db_archive</a> utility or the <a href="../api_reference/C/logarchive.html" class="olink">DB_ENV-&gt;log_archive()</a> method, it may be
74 necessary to suppress log reclamation until the newly restarted client
75 has "caught up" and applied all log records generated during its
76 downtime.</p>
77 <p>As with any Berkeley DB application, the database environment must be in a
78 consistent state at application startup. This is most easily assured
79 by running recovery at startup time in one thread or process; it is
80 harmless to do this on both clients and masters even when not strictly
81 necessary.</p>
82 </div>
83 <div class="navfooter">
84 <hr />
85 <table width="100%" summary="Navigation footer">
86 <tr>
87 <td width="40%" align="left"><a accesskey="p" href="rep_mastersync.html">Prev</a> </td>
88 <td width="20%" align="center">
89 <a accesskey="u" href="rep.html">Up</a>
90 </td>
91 <td width="40%" align="right"> <a accesskey="n" href="rep_bulk.html">Next</a></td>
92 </tr>
93 <tr>
94 <td width="40%" align="left" valign="top">Synchronizing with a master </td>
95 <td width="20%" align="center">
96 <a accesskey="h" href="index.html">Home</a>
97 </td>
98 <td width="40%" align="right" valign="top"> Bulk transfer</td>
99 </tr>
100 </table>
101 </div>
102 </body>
103 </html>