1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DB_ENV->repmgr_add_remote_site()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> 10 <link rel="up" href="rep.html" title="Chapter��10.�� Replication Methods" /> 11 <link rel="prev" href="repsync.html" title="DB_ENV->rep_sync()" /> 12 <link rel="next" href="repmgrget_ack_policy.html" title="DB_ENV->repmgr_get_ack_policy()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_ENV->repmgr_add_remote_site()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="repsync.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��10.�� 23 Replication Methods 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="repmgrget_ack_policy.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="repmgrremote_site"></a>DB_ENV->repmgr_add_remote_site()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_ENV->repmgr_add_remote_site(DB_ENV *env, 42 const char *host, u_int port, int *eidp, u_int32_t flags); </pre> 43 <p> 44 The <code class="methodname">DB_ENV->repmgr_add_remote_site()</code> method adds a new replication 45 site to the Replication Manager's list of known sites. It is not 46 necessary for all sites in a replication group to know about all other 47 sites in the group. 48 </p> 49 <p> 50 The <code class="methodname">DB_ENV->repmgr_add_remote_site()</code> method may be called at any time 51 during the life of the application. 52 </p> 53 <p> 54 The <code class="methodname">DB_ENV->repmgr_add_remote_site()</code> <span> 55 <span> 56 method returns a non-zero error value on failure and 0 on success. 57 </span> 58 59 </span> 60 </p> 61 <div class="sect2" lang="en" xml:lang="en"> 62 <div class="titlepage"> 63 <div> 64 <div> 65 <h3 class="title"><a id="id1702349"></a>Parameters</h3> 66 </div> 67 </div> 68 </div> 69 <div class="sect3" lang="en" xml:lang="en"> 70 <div class="titlepage"> 71 <div> 72 <div> 73 <h4 class="title"><a id="id1702416"></a>eidp</h4> 74 </div> 75 </div> 76 </div> 77 <p> 78 If <span class="bold"><strong>eidp</strong></span> is non-NULL, and the database 79 environment has already been opened by calling 80 <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a>, then the environment 81 ID assigned to the remote site is returned in the memory location 82 referenced by <span class="bold"><strong>eidp</strong></span>. 83 </p> 84 </div> 85 <div class="sect3" lang="en" xml:lang="en"> 86 <div class="titlepage"> 87 <div> 88 <div> 89 <h4 class="title"><a id="id1702404"></a>flags</h4> 90 </div> 91 </div> 92 </div> 93 <p> 94 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0 95 or by bitwise inclusively <span class="bold"><strong>OR</strong></span>'ing 96 together one or more of the following values: 97 </p> 98 <div class="itemizedlist"> 99 <ul type="disc"> 100 <li> 101 <p> 102 <code class="literal">DB_REPMGR_PEER</code> 103 </p> 104 <p> 105 Specifying the <code class="literal">DB_REPMGR_PEER</code> flag configures client-to-client 106 synchronization with the specified remote site. 107 </p> 108 <p> 109 Currently, the Replication Manager framework only supports a single 110 client peer, and the last specified peer is used. 111 </p> 112 </li> 113 </ul> 114 </div> 115 </div> 116 <div class="sect3" lang="en" xml:lang="en"> 117 <div class="titlepage"> 118 <div> 119 <div> 120 <h4 class="title"><a id="id1702757"></a>host</h4> 121 </div> 122 </div> 123 </div> 124 <p> 125 The site's host identification string, generally a TCP/IP host name. 126 </p> 127 </div> 128 <div class="sect3" lang="en" xml:lang="en"> 129 <div class="titlepage"> 130 <div> 131 <div> 132 <h4 class="title"><a id="id1702767"></a>port</h4> 133 </div> 134 </div> 135 </div> 136 <p> 137 The port number on which the remote site is receiving. 138 </p> 139 </div> 140 </div> 141 <div class="sect2" lang="en" xml:lang="en"> 142 <div class="titlepage"> 143 <div> 144 <div> 145 <h3 class="title"><a id="id1702304"></a>Errors</h3> 146 </div> 147 </div> 148 </div> 149 <p> 150 The <code class="methodname">DB_ENV->repmgr_add_remote_site()</code> 151 <span> 152 <span> 153 method may fail and return one of the following non-zero errors: 154 </span> 155 156 </span> 157 </p> 158 <div class="sect3" lang="en" xml:lang="en"> 159 <div class="titlepage"> 160 <div> 161 <div> 162 <h4 class="title"><a id="id1702677"></a>EINVAL</h4> 163 </div> 164 </div> 165 </div> 166 <p> 167 If this method is called from a base replication API 168 application; or if an invalid flag value or parameter was 169 specified. 170 </p> 171 </div> 172 </div> 173 <div class="sect2" lang="en" xml:lang="en"> 174 <div class="titlepage"> 175 <div> 176 <div> 177 <h3 class="title"><a id="id1702678"></a>Class</h3> 178 </div> 179 </div> 180 </div> 181 <p> 182 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 183 </p> 184 </div> 185 <div class="sect2" lang="en" xml:lang="en"> 186 <div class="titlepage"> 187 <div> 188 <div> 189 <h3 class="title"><a id="id1702351"></a>See Also</h3> 190 </div> 191 </div> 192 </div> 193 <p> 194 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 195 </p> 196 </div> 197 </div> 198 <div class="navfooter"> 199 <hr /> 200 <table width="100%" summary="Navigation footer"> 201 <tr> 202 <td width="40%" align="left"><a accesskey="p" href="repsync.html">Prev</a>��</td> 203 <td width="20%" align="center"> 204 <a accesskey="u" href="rep.html">Up</a> 205 </td> 206 <td width="40%" align="right">��<a accesskey="n" href="repmgrget_ack_policy.html">Next</a></td> 207 </tr> 208 <tr> 209 <td width="40%" align="left" valign="top">DB_ENV->rep_sync()��</td> 210 <td width="20%" align="center"> 211 <a accesskey="h" href="index.html">Home</a> 212 </td> 213 <td width="40%" align="right" valign="top">��DB_ENV->repmgr_get_ack_policy()</td> 214 </tr> 215 </table> 216 </div> 217 </body> 218</html> 219