| 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>Chapter 11. Replication Methods</title> |
| 7 | <link rel="stylesheet" href="apiReference.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 C++ API Reference" /> |
| 10 | <link rel="up" href="index.html" title="Berkeley DB C++ API Reference" /> |
| 11 | <link rel="prev" href="mutexunlock.html" title="DbEnv::mutex_unlock()" /> |
| 12 | <link rel="next" href="db_site.html" title="The DbSite Handle" /> |
| 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">Chapter 11. |
| 22 | Replication Methods |
| 23 | </th> |
| 24 | </tr> |
| 25 | <tr> |
| 26 | <td width="20%" align="left"><a accesskey="p" href="mutexunlock.html">Prev</a> </td> |
| 27 | <th width="60%" align="center"> </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="db_site.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="chapter" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title"><a id="rep"></a>Chapter 11. |
| 38 | Replication Methods |
| 39 | </h2> |
| 40 | </div> |
| 41 | </div> |
| 42 | </div> |
| 43 | <p> |
| 44 | This chapter describes the APIs available to build Berkeley DB replicated |
| 45 | applications. There are two different ways to build replication into a Berkeley DB |
| 46 | application, and the APIs for both are described in this chapter. |
| 47 | </p> |
| 48 | <p> |
| 49 | For an overview of the two different ways to build a replicated |
| 50 | application, see the <em class="citetitle">Berkeley DB Getting Started with Replicated Applications</em> guide. |
| 51 | </p> |
| 52 | <p> |
| 53 | The first, and simplest, way to build a replication Berkeley DB application is via |
| 54 | the <span class="emphasis"><em>Replication Manager</em></span>. If the Replication Manager does not |
| 55 | meet your application's architectural requirements, you can write your own |
| 56 | replication implementation using the "Base APIs". |
| 57 | </p> |
| 58 | <p> |
| 59 | Note that the Replication Manager is written using the Base APIs. |
| 60 | </p> |
| 61 | <p> |
| 62 | Note, also, that applications which make use of the Replication Manager |
| 63 | use many of the Base APIs as the situation warrants. That said, |
| 64 | a few Base API methods cannot be used by applications that |
| 65 | are making use of the Replication Manager. Where this is |
| 66 | the case, this is noted in the following method |
| 67 | descriptions. |
| 68 | </p> |
| 69 | <p> |
| 70 | Finally, Replication Manager applications use the |
| 71 | <a class="link" href="db_site.html" title="The DbSite Handle">DbSite</a> class to manage |
| 72 | and configure replication sites. This handle is not used in any |
| 73 | way by Base API applications. |
| 74 | </p> |
| 75 | <div class="sect1" lang="en" xml:lang="en"> |
| 76 | <div class="titlepage"> |
| 77 | <div> |
| 78 | <div> |
| 79 | <h2 class="title" style="clear: both"><a id="replist"></a>Replication and Related Methods</h2> |
| 80 | </div> |
| 81 | </div> |
| 82 | </div> |
| 83 | <div class="navtable"> |
| 84 | <table border="1" width="80%"> |
| 85 | <thead> |
| 86 | <tr> |
| 87 | <th>Replication Manager Methods</th> |
| 88 | <th>Description</th> |
| 89 | </tr> |
| 90 | </thead> |
| 91 | <tbody> |
| 92 | <tr> |
| 93 | <td> |
| 94 | <a class="xref" href="dbchannel_close.html" title="DbChannel::close()">DbChannel::close()</a> |
| 95 | </td> |
| 96 | <td>Closes a DB_CHANNEL handle</td> |
| 97 | </tr> |
| 98 | <tr> |
| 99 | <td> |
| 100 | <a class="xref" href="dbchannel_send_msg.html" title="DbChannel::send_msg()">DbChannel::send_msg()</a> |
| 101 | </td> |
| 102 | <td>Sends an asynchronous message on a DB_CHANNEL</td> |
| 103 | </tr> |
| 104 | <tr> |
| 105 | <td> |
| 106 | <a class="xref" href="dbchannel_send_request.html" title="DbChannel::send_request()">DbChannel::send_request()</a> |
| 107 | </td> |
| 108 | <td>Sends a synchronous message on a DB_CHANNEL</td> |
| 109 | </tr> |
| 110 | <tr> |
| 111 | <td> |
| 112 | <a class="xref" href="dbchannel_set_timeout.html" title="DbChannel::set_timeout()">DbChannel::set_timeout()</a> |
| 113 | </td> |
| 114 | <td>Sets the default timeout for the DB_CHANNEL</td> |
| 115 | </tr> |
| 116 | <tr> |
| 117 | <td> |
| 118 | <a class="xref" href="repmgr_channel.html" title="DbEnv::repmgr_channel()">DbEnv::repmgr_channel()</a> |
| 119 | </td> |
| 120 | <td>Creates a DB_CHANNEL handle</td> |
| 121 | </tr> |
| 122 | <tr> |
| 123 | <td> |
| 124 | <a class="xref" href="repmgr_local_site.html" title="DbEnv::repmgr_local_site()">DbEnv::repmgr_local_site()</a> |
| 125 | </td> |
| 126 | <td>Returns a DB_SITE handle for the local site</td> |
| 127 | </tr> |
| 128 | <tr> |
| 129 | <td> |
| 130 | <a class="xref" href="repmgr_msg_dispatch.html" title="DbEnv::repmgr_msg_dispatch()">DbEnv::repmgr_msg_dispatch()</a> |
| 131 | </td> |
| 132 | <td>Creates a DB_CHANNEL handle</td> |
| 133 | </tr> |
| 134 | <tr> |
| 135 | <td><a class="xref" href="repmgrset_ack_policy.html" title="DbEnv::repmgr_set_ack_policy()">DbEnv::repmgr_set_ack_policy()</a>, <a class="xref" href="repmgrget_ack_policy.html" title="DbEnv::repmgr_get_ack_policy()">DbEnv::repmgr_get_ack_policy()</a></td> |
| 136 | <td>Specify the Replication Manager's client acknowledgement policy</td> |
| 137 | </tr> |
| 138 | <tr> |
| 139 | <td> |
| 140 | <a class="xref" href="repmgr_site.html" title="DbEnv::repmgr_site()">DbEnv::repmgr_site()</a> |
| 141 | </td> |
| 142 | <td>Creates a DB_SITE handle</td> |
| 143 | </tr> |
| 144 | <tr> |
| 145 | <td> |
| 146 | <a class="xref" href="repmgr_site_by_eid.html" title="DbEnv::repmgr_site_by_eid()">DbEnv::repmgr_site_by_eid()</a> |
| 147 | </td> |
| 148 | <td>Creates a DB_SITE handle given an EID value</td> |
| 149 | </tr> |
| 150 | <tr> |
| 151 | <td> |
| 152 | <a class="xref" href="repmgrsite_list.html" title="DbEnv::repmgr_site_list()">DbEnv::repmgr_site_list()</a> |
| 153 | </td> |
| 154 | <td>List the sites and their status</td> |
| 155 | </tr> |
| 156 | <tr> |
| 157 | <td> |
| 158 | <a class="xref" href="repmgrstart.html" title="DbEnv::repmgr_start()">DbEnv::repmgr_start()</a> |
| 159 | </td> |
| 160 | <td>Start the Replication Manager</td> |
| 161 | </tr> |
| 162 | <tr> |
| 163 | <td> |
| 164 | <a class="xref" href="repmgrstat.html" title="DbEnv::repmgr_stat()">DbEnv::repmgr_stat()</a> |
| 165 | </td> |
| 166 | <td>Replication Manager statistics</td> |
| 167 | </tr> |
| 168 | <tr> |
| 169 | <td> |
| 170 | <a class="xref" href="repmgrstat_print.html" title="DbEnv::repmgr_stat_print()">DbEnv::repmgr_stat_print()</a> |
| 171 | </td> |
| 172 | <td>Print Replication Manager statistics</td> |
| 173 | </tr> |
| 174 | <tr> |
| 175 | <td colspan="2"> |
| 176 | <span class="bold"> |
| 177 | <strong>Base API Methods</strong> |
| 178 | </span> |
| 179 | </td> |
| 180 | </tr> |
| 181 | <tr> |
| 182 | <td> |
| 183 | <a class="xref" href="repelect.html" title="DbEnv::rep_elect()">DbEnv::rep_elect()</a> |
| 184 | </td> |
| 185 | <td>Hold a replication election</td> |
| 186 | </tr> |
| 187 | <tr> |
| 188 | <td> |
| 189 | <a class="xref" href="repmessage.html" title="DbEnv::rep_process_message()">DbEnv::rep_process_message()</a> |
| 190 | </td> |
| 191 | <td>Process a replication message</td> |
| 192 | </tr> |
| 193 | <tr> |
| 194 | <td> |
| 195 | <a class="xref" href="reptransport.html" title="DbEnv::rep_set_transport()">DbEnv::rep_set_transport()</a> |
| 196 | </td> |
| 197 | <td>Configure replication transport callback</td> |
| 198 | </tr> |
| 199 | <tr> |
| 200 | <td> |
| 201 | <a class="xref" href="repstart.html" title="DbEnv::rep_start()">DbEnv::rep_start()</a> |
| 202 | </td> |
| 203 | <td>Start replication</td> |
| 204 | </tr> |
| 205 | <tr> |
| 206 | <td colspan="2"> |
| 207 | <span class="bold"> |
| 208 | <strong>Additional Replication Methods</strong> |
| 209 | </span> |
| 210 | </td> |
| 211 | </tr> |
| 212 | <tr> |
| 213 | <td> |
| 214 | <a class="xref" href="repstat.html" title="DbEnv::rep_stat()">DbEnv::rep_stat()</a> |
| 215 | </td> |
| 216 | <td>Replication statistics</td> |
| 217 | </tr> |
| 218 | <tr> |
| 219 | <td> |
| 220 | <a class="xref" href="repstat_print.html" title="DbEnv::rep_stat_print()">DbEnv::rep_stat_print()</a> |
| 221 | </td> |
| 222 | <td>Print replication statistics</td> |
| 223 | </tr> |
| 224 | <tr> |
| 225 | <td> |
| 226 | <a class="xref" href="repsync.html" title="DbEnv::rep_sync()">DbEnv::rep_sync()</a> |
| 227 | </td> |
| 228 | <td>Replication synchronization</td> |
| 229 | </tr> |
| 230 | <tr> |
| 231 | <td> |
| 232 | <a class="xref" href="envtxn_applied.html" title="DbEnv::txn_applied()">DbEnv::txn_applied()</a> |
| 233 | </td> |
| 234 | <td>Check if a transaction has been replicated</td> |
| 235 | </tr> |
| 236 | <tr> |
| 237 | <td colspan="2"> |
| 238 | <span class="bold"> |
| 239 | <strong>Replication Configuration</strong> |
| 240 | </span> |
| 241 | </td> |
| 242 | </tr> |
| 243 | <tr> |
| 244 | <td> |
| 245 | <a class="xref" href="dbsite_close.html" title="DbSite::close()">DbSite::close()</a> |
| 246 | </td> |
| 247 | <td>Closes the DB_SITE handle</td> |
| 248 | </tr> |
| 249 | <tr> |
| 250 | <td> |
| 251 | <a class="xref" href="dbsite_get_address.html" title="DbSite::get_address()">DbSite::get_address()</a> |
| 252 | </td> |
| 253 | <td>Returns a site's network address</td> |
| 254 | </tr> |
| 255 | <tr> |
| 256 | <td> |
| 257 | <a class="xref" href="dbsite_get_eid.html" title="DbSite::get_eid()">DbSite::get_eid()</a> |
| 258 | </td> |
| 259 | <td>Returns a site's Environment ID</td> |
| 260 | </tr> |
| 261 | <tr> |
| 262 | <td> |
| 263 | <a class="xref" href="dbsite_remove.html" title="DbSite::remove()">DbSite::remove()</a> |
| 264 | </td> |
| 265 | <td>Removes the site from the replication group</td> |
| 266 | </tr> |
| 267 | <tr> |
| 268 | <td><a class="xref" href="dbsite_set_config.html" title="DbSite::set_config()">DbSite::set_config()</a>, <a class="xref" href="dbsite_get_config.html" title="DbSite::get_config()">DbSite::get_config()</a></td> |
| 269 | <td>Configure a DB_SITE handle</td> |
| 270 | </tr> |
| 271 | <tr> |
| 272 | <td><a class="xref" href="repclockskew.html" title="DbEnv::rep_set_clockskew()">DbEnv::rep_set_clockskew()</a>, <a class="xref" href="repget_clockskew.html" title="DbEnv::rep_get_clockskew()">DbEnv::rep_get_clockskew()</a></td> |
| 273 | <td>Configure master lease clock adjustment</td> |
| 274 | </tr> |
| 275 | <tr> |
| 276 | <td><a class="xref" href="repconfig.html" title="DbEnv::rep_set_config()">DbEnv::rep_set_config()</a>, <a class="xref" href="repget_config.html" title="DbEnv::rep_get_config()">DbEnv::rep_get_config()</a></td> |
| 277 | <td>Configure the replication subsystem</td> |
| 278 | </tr> |
| 279 | <tr> |
| 280 | <td><a class="xref" href="repset_limit.html" title="DbEnv::rep_set_limit()">DbEnv::rep_set_limit()</a>, <a class="xref" href="repget_limit.html" title="DbEnv::rep_get_limit()">DbEnv::rep_get_limit()</a></td> |
| 281 | <td>Limit data sent in response to a single message</td> |
| 282 | </tr> |
| 283 | <tr> |
| 284 | <td><a class="xref" href="repnsites.html" title="DbEnv::rep_set_nsites()">DbEnv::rep_set_nsites()</a>, <a class="xref" href="repget_nsites.html" title="DbEnv::rep_get_nsites()">DbEnv::rep_get_nsites()</a></td> |
| 285 | <td>Configure replication group site count</td> |
| 286 | </tr> |
| 287 | <tr> |
| 288 | <td><a class="xref" href="reppriority.html" title="DbEnv::rep_set_priority()">DbEnv::rep_set_priority()</a>, <a class="xref" href="repget_priority.html" title="DbEnv::rep_get_priority()">DbEnv::rep_get_priority()</a></td> |
| 289 | <td>Configure replication site priority</td> |
| 290 | </tr> |
| 291 | <tr> |
| 292 | <td><a class="xref" href="repset_request.html" title="DbEnv::rep_set_request()">DbEnv::rep_set_request()</a>, <a class="xref" href="repget_request.html" title="DbEnv::rep_get_request()">DbEnv::rep_get_request()</a></td> |
| 293 | <td>Configure replication client retransmission requests</td> |
| 294 | </tr> |
| 295 | <tr> |
| 296 | <td><a class="xref" href="repset_timeout.html" title="DbEnv::rep_set_timeout()">DbEnv::rep_set_timeout()</a>, <a class="xref" href="repget_timeout.html" title="DbEnv::rep_get_timeout()">DbEnv::rep_get_timeout()</a></td> |
| 297 | <td>Configure replication timeouts</td> |
| 298 | </tr> |
| 299 | <tr> |
| 300 | <td colspan="2"> |
| 301 | <span class="bold"> |
| 302 | <strong>Transaction Operations</strong> |
| 303 | </span> |
| 304 | </td> |
| 305 | </tr> |
| 306 | <tr> |
| 307 | <td> |
| 308 | <a class="xref" href="txnset_commit_token.html" title="DbTxn::set_commit_token()">DbTxn::set_commit_token()</a> |
| 309 | </td> |
| 310 | <td>Set a commit token</td> |
| 311 | </tr> |
| 312 | </tbody> |
| 313 | </table> |
| 314 | </div> |
| 315 | </div> |
| 316 | </div> |
| 317 | <div class="navfooter"> |
| 318 | <hr /> |
| 319 | <table width="100%" summary="Navigation footer"> |
| 320 | <tr> |
| 321 | <td width="40%" align="left"><a accesskey="p" href="mutexunlock.html">Prev</a> </td> |
| 322 | <td width="20%" align="center"> </td> |
| 323 | <td width="40%" align="right"> <a accesskey="n" href="db_site.html">Next</a></td> |
| 324 | </tr> |
| 325 | <tr> |
| 326 | <td width="40%" align="left" valign="top">DbEnv::mutex_unlock() </td> |
| 327 | <td width="20%" align="center"> |
| 328 | <a accesskey="h" href="index.html">Home</a> |
| 329 | </td> |
| 330 | <td width="40%" align="right" valign="top"> The DbSite Handle</td> |
| 331 | </tr> |
| 332 | </table> |
| 333 | </div> |
| 334 | </body> |
| 335 | </html> |