Library Version 18.1.40

DbSite::set_config()
Prev | Chapter 11. Replication Methods | Next

## DbSite::set_config()

    #include <db_cxx.h>

    int
    DbSite::set_config(u_int32_t which, u_int32_t value);

The `DbSite::set_config()` method configures a Replication Manager site.

The `DbSite::set_config()` 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.

The Replication Manager site may also be configured using the environment's DB_CONFIG file. The syntax of the entry in that file is described in repmgr_site.

### Parameters

#### which

This parameter must be set to one of the following values:

- `DB_BOOTSTRAP_HELPER`

  Specifies that a remote site may be used as a "helper" when the local site is first joining the replication group. Once the local site has been established as a member of the group, this setting is ignored.

- `DB_GROUP_CREATOR`

  Specifies that this site should create the initial group membership database contents, defining a "group" of just the one site, rather than trying to join an existing group when it starts for the first time.

  This setting can only be used on the local site. It is ignored after the local site's initial startup and when configured for a remote site.

- `DB_LEGACY`

  Specifies that the site is already part of an existing group. This setting causes the site to be upgraded from a previous version of Berkeley DB. All sites in the legacy group must specify this setting for themselves (the local site) and for all other sites currently existing in the group. Once the upgrade has been completed, this setting is no longer required.

- `DB_LOCAL_SITE`

  Specifies that this site is the local site within the replication group. The application must identify exactly one site as the local site in this way, before calling the DbEnv::repmgr_start() method.

- `DB_REPMGR_PEER`

  Specifies that the site may be used as a target for "client-to-client" synchronization messages. A peer can be either a client or a view. This setting is ignored if it is specified for the local site.

#### value

If `0`, the parameter identified by the which is turned off. Otherwise, it is turned on.

### Errors

The `DbSite::set_config()` method may fail and throw a DbException exception, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

#### EINVAL

If an invalid flag value or parameter was specified.

### Class

DbSite

### See Also

Replication and Related Methods

Prev | Up | Next
DbSite::remove() | Home | DbEnv::rep_elect()