### DbEnv::repmgr_start

`

###

    #include <db_cxx.h>

    int
    DbEnv::repmgr_start(int nthreads, u_int32_t flags);

### Description: DbEnv::repmgr_start

The DbEnv::repmgr_start method starts the replication manager.

There are two ways to build Berkeley DB replication applications: the most common approach is to use the Berkeley DB library "replication manager" support, where the Berkeley DB library manages the replication group, including network transport, all replication message processing and acknowledgment, and group elections. Applications using the replication manager support generally make the following calls:

1. Call DbEnv::repmgr_set_local_site to configure the local site in the replication group.

2. Call DbEnv::repmgr_add_remote_site to configure the remote site(s) in the replication group.

3. Call DbEnv::repmgr_set_ack_policy to configure the message acknowledgment policy which provides the replication group's transactional needs.

4. Call DbEnv::rep_set_priority to configure the local site's election priority.

5. Call DbEnv::repmgr_start to start the replication application.

For more information on building replication manager applications, please see the "Replication Manager Getting Started Guide" included in the Berkeley DB documentation.

Applications with special needs (for example, applications using network protocols not supported by the Berkeley DB replication manager), must perform additional configuration and call other Berkeley DB replication methods. For more information on building advanced replication applications, please see the "Advanced Replication Applications Guide" included in the Berkeley DB documentation.

The DbEnv::repmgr_start method may not be called before the DbEnv::open method has been called.

The DbEnv::repmgr_start method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

### Parameters

flags
  The flags parameter must be set to one of the following values:
  DB_REP_MASTER
    Start as a master site, and do not call for an election. Note there must never be more than a single master in any replication group, and only one site at a time should ever be started with the DB_REP_MASTER flag specified.
  DB_REP_CLIENT
    Start as a client site, and do not call for an election.
  DB_REP_ELECTION
    Start as a client, and call for an election if no master is found.
nthreads
  Specify the number of threads of control created and dedicated to processing replication messages. In addition to these message processing threads, the replication manager creates and manages a few of its own threads of control.

### Class

DbEnv

### See Also

Replication and Related Methods`

Copyright (c) 1996,2007 Oracle. All rights reserved.