1<!--$Id: mgr_meth.so,v 1.10 2008/04/23 13:35:47 sue Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: Replication Manager methods</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Berkeley DB Replication</dl></b></td>
13<td align=right><a href="/rep/app.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/rep/base_meth.html"><img src="/images/next.gif" alt="Next"></a>
14</td></tr></table>
15<p align=center><b>Replication Manager methods</b></p>
16<p>Applications which use the Replication Manager support generally call
17the following Berkeley DB methods.  The general pattern is to call various
18methods to configure Replication Manager, and then start it by calling
19<a href="/api_c/repmgr_start.html">DB_ENV-&gt;repmgr_start</a>.  Once this initialization is complete, the
20application rarely needs to call any of these methods.  (A prime
21example of an exception to this rule would be the <a href="/api_c/rep_sync.html">DB_ENV-&gt;rep_sync</a> method,
22if the application is doing <a href="/ref/rep/mastersync.html">delayed synchronization</a>.)</p>
23<br>
24<b><a href="/api_c/repmgr_local_site.html">DB_ENV-&gt;repmgr_set_local_site</a></b><ul compact><li>The <a href="/api_c/repmgr_local_site.html">DB_ENV-&gt;repmgr_set_local_site</a> method configures the TCP/IP address of
25the local site, by specifying the port number on which it is to listen
26for incoming connection requests.  This method must be called exactly
27once before calling <a href="/api_c/repmgr_start.html">DB_ENV-&gt;repmgr_start</a>.</ul>
28<b><a href="/api_c/repmgr_remote_site.html">DB_ENV-&gt;repmgr_add_remote_site</a></b><ul compact><li>The <a href="/api_c/repmgr_remote_site.html">DB_ENV-&gt;repmgr_add_remote_site</a> method adds a remote site to the list of
29sites initially known by the local site.  The remote site is specified
30in terms of a TCP/IP network address: host name and port number.  This
31method may be called as many times as necessary to configure all known
32remote sites.  Note that it is usually not necessary for each site in
33the replication group initially to know about all other sites in the
34group.  Sites can discover each other dynamically, as described in
35<a href="/ref/rep/newsite.html">Connecting to a new site</a>.</ul>
36<b><a href="/api_c/repmgr_ack_policy.html">DB_ENV-&gt;repmgr_set_ack_policy</a></b><ul compact><li>The <a href="/api_c/repmgr_ack_policy.html">DB_ENV-&gt;repmgr_set_ack_policy</a> method configures the acknowledgement
37policy to be used in the replication group, in other words, the
38behavior of the master with respect to acknowledgements for
39"permanent" messages, which implements the application's requirements
40for <a href="/ref/rep/trans.html">transactional guarantees</a>.  The
41current implementation requires all sites in the replication group
42configure the same acknowledgement policy.</ul>
43<b><a href="/api_c/rep_nsites.html">DB_ENV-&gt;rep_set_nsites</a></b><ul compact><li>The <a href="/api_c/rep_nsites.html">DB_ENV-&gt;rep_set_nsites</a> method tells Replication Manager the total number
44of sites in the replication group.  This is usually necessary for
45proper operation of elections, and for counting message
46acknowledgements (depending on the acknowledgement policy).</ul>
47<b><a href="/api_c/rep_priority.html">DB_ENV-&gt;rep_set_priority</a></b><ul compact><li>The <a href="/api_c/rep_priority.html">DB_ENV-&gt;rep_set_priority</a> method configures the local site's priority for
48the purpose of elections.</ul>
49<b><a href="/api_c/rep_timeout.html">DB_ENV-&gt;rep_set_timeout</a></b><ul compact><li>This method optionally configures various timeout values.  Otherwise
50default timeout values as specified in <a href="/api_c/rep_timeout.html">DB_ENV-&gt;rep_set_timeout</a> are
51used.  In particular, Replication Manager client sites can be
52configured to monitor the health of the TCP/IP connection to the
53master site using heartbeat messages.  If the client receives no
54messages from the master for a certain amount of time, it considers
55the connection to be broken, and calls for an election to choose a new
56master.</ul>
57<b><a href="/api_c/env_event_notify.html">DB_ENV-&gt;set_event_notify</a></b><ul compact><li>Once configured and started, Replication Manager does virtually all of
58its work in the background, usually without the need for any direct
59communication with the application.  However, occasionally events
60occur which the application may be interested in knowing about.  The
61application can request notification of these events by calling the
62<a href="/api_c/env_event_notify.html">DB_ENV-&gt;set_event_notify</a> method.</ul>
63<b><a href="/api_c/repmgr_start.html">DB_ENV-&gt;repmgr_start</a></b><ul compact><li>The <a href="/api_c/repmgr_start.html">DB_ENV-&gt;repmgr_start</a> method starts the replication system.  It opens the
64listening TCP/IP socket and creates all the background processing
65threads that will be needed.</ul>
66<br>
67<p>In addition to the methods previously described, Replication Manager
68applications may also call the following methods, as needed:
69<a href="/api_c/rep_config.html">DB_ENV-&gt;rep_set_config</a>, <a href="/api_c/rep_limit.html">DB_ENV-&gt;rep_set_limit</a>, <a href="/api_c/rep_request.html">DB_ENV-&gt;rep_set_request</a>,
70<a href="/api_c/rep_sync.html">DB_ENV-&gt;rep_sync</a>, <a href="/api_c/rep_stat.html">DB_ENV-&gt;rep_stat</a>.</p>
71<table width="100%"><tr><td><br></td><td align=right><a href="/rep/app.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/rep/base_meth.html"><img src="/images/next.gif" alt="Next"></a>
72</td></tr></table>
73<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
74</body>
75</html>
76