Mercurial > hg > nginx-site
comparison xml/en/docs/stream/ngx_stream_zone_sync_module.xml @ 2151:ed6b44206600
Clarified the "zone_sync_server" directive description.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Mon, 16 Apr 2018 14:19:35 +0300 |
parents | 5a31c6b83cbc |
children | 283b1e67eaa6 |
comparison
equal
deleted
inserted
replaced
2150:af5751930f95 | 2151:ed6b44206600 |
---|---|
12 rev="2"> | 12 rev="2"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 The <literal>ngx_stream_zone_sync_module</literal> module (1.13.10) | 17 The <literal>ngx_stream_zone_sync_module</literal> module (1.13.8) |
18 provides the necessary support for synchronizing contents of | 18 provides the necessary support for synchronizing contents of |
19 <link doc="ngx_stream_upstream_module.xml" id="zone">shared memory zones</link> | 19 <link doc="ngx_stream_upstream_module.xml" id="zone">shared memory zones</link> |
20 between nodes of a cluster. | 20 between nodes of a cluster. |
21 To enable synchronization for a particular zone, a corresponding module | 21 To enable synchronization for a particular zone, a corresponding module |
22 must support this feature. | 22 must support this feature. |
63 server { | 63 server { |
64 zone_sync; | 64 zone_sync; |
65 | 65 |
66 listen 127.0.0.1:8090; | 66 listen 127.0.0.1:8090; |
67 | 67 |
68 # cluster of 2 nodes: each name resolves to a single IP address | 68 # cluster of 2 nodes |
69 zone_sync_server a.example.com; | 69 zone_sync_server a.example.com; |
70 zone_sync_server b.example.com; | 70 zone_sync_server b.example.com; |
71 | 71 |
72 } | 72 } |
73 </example> | 73 </example> |
194 <syntax><value>address</value> [<literal>resolve</literal>]</syntax> | 194 <syntax><value>address</value> [<literal>resolve</literal>]</syntax> |
195 <default></default> | 195 <default></default> |
196 <context>server</context> | 196 <context>server</context> |
197 | 197 |
198 <para> | 198 <para> |
199 Defines the <value>address</value> of a cluster node | 199 Defines the <value>address</value> of a cluster node. |
200 and an optional method of resolving it. | |
201 The address can be specified as a domain name or IP address | 200 The address can be specified as a domain name or IP address |
202 with a mandatory port, or as a UNIX-domain socket path | 201 with a mandatory port, or as a UNIX-domain socket path |
203 specified after the “<literal>unix:</literal>” prefix. | 202 specified after the “<literal>unix:</literal>” prefix. |
204 A domain name that resolves to several IP addresses defines | 203 A domain name that resolves to several IP addresses defines |
205 multiple servers at once. | 204 multiple nodes at once. |
206 </para> | 205 </para> |
207 | 206 |
208 <para> | 207 <para> |
209 The "<literal>resolve</literal>" parameter makes nginx to | 208 The <literal>resolve</literal> parameter instructs nginx to monitor |
210 monitor changes of the IP addresses | 209 changes of the IP addresses that correspond to a domain name of the node |
211 that correspond to a domain name of the server | 210 and automatically modify the configuration |
212 and automatically modifies the configuration | |
213 without the need of restarting nginx. | 211 without the need of restarting nginx. |
214 </para> | 212 </para> |
215 | 213 |
216 <para> | 214 <para> |
217 In order for this parameter to work, | 215 Cluster nodes are specified either dynamically as a single |
216 <literal>zone_sync_server</literal> directive with | |
217 the <literal>resolve</literal> parameter, or statically as a series of several | |
218 directives without the parameter. | |
219 <note> | |
220 Each cluster node should be specified only once. | |
221 </note> | |
222 <note> | |
223 All cluster nodes should use the same configuration. | |
224 </note> | |
225 </para> | |
226 | |
227 <para> | |
228 In order for the <literal>resolve</literal> parameter to work, | |
218 the <link doc="ngx_stream_core_module.xml" id="resolver"/> directive | 229 the <link doc="ngx_stream_core_module.xml" id="resolver"/> directive |
219 must be specified in the | 230 must be specified in the |
220 <link doc="ngx_stream_core_module.xml" id="stream"/> block. | 231 <link doc="ngx_stream_core_module.xml" id="stream"/> block. |
221 Example: | 232 Example: |
222 <example> | 233 <example> |
223 stream { | 234 stream { |
224 resolver 10.0.0.1; | 235 resolver 10.0.0.1; |
225 | 236 |
226 server { | 237 server { |
227 zone_sync; | 238 zone_sync; |
239 zone_sync_server cluster.example.com resolve; | |
228 ... | 240 ... |
229 zone_sync_server example.com resolve; | |
230 } | 241 } |
231 } | 242 } |
232 </example> | 243 </example> |
233 </para> | |
234 | |
235 <para> | |
236 <note> | |
237 Each cluster node must be specified only once. | |
238 If using domain names, ensure they are resolvable to a single IP address. | |
239 </note> | |
240 <note> | |
241 The own address of a node is ignored, thus, there is no need to have different | |
242 configurations on different nodes. | |
243 </note> | |
244 </para> | 244 </para> |
245 | 245 |
246 </directive> | 246 </directive> |
247 | 247 |
248 | 248 |