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: DbEnv::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>DbEnv::repmgr_start</b> 14</td> 15<td align=right> 16<a href="/api_cxx/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_cxx.h> 23<p> 24int 25DbEnv::repmgr_start(int nthreads, u_int32_t flags); 26</pre></b> 27<hr size=1 noshade> 28<b>Description: DbEnv::repmgr_start</b> 29<p>The DbEnv::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_cxx/repmgr_local_site.html">DbEnv::repmgr_set_local_site</a> to configure the local site in the 38replication group. 39<p><li>Call <a href="/api_cxx/repmgr_remote_site.html">DbEnv::repmgr_add_remote_site</a> to configure the remote site(s) in 40the replication group. 41<p><li>Call <a href="/api_cxx/repmgr_ack_policy.html">DbEnv::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_cxx/rep_priority.html">DbEnv::rep_set_priority</a> to configure the local site's election 45priority. 46<p><li>Call DbEnv::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 DbEnv::repmgr_start method may not be called before the <a href="/api_cxx/env_open.html">DbEnv::open</a> method is called.</p> 58<p>The DbEnv::repmgr_start method 59either returns a non-zero error value 60or throws an exception that encapsulates a non-zero error value on 61failure, and returns 0 on success. 62</p> 63<b>Parameters</b> <br> 64 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to one of the following values: 65<br> 66<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 67must never be more than a single master in any replication group, and 68only one site at a time should ever be started with the 69DB_REP_MASTER flag specified.</ul> 70<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> 71<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> 72<br></ul> 73 <b>nthreads</b><ul compact><li>Specify the number of threads of control created and dedicated to processing 74replication messages. In addition to these message processing threads, 75the replication manager creates and manages a few of its own threads of 76control.</ul> 77<br> 78<hr size=1 noshade> 79<br><b>Class</b> 80<a href="/api_cxx/env_class.html">DbEnv</a> 81<br><b>See Also</b> 82<a href="/api_cxx/rep_list.html">Replication and Related Methods</a> 83</tt> 84<table width="100%"><tr><td><br></td><td align=right> 85<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 86</td></tr></table> 87<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 88</body> 89</html> 90