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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
|
<?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>Chapter 10. Replication Methods</title>
<link rel="stylesheet" href="apiReference.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Berkeley DB C API Reference" />
<link rel="up" href="index.html" title="Berkeley DB C API Reference" />
<link rel="prev" href="mutexunlock.html" title="DB_ENV->mutex_unlock()" />
<link rel="next" href="db_site.html" title="The DB_SITE Handle" />
</head>
<body>
<div xmlns="" class="navheader">
<div class="libver">
<p>Library Version 12.1.6.1</p>
</div>
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Chapter 10.
Replication Methods
</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="mutexunlock.html">Prev</a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="db_site.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="chapter" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title"><a id="rep"></a>Chapter 10.
Replication Methods
</h2>
</div>
</div>
</div>
<p>
This chapter describes the APIs available to build Berkeley DB replicated
applications. There are two different ways to build replication into a Berkeley DB
application, and the APIs for both are described in this chapter.
</p>
<p>
For an overview of the two different ways to build a replicated
application, see the <em class="citetitle">Berkeley DB Getting Started with Replicated Applications</em> guide.
</p>
<p>
The first, and simplest, way to build a replication Berkeley DB application is via
the <span class="emphasis"><em>Replication Manager</em></span>. If the Replication Manager does not
meet your application's architectural requirements, you can write your own
replication implementation using the "Base APIs".
</p>
<p>
Note that the Replication Manager is written using the Base APIs.
</p>
<p>
Note, also, that applications which make use of the Replication Manager
use many of the Base APIs as the situation warrants. That said,
a few Base API methods cannot be used by applications that
are making use of the Replication Manager. Where this is
the case, this is noted in the following method
descriptions.
</p>
<p>
Finally, Replication Manager applications use the
<a class="link" href="db_site.html" title="The DB_SITE Handle">DB_SITE</a> class to manage
and configure replication sites. The
<a class="link" href="db_channel.html" title="The DB_CHANNEL Handle">DB_CHANNEL</a> class can
be used to transmit custom messages between sites in the
replication group. These classes are not used in
any way by Base API applications.
</p>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="replist"></a>Replication and Related Methods</h2>
</div>
</div>
</div>
<div class="navtable">
<table border="1" width="80%">
<thead>
<tr>
<th>Replication Manager Methods</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a class="xref" href="dbchannel_close.html" title="DB_CHANNEL->close()">DB_CHANNEL->close()</a>
</td>
<td>Closes a DB_CHANNEL handle</td>
</tr>
<tr>
<td>
<a class="xref" href="dbchannel_send_msg.html" title="DB_CHANNEL->send_msg()">DB_CHANNEL->send_msg()</a>
</td>
<td>Sends an asynchronous message on a DB_CHANNEL</td>
</tr>
<tr>
<td>
<a class="xref" href="dbchannel_send_request.html" title="DB_CHANNEL->send_request()">DB_CHANNEL->send_request()</a>
</td>
<td>Sends a synchronous message on a DB_CHANNEL</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgr_channel.html" title="DB_ENV->repmgr_channel()">DB_ENV->repmgr_channel()</a>
</td>
<td>Creates a DB_CHANNEL handle</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgr_local_site.html" title="DB_ENV->repmgr_local_site()">DB_ENV->repmgr_local_site()</a>
</td>
<td>Returns a DB_SITE handle for the local site</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgr_msg_dispatch.html" title="DB_ENV->repmgr_msg_dispatch()">DB_ENV->repmgr_msg_dispatch()</a>
</td>
<td>Configures a DB_CHANNEL's message dispatch function</td>
</tr>
<tr>
<td><a class="xref" href="repmgrset_ack_policy.html" title="DB_ENV->repmgr_set_ack_policy()">DB_ENV->repmgr_set_ack_policy()</a>, <a class="xref" href="repmgrget_ack_policy.html" title="DB_ENV->repmgr_get_ack_policy()">DB_ENV->repmgr_get_ack_policy()</a></td>
<td>Specify the Replication Manager's client acknowledgement policy</td>
</tr>
<tr>
<td><a class="xref" href="repmgrset_incoming_queue_max.html" title="DB_ENV->repmgr_set_incoming_queue_max()">
DB_ENV->repmgr_set_incoming_queue_max()
</a>, <a class="xref" href="repmgrget_incoming_queue_max.html" title="DB_ENV->repmgr_get_incoming_queue_max()">
DB_ENV->repmgr_get_incoming_queue_max()
</a></td>
<td>Configure the Replication Manager incoming queue size limit.</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgr_site.html" title="DB_ENV->repmgr_site()">DB_ENV->repmgr_site()</a>
</td>
<td>Creates a DB_SITE handle</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgr_site_by_eid.html" title="DB_ENV->repmgr_site_by_eid()">DB_ENV->repmgr_site_by_eid()</a>
</td>
<td>Creates a DB_SITE handle given an EID value</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgrsite_list.html" title="DB_ENV->repmgr_site_list()">DB_ENV->repmgr_site_list()</a>
</td>
<td>List the sites and their status</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgrstart.html" title="DB_ENV->repmgr_start()">DB_ENV->repmgr_start()</a>
</td>
<td>Start the Replication Manager</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgrstat.html" title="DB_ENV->repmgr_stat()">DB_ENV->repmgr_stat()</a>
</td>
<td>Replication Manager statistics</td>
</tr>
<tr>
<td>
<a class="xref" href="repmgrstat_print.html" title="DB_ENV->repmgr_stat_print()">DB_ENV->repmgr_stat_print()</a>
</td>
<td>Print Replication Manager statistics</td>
</tr>
<tr>
<td>
<a class="xref" href="dbsite_close.html" title="DB_SITE->close()">DB_SITE->close()</a>
</td>
<td>Closes the DB_SITE handle</td>
</tr>
<tr>
<td colspan="2">
<span class="bold">
<strong>Base API Methods</strong>
</span>
</td>
</tr>
<tr>
<td>
<a class="xref" href="repelect.html" title="DB_ENV->rep_elect()">DB_ENV->rep_elect()</a>
</td>
<td>Hold a replication election</td>
</tr>
<tr>
<td>
<a class="xref" href="repmessage.html" title="DB_ENV->rep_process_message()">DB_ENV->rep_process_message()</a>
</td>
<td>Process a replication message</td>
</tr>
<tr>
<td>
<a class="xref" href="reptransport.html" title="DB_ENV->rep_set_transport()">DB_ENV->rep_set_transport()</a>
</td>
<td>Configure replication transport callback</td>
</tr>
<tr>
<td>
<a class="xref" href="repstart.html" title="DB_ENV->rep_start()">DB_ENV->rep_start()</a>
</td>
<td>Start replication</td>
</tr>
<tr>
<td colspan="2">
<span class="bold">
<strong>Additional Replication Methods</strong>
</span>
</td>
</tr>
<tr>
<td>
<a class="xref" href="repstat.html" title="DB_ENV->rep_stat()">DB_ENV->rep_stat()</a>
</td>
<td>Replication statistics</td>
</tr>
<tr>
<td>
<a class="xref" href="repstat_print.html" title="DB_ENV->rep_stat_print()">DB_ENV->rep_stat_print()</a>
</td>
<td>Print replication statistics</td>
</tr>
<tr>
<td>
<a class="xref" href="repsync.html" title="DB_ENV->rep_sync()">DB_ENV->rep_sync()</a>
</td>
<td>Replication synchronization</td>
</tr>
<tr>
<td colspan="2">
<span class="bold">
<strong>Replication Configuration</strong>
</span>
</td>
</tr>
<tr>
<td>
<a class="xref" href="dbchannel_set_timeout.html" title="DB_CHANNEL->set_timeout()">DB_CHANNEL->set_timeout()</a>
</td>
<td>Sets the default timeout for a DB_CHANNEL</td>
</tr>
<tr>
<td>
<a class="xref" href="dbsite_get_address.html" title="DB_SITE->get_address()">DB_SITE->get_address()</a>
</td>
<td>Returns a site's network address</td>
</tr>
<tr>
<td>
<a class="xref" href="dbsite_get_eid.html" title="DB_SITE->get_eid()">DB_SITE->get_eid()</a>
</td>
<td>Returns a site's environment ID</td>
</tr>
<tr>
<td>
<a class="xref" href="dbsite_remove.html" title="DB_SITE->remove()">DB_SITE->remove()</a>
</td>
<td>Removes the site from the replication group</td>
</tr>
<tr>
<td><a class="xref" href="dbsite_set_config.html" title="DB_SITE->set_config()">DB_SITE->set_config()</a>, <a class="xref" href="dbsite_get_config.html" title="DB_SITE->get_config()">DB_SITE->get_config()</a></td>
<td>Configure a DB_SITE handle</td>
</tr>
<tr>
<td><a class="xref" href="repclockskew.html" title="DB_ENV->rep_set_clockskew()">DB_ENV->rep_set_clockskew()</a>, <a class="xref" href="repget_clockskew.html" title="DB_ENV->rep_get_clockskew()">DB_ENV->rep_get_clockskew()</a></td>
<td>Configure master lease clock adjustment</td>
</tr>
<tr>
<td><a class="xref" href="repconfig.html" title="DB_ENV->rep_set_config()">DB_ENV->rep_set_config()</a>, <a class="xref" href="repget_config.html" title="DB_ENV->rep_get_config()">DB_ENV->rep_get_config()</a></td>
<td>Configure the replication subsystem</td>
</tr>
<tr>
<td><a class="xref" href="repset_limit.html" title="DB_ENV->rep_set_limit()">DB_ENV->rep_set_limit()</a>, <a class="xref" href="repget_limit.html" title="DB_ENV->rep_get_limit()">DB_ENV->rep_get_limit()</a></td>
<td>Limit data sent in response to a single message</td>
</tr>
<tr>
<td><a class="xref" href="repnsites.html" title="DB_ENV->rep_set_nsites()">DB_ENV->rep_set_nsites()</a>, <a class="xref" href="repget_nsites.html" title="DB_ENV->rep_get_nsites()">DB_ENV->rep_get_nsites()</a></td>
<td>Configure replication group site count</td>
</tr>
<tr>
<td><a class="xref" href="reppriority.html" title="DB_ENV->rep_set_priority()">DB_ENV->rep_set_priority()</a>, <a class="xref" href="repget_priority.html" title="DB_ENV->rep_get_priority()">DB_ENV->rep_get_priority()</a></td>
<td>Configure replication site priority</td>
</tr>
<tr>
<td><a class="xref" href="repset_request.html" title="DB_ENV->rep_set_request()">DB_ENV->rep_set_request()</a>, <a class="xref" href="repget_request.html" title="DB_ENV->rep_get_request()">DB_ENV->rep_get_request()</a></td>
<td>Configure replication client retransmission requests</td>
</tr>
<tr>
<td><a class="xref" href="repset_timeout.html" title="DB_ENV->rep_set_timeout()">DB_ENV->rep_set_timeout()</a>, <a class="xref" href="repget_timeout.html" title="DB_ENV->rep_get_timeout()">DB_ENV->rep_get_timeout()</a></td>
<td>Configure replication timeouts</td>
</tr>
<tr>
<td>
<a class="xref" href="repset_view.html" title="DB_ENV->rep_set_view()">DB_ENV->rep_set_view()</a>
</td>
<td>Configure the replication view callback</td>
</tr>
<tr>
<td colspan="2">
<span class="bold">
<strong>Transaction Operations</strong>
</span>
</td>
</tr>
<tr>
<td>
<a class="xref" href="envtxn_applied.html" title="DB_ENV->txn_applied()">DB_ENV->txn_applied()</a>
</td>
<td>Check if a transaction has been replicated</td>
</tr>
<tr>
<td>
<a class="xref" href="txnset_commit_token.html" title="DB_TXN->set_commit_token()">DB_TXN->set_commit_token()</a>
</td>
<td>Set a commit token</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="mutexunlock.html">Prev</a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="db_site.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">DB_ENV->mutex_unlock() </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> The DB_SITE Handle</td>
</tr>
</table>
</div>
</body>
</html>
|