1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Replication Manager methods</title>
<link rel="stylesheet" href="gettingStarted.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
<link rel="up" href="rep.html" title="Chapter 12. Berkeley DB Replication" />
<link rel="prev" href="rep_app.html" title="Building replicated applications" />
<link rel="next" href="rep_base_meth.html" title="Base API Methods" />
</head>
<body>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Replication Manager methods</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="rep_app.html">Prev</a> </td>
<th width="60%" align="center">Chapter 12.
Berkeley DB Replication
</th>
<td width="20%" align="right"> <a accesskey="n" href="rep_base_meth.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="rep_mgr_meth"></a>Replication Manager methods</h2>
</div>
</div>
</div>
<p>Applications which use the Replication Manager support generally call
the following Berkeley DB methods. The general pattern is to call various
methods to configure Replication Manager, and then start it by calling
<a href="../api_reference/C/repmgrstart.html" class="olink">DB_ENV->repmgr_start()</a>. Once this initialization is complete, the
application rarely needs to call any of these methods. (A prime
example of an exception to this rule would be the <a href="../api_reference/C/repsync.html" class="olink">DB_ENV->rep_sync()</a> method,
if the application is <a class="xref" href="rep_mastersync.html#rep_delay_sync" title="Delaying client synchronization">Delaying client synchronization</a>.)</p>
<div class="variablelist">
<dl>
<dt>
<span class="term">
<a href="../api_reference/C/repmgrlocal_site.html" class="olink">DB_ENV->repmgr_set_local_site()</a>
</span>
</dt>
<dd>
<p>
The <a href="../api_reference/C/repmgrlocal_site.html" class="olink">DB_ENV->repmgr_set_local_site()</a> method configures the TCP/IP address of
the local site, by specifying the port number on which it is to
listen for incoming connection requests. This method must be
called exactly once before calling <a href="../api_reference/C/repmgrstart.html" class="olink">DB_ENV->repmgr_start()</a>.
</p>
</dd>
<dt>
<span class="term">
<a href="../api_reference/C/repmgrremote_site.html" class="olink">DB_ENV->repmgr_add_remote_site()</a>
</span>
</dt>
<dd>
<p>
The <a href="../api_reference/C/repmgrremote_site.html" class="olink">DB_ENV->repmgr_add_remote_site()</a> method adds a remote site to the list
of sites initially known by the local site. The remote site is
specified in terms of a TCP/IP network address: host name and
port number. This method may be called as many times as
necessary to configure all known remote sites. Note that it is
usually not necessary for each site in the replication group
initially to know about all other sites in the group. Sites
can discover each other dynamically, as described in <a class="xref" href="rep_newsite.html" title="Connecting to a new site">Connecting to a new site</a>.
</p>
</dd>
<dt>
<span class="term">
<a href="../api_reference/C/repmgrset_ack_policy.html" class="olink">DB_ENV->repmgr_set_ack_policy()</a>
</span>
</dt>
<dd>
<p>
The <a href="../api_reference/C/repmgrset_ack_policy.html" class="olink">DB_ENV->repmgr_set_ack_policy()</a> method configures the acknowledgement
policy to be used in the replication group, in other words, the
behavior of the master with respect to acknowledgements for
"permanent" messages, which implements the application's
requirements for <a class="xref" href="rep_trans.html" title="Transactional guarantees">Transactional guarantees</a>. The current implementation
requires all sites in the replication group to configure the same
acknowledgement policy.
</p>
</dd>
<dt>
<span class="term">
<a href="../api_reference/C/repnsites.html" class="olink">DB_ENV->rep_set_nsites()</a>
</span>
</dt>
<dd>
<p>
The <a href="../api_reference/C/repnsites.html" class="olink">DB_ENV->rep_set_nsites()</a> method tells Replication Manager the total
number of sites in the replication group. This is usually
necessary for proper operation of elections, and for counting
message acknowledgements (depending on the acknowledgement
policy).
</p>
</dd>
<dt>
<span class="term">
<a href="../api_reference/C/reppriority.html" class="olink">DB_ENV->rep_set_priority()</a>
</span>
</dt>
<dd>
<p>
The <a href="../api_reference/C/reppriority.html" class="olink">DB_ENV->rep_set_priority()</a> method configures the local site's priority
for the purpose of elections.
</p>
</dd>
<dt>
<span class="term">
<a href="../api_reference/C/repset_timeout.html" class="olink">DB_ENV->rep_set_timeout()</a>
</span>
</dt>
<dd>
<p>
This method optionally configures various timeout values.
Otherwise default timeout values as specified in <a href="../api_reference/C/repset_timeout.html" class="olink">DB_ENV->rep_set_timeout()</a>
are used. In particular, Replication Manager client sites can
be configured to monitor the health of the TCP/IP connection to
the master site using heartbeat messages. If the client
receives no messages from the master for a certain amount of
time, it considers the connection to be broken, and calls for
an election to choose a new master.
</p>
</dd>
<dt>
<span class="term">
<a href="../api_reference/C/envevent_notify.html" class="olink">DB_ENV->set_event_notify()</a>
</span>
</dt>
<dd>
<p>
Once configured and started, Replication Manager does virtually
all of its work in the background, usually without the need for
any direct communication with the application. However,
occasionally events occur which the application may be
interested in knowing about. The application can request
notification of these events by calling the <a href="../api_reference/C/envevent_notify.html" class="olink">DB_ENV->set_event_notify()</a>
method.
</p>
</dd>
<dt>
<span class="term">
<a href="../api_reference/C/repmgrstart.html" class="olink">DB_ENV->repmgr_start()</a>
</span>
</dt>
<dd>
<p>
The <a href="../api_reference/C/repmgrstart.html" class="olink">DB_ENV->repmgr_start()</a> method starts the replication system. It
opens the listening TCP/IP socket and creates all the
background processing threads that will be needed.
</p>
</dd>
</dl>
</div>
<p>In addition to the methods previously described, Replication Manager
applications may also call the following methods, as needed:
<a href="../api_reference/C/repconfig.html" class="olink">DB_ENV->rep_set_config()</a>, <a href="../api_reference/C/repset_limit.html" class="olink">DB_ENV->rep_set_limit()</a>, <a href="../api_reference/C/repset_request.html" class="olink">DB_ENV->rep_set_request()</a>,
<a href="../api_reference/C/repsync.html" class="olink">DB_ENV->rep_sync()</a> and <a href="../api_reference/C/repstat.html" class="olink">DB_ENV->rep_stat()</a>.</p>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="rep_app.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="rep.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="rep_base_meth.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Building replicated applications </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> Base API Methods</td>
</tr>
</table>
</div>
</body>
</html>
|