| 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_SITE->set_config()</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="dbsite_remove.html" title="DB_SITE->remove()" /> |
| 12 | <link rel="next" href="repelect.html" title="DB_ENV->rep_elect()" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">DB_SITE->set_config()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="dbsite_remove.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 10. |
| 26 | Replication Methods |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="repelect.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="dbsite_set_config"></a>DB_SITE->set_config()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int |
| 44 | DB_SITE->set_config(DB_SITE *site, u_int32_t which, u_int32_t value); </pre> |
| 45 | <p> |
| 46 | The <code class="methodname">DB_SITE->set_config()</code> method configures |
| 47 | a Replication Manager site. |
| 48 | </p> |
| 49 | <p> |
| 50 | The <code class="methodname">DB_SITE->set_config()</code> <span> |
| 51 | <span> |
| 52 | method returns a non-zero error value on failure and 0 on success. |
| 53 | </span> |
| 54 | |
| 55 | </span> |
| 56 | </p> |
| 57 | <p> |
| 58 | The Replication Manager site may also be configured using the |
| 59 | environment's DB_CONFIG file. The syntax of the entry in that file |
| 60 | is described in |
| 61 | <a class="xref" href="repmgr_site_parameter.html" title="repmgr_site">repmgr_site</a>. |
| 62 | </p> |
| 63 | <div class="sect2" lang="en" xml:lang="en"> |
| 64 | <div class="titlepage"> |
| 65 | <div> |
| 66 | <div> |
| 67 | <h3 class="title"><a id="idp53946872"></a>Parameters</h3> |
| 68 | </div> |
| 69 | </div> |
| 70 | </div> |
| 71 | <div class="sect3" lang="en" xml:lang="en"> |
| 72 | <div class="titlepage"> |
| 73 | <div> |
| 74 | <div> |
| 75 | <h4 class="title"><a id="idp53947064"></a>which</h4> |
| 76 | </div> |
| 77 | </div> |
| 78 | </div> |
| 79 | <p> |
| 80 | This parameter must be set to one of the following |
| 81 | values: |
| 82 | </p> |
| 83 | <div class="itemizedlist"> |
| 84 | <ul type="disc"> |
| 85 | <li> |
| 86 | <p><a id="DB_BOOTSTRAP_HELPER"></a> |
| 87 | <code class="literal">DB_BOOTSTRAP_HELPER</code> |
| 88 | </p> |
| 89 | <p> |
| 90 | Specifies that a remote site may be used as a |
| 91 | "helper" when the local site is first joining the |
| 92 | replication group. Once the local site has been |
| 93 | established as a member of the group, this |
| 94 | setting is ignored. |
| 95 | </p> |
| 96 | </li> |
| 97 | <li> |
| 98 | <p><a id="DB_GROUP_CREATOR"></a> |
| 99 | <code class="literal">DB_GROUP_CREATOR</code> |
| 100 | </p> |
| 101 | <p> |
| 102 | Specifies that this site should create the |
| 103 | initial membership database contents, defining a |
| 104 | "group" of just the one site, rather than trying to |
| 105 | join an existing group when it starts for the first |
| 106 | time. |
| 107 | </p> |
| 108 | <p> |
| 109 | This setting can only be used on the local site and |
| 110 | is ignored when configured for a remote site. |
| 111 | </p> |
| 112 | </li> |
| 113 | <li> |
| 114 | <p><a id="DB_LEGACY"></a> |
| 115 | <code class="literal">DB_LEGACY</code> |
| 116 | </p> |
| 117 | <p> |
| 118 | Specifies that the site is already part of an |
| 119 | existing group. This setting causes the site to be |
| 120 | upgraded from a previous version of BDB. All sites |
| 121 | in the legacy group must specify this setting for |
| 122 | themselves (the local site) and for all other sites |
| 123 | currently existing in the group. Once the upgrade |
| 124 | has been completed, this setting is no longer |
| 125 | required. |
| 126 | </p> |
| 127 | </li> |
| 128 | <li> |
| 129 | <p><a id="DB_LOCAL_SITE"></a> |
| 130 | <code class="literal">DB_LOCAL_SITE</code> |
| 131 | </p> |
| 132 | <p> |
| 133 | Specifies that this site is the local site within |
| 134 | the replication group. The application must |
| 135 | identify exactly one site as the local site in this |
| 136 | way, before calling the |
| 137 | <a class="xref" href="repmgrstart.html" title="DB_ENV->repmgr_start()">DB_ENV->repmgr_start()</a> |
| 138 | method. |
| 139 | </p> |
| 140 | </li> |
| 141 | <li> |
| 142 | <p><a id="DB_REPMGR_PEER"></a> |
| 143 | <code class="literal">DB_REPMGR_PEER</code> |
| 144 | </p> |
| 145 | <p> |
| 146 | Specifies that the site may be used as a target for |
| 147 | "client-to-client" synchronization messages. This |
| 148 | setting is ignored if it is specified for the local |
| 149 | site. |
| 150 | </p> |
| 151 | </li> |
| 152 | </ul> |
| 153 | </div> |
| 154 | </div> |
| 155 | <div class="sect3" lang="en" xml:lang="en"> |
| 156 | <div class="titlepage"> |
| 157 | <div> |
| 158 | <div> |
| 159 | <h4 class="title"><a id="idp53953448"></a>value</h4> |
| 160 | </div> |
| 161 | </div> |
| 162 | </div> |
| 163 | <p> |
| 164 | If <code class="literal">0</code>, the parameter identified by the <span class="bold"><strong>which</strong></span> is turned off. Otherwise, |
| 165 | it is turned on. |
| 166 | </p> |
| 167 | </div> |
| 168 | </div> |
| 169 | <div class="sect2" lang="en" xml:lang="en"> |
| 170 | <div class="titlepage"> |
| 171 | <div> |
| 172 | <div> |
| 173 | <h3 class="title"><a id="idp53954528"></a>Errors</h3> |
| 174 | </div> |
| 175 | </div> |
| 176 | </div> |
| 177 | <p> |
| 178 | The <code class="methodname">DB_SITE->set_config()</code> <span> |
| 179 | <span> |
| 180 | method may fail and return one of the following non-zero errors: |
| 181 | </span> |
| 182 | |
| 183 | </span> |
| 184 | </p> |
| 185 | <div class="sect3" lang="en" xml:lang="en"> |
| 186 | <div class="titlepage"> |
| 187 | <div> |
| 188 | <div> |
| 189 | <h4 class="title"><a id="idp53948200"></a>EINVAL</h4> |
| 190 | </div> |
| 191 | </div> |
| 192 | </div> |
| 193 | <p> |
| 194 | If an invalid flag value or parameter was specified. |
| 195 | </p> |
| 196 | </div> |
| 197 | </div> |
| 198 | <div class="sect2" lang="en" xml:lang="en"> |
| 199 | <div class="titlepage"> |
| 200 | <div> |
| 201 | <div> |
| 202 | <h3 class="title"><a id="idp53952952"></a>Class</h3> |
| 203 | </div> |
| 204 | </div> |
| 205 | </div> |
| 206 | <p> |
| 207 | <a class="link" href="db_site.html" title="The DB_SITE Handle">DB_SITE</a> |
| 208 | </p> |
| 209 | </div> |
| 210 | <div class="sect2" lang="en" xml:lang="en"> |
| 211 | <div class="titlepage"> |
| 212 | <div> |
| 213 | <div> |
| 214 | <h3 class="title"><a id="idp53954992"></a>See Also</h3> |
| 215 | </div> |
| 216 | </div> |
| 217 | </div> |
| 218 | <p> |
| 219 | <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> |
| 220 | </p> |
| 221 | </div> |
| 222 | </div> |
| 223 | <div class="navfooter"> |
| 224 | <hr /> |
| 225 | <table width="100%" summary="Navigation footer"> |
| 226 | <tr> |
| 227 | <td width="40%" align="left"><a accesskey="p" href="dbsite_remove.html">Prev</a> </td> |
| 228 | <td width="20%" align="center"> |
| 229 | <a accesskey="u" href="rep.html">Up</a> |
| 230 | </td> |
| 231 | <td width="40%" align="right"> <a accesskey="n" href="repelect.html">Next</a></td> |
| 232 | </tr> |
| 233 | <tr> |
| 234 | <td width="40%" align="left" valign="top">DB_SITE->remove() </td> |
| 235 | <td width="20%" align="center"> |
| 236 | <a accesskey="h" href="index.html">Home</a> |
| 237 | </td> |
| 238 | <td width="40%" align="right" valign="top"> DB_ENV->rep_elect()</td> |
| 239 | </tr> |
| 240 | </table> |
| 241 | </div> |
| 242 | </body> |
| 243 | </html> |