1<!--$Id: repmgr_start.so,v 1.7 2007/09/21 20:06:04 bostic 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: DB_ENV->repmgr_start</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> 13<b>DB_ENV->repmgr_start</b> 14</td> 15<td align=right> 16<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a> 17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db.h> 23<p> 24int 25DB_ENV->repmgr_start(DB_ENV *env, int nthreads, u_int32_t flags); 26</pre></b> 27<hr size=1 noshade> 28<b>Description: DB_ENV->repmgr_start</b> 29<p>The DB_ENV->repmgr_start method starts the replication manager.</p> 30<p>There are two ways to build Berkeley DB replication applications: the most 31common approach is to use the Berkeley DB library "replication manager" 32support, where the Berkeley DB library manages the replication group, 33including network transport, all replication message processing and 34acknowledgment, and group elections. Applications using the replication 35manager support generally make the following calls:</p> 36<ol> 37<p><li>Call <a href="/api_c/repmgr_local_site.html">DB_ENV->repmgr_set_local_site</a> to configure the local site in the 38replication group. 39<p><li>Call <a href="/api_c/repmgr_remote_site.html">DB_ENV->repmgr_add_remote_site</a> to configure the remote site(s) in 40the replication group. 41<p><li>Call <a href="/api_c/repmgr_ack_policy.html">DB_ENV->repmgr_set_ack_policy</a> to configure the message 42acknowledgment policy which provides the replication group's 43transactional needs. 44<p><li>Call <a href="/api_c/rep_priority.html">DB_ENV->rep_set_priority</a> to configure the local site's election 45priority. 46<p><li>Call DB_ENV->repmgr_start to start the replication application. 47</ol> 48<p>For more information on building replication manager applications, 49please see the "Replication Manager Getting Started Guide" included in 50the Berkeley DB documentation.</p> 51<p>Applications with special needs (for example, applications using network 52protocols not supported by the Berkeley DB replication manager), must perform 53additional configuration and call other Berkeley DB replication methods. For 54more information on building advanced replication applications, please 55see the "Advanced Replication Applications Guide" included in the Berkeley DB 56documentation.</p> 57<p>The DB_ENV->repmgr_start method may not be called before the <a href="/api_c/env_open.html">DB_ENV->open</a> method is called.</p> 58<p>The DB_ENV->repmgr_start method 59returns a non-zero error value on failure 60and 0 on success. 61</p> 62<b>Parameters</b> <br> 63 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to one of the following values: 64<br> 65<b><a name="DB_REP_MASTER">DB_REP_MASTER</a></b><ul compact><li>Start as a master site, and do not call for an election. Note there 66must never be more than a single master in any replication group, and 67only one site at a time should ever be started with the 68DB_REP_MASTER flag specified.</ul> 69<b><a name="DB_REP_CLIENT">DB_REP_CLIENT</a></b><ul compact><li>Start as a client site, and do not call for an election.</ul> 70<b><a name="DB_REP_ELECTION">DB_REP_ELECTION</a></b><ul compact><li>Start as a client, and call for an election if no master is found.</ul> 71<br></ul> 72 <b>nthreads</b><ul compact><li>Specify the number of threads of control created and dedicated to processing 73replication messages. In addition to these message processing threads, 74the replication manager creates and manages a few of its own threads of 75control.</ul> 76<br> 77<hr size=1 noshade> 78<br><b>Class</b> 79<a href="/api_c/env_class.html">DB_ENV</a> 80<br><b>See Also</b> 81<a href="/api_c/rep_list.html">Replication and Related Methods</a> 82</tt> 83<table width="100%"><tr><td><br></td><td align=right> 84<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 85</td></tr></table> 86<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 87</body> 88</html> 89