DbEnv::repmgr_set_local_site()
Prev | Chapter 11. Replication Methods | Next

## DbEnv::repmgr_set_local_site()

    #include <db_cxx.h>

    int
    repmgr_set_local_site(const char * host, u_int16_t port, u_int32_t flags);

The `DbEnv::repmgr_set_local_site()` method specifies the host identification string and port number for the local system.

The `DbEnv::repmgr_set_local_site()` method may not be called after the DbEnv::repmgr_start() method is called.

The database environment's replication subsystem may also be configured using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "repmgr_set_local_site", one or more whitespace characters, and the host and port parameters specified as a string and an integer respectively. For example, "repmgr_set_local_site example.com 49200". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The `DbEnv::repmgr_set_local_site()` 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

#### host

The site's host identification string, generally a TCP/IP host name.

#### port

The port number on which the local site is listening.

#### flags

The flags parameter is currently unused, and must be set to 0.

### Errors

The `DbEnv::repmgr_set_local_site()` 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 this method is called from a Base API application; if the method was called after replication is started with a call to the DbEnv::repmgr_start() method; or if an invalid flag value or parameter was specified.

### Class

DbEnv

### See Also

Replication and Related Methods

Prev | Up | Next
DbEnv::repmgr_set_ack_policy() | Home | DbEnv::repmgr_site_list()