Lines 147-153
Link Here
|
147 |
|
147 |
|
148 |
<note type="hint"><title>Hint</title> |
148 |
<note type="hint"><title>Hint</title> |
149 |
<p> |
149 |
<p> |
150 |
<em>BalancerMembers</em> are also sometimes referred to as <em>workers</em>. |
150 |
<em>BalancerMembers</em> are also sometimes referred to as <em>workers</em>. |
151 |
</p> |
151 |
</p> |
152 |
</note> |
152 |
</note> |
153 |
|
153 |
|
Lines 182-201
Link Here
|
182 |
<title>Failover</title> |
182 |
<title>Failover</title> |
183 |
|
183 |
|
184 |
<p> |
184 |
<p> |
185 |
You can also fine-tune various failover scenarios, detailing which |
185 |
You can also fine-tune various failover scenarios, detailing which workers |
186 |
workers and even which balancers should accessed in such cases. For |
186 |
and even which balancers should accessed in such cases. For example, the |
187 |
example, the below setup implements 2 failover cases: In the first, |
187 |
below setup implements three failover cases: |
188 |
<code>http://hstandby.example.com:8080</code> is only sent traffic |
188 |
</p> |
189 |
if all other workers in the <em>myset</em> balancer are not available. |
189 |
<ol> |
190 |
If that worker itself is not available, only then will the |
190 |
<li> |
191 |
<code>http://bkup1.example.com:8080</code> and <code>http://bkup2.example.com:8080</code> |
191 |
<code>http://spare1.example.com:8080</code> and |
192 |
workers be brought into rotation: |
192 |
<code>http://spare2.example.com:8080</code> are only sent traffic if one |
|
|
193 |
or both of <code>http://www2.example.com:8080</code> or |
194 |
<code>http://www3.example.com:8080</code> is unavailable. (One spare |
195 |
will be used to replace one unusable member of the same balancer set.) |
196 |
</li> |
197 |
<li> |
198 |
<code>http://hstandby.example.com:8080</code> is only sent traffic if |
199 |
all other workers in balancer set <code>0</code> are not available. |
200 |
</li> |
201 |
<li> |
202 |
If all load balancer set <code>0</code> workers, spares, and the standby |
203 |
are unavailable, only then will the |
204 |
<code>http://bkup1.example.com:8080</code> and |
205 |
<code>http://bkup2.example.com:8080</code> workers from balancer set |
206 |
<code>1</code> be brought into rotation. |
207 |
</li> |
208 |
</ol> |
209 |
<p> |
210 |
Thus, it is possible to have one or more hot spares and hot standbys for |
211 |
each load balancer set. |
193 |
</p> |
212 |
</p> |
194 |
|
213 |
|
195 |
<highlight language="config"> |
214 |
<highlight language="config"> |
196 |
<Proxy balancer://myset> |
215 |
<Proxy balancer://myset> |
197 |
BalancerMember http://www2.example.com:8080 |
216 |
BalancerMember http://www2.example.com:8080 |
198 |
BalancerMember http://www3.example.com:8080 loadfactor=3 timeout=1 |
217 |
BalancerMember http://www3.example.com:8080 loadfactor=3 timeout=1 |
|
|
218 |
BalancerMember http://spare1.example.com:8080 status=+R |
219 |
BalancerMember http://spare2.example.com:8080 status=+R |
199 |
BalancerMember http://hstandby.example.com:8080 status=+H |
220 |
BalancerMember http://hstandby.example.com:8080 status=+H |
200 |
BalancerMember http://bkup1.example.com:8080 lbset=1 |
221 |
BalancerMember http://bkup1.example.com:8080 lbset=1 |
201 |
BalancerMember http://bkup2.example.com:8080 lbset=1 |
222 |
BalancerMember http://bkup2.example.com:8080 lbset=1 |
Lines 207-217
Link Here
|
207 |
</highlight> |
228 |
</highlight> |
208 |
|
229 |
|
209 |
<p> |
230 |
<p> |
210 |
The magic of this failover setup is setting <code>http://hstandby.example.com:8080</code> |
231 |
For failover, hot spares are used as replacements for failed or unusable |
211 |
with the <code>+H</code> status flag, which puts it in <em>hot standby</em> mode, |
232 |
workers in the same load balancer set. Hot standbys are used if all |
212 |
and making the 2 <code>bkup#</code> servers part of the #1 load balancer set (the |
233 |
workers and spares in the load balancer set are unavailable. Load balancer |
213 |
default set is 0); for failover, hot standbys (if they exist) are used 1st, when all regular |
234 |
sets (with their respective hot spares and standbys) are always tried in |
214 |
workers are unavailable; load balancer sets with lowest number are always tried first. |
235 |
order from lowest to highest. |
215 |
</p> |
236 |
</p> |
216 |
|
237 |
|
217 |
</section> |
238 |
</section> |
Lines 221-234
Link Here
|
221 |
|
242 |
|
222 |
<p> |
243 |
<p> |
223 |
One of the most unique and useful features of Apache httpd's reverse proxy is |
244 |
One of the most unique and useful features of Apache httpd's reverse proxy is |
224 |
the embedded <em>balancer-manager</em> application. Similar to |
245 |
the embedded <em>balancer-manager</em> application. Similar to |
225 |
<module>mod_status</module>, <em>balancer-manager</em> displays |
246 |
<module>mod_status</module>, <em>balancer-manager</em> displays |
226 |
the current working configuration and status of the enabled |
247 |
the current working configuration and status of the enabled |
227 |
balancers and workers currently in use. However, not only does it |
248 |
balancers and workers currently in use. However, not only does it |
228 |
display these parameters, it also allows for dynamic, runtime, on-the-fly |
249 |
display these parameters, it also allows for dynamic, runtime, on-the-fly |
229 |
reconfiguration of almost all of them, including adding new <em>BalancerMembers</em> |
250 |
reconfiguration of almost all of them, including adding new <em>BalancerMembers</em> |
230 |
(workers) to an existing balancer. To enable these capability, the following |
251 |
(workers) to an existing balancer. To enable these capability, the following |
231 |
needs to be added to your configuration: |
252 |
needs to be added to your configuration: |
232 |
</p> |
253 |
</p> |
233 |
|
254 |
|
234 |
<highlight language="config"> |
255 |
<highlight language="config"> |
Lines 293-308
Link Here
|
293 |
is displayed and can be set/reset. The meanings of these statuses are as follows: |
314 |
is displayed and can be set/reset. The meanings of these statuses are as follows: |
294 |
</p> |
315 |
</p> |
295 |
<table border="1"> |
316 |
<table border="1"> |
296 |
<tr><th>Flag</th><th>String</th><th>Description</th></tr> |
317 |
<tr><th>Flag</th><th>String</th><th>Description</th></tr> |
297 |
<tr><td> </td><td><em>Ok</em></td><td>Worker is available</td></tr> |
318 |
<tr><td> </td><td><em>Ok</em></td><td>Worker is available</td></tr> |
298 |
<tr><td> </td><td><em>Init</em></td><td>Worker has been initialized</td></tr> |
319 |
<tr><td> </td><td><em>Init</em></td><td>Worker has been initialized</td></tr> |
299 |
<tr><td><code>D</code></td><td><em>Dis</em></td><td>Worker is disabled and will not accept any requests; will be |
320 |
<tr><td><code>D</code></td><td><em>Dis</em></td><td>Worker is disabled and will not accept any requests; will be |
300 |
automatically retried.</td></tr> |
321 |
automatically retried.</td></tr> |
301 |
<tr><td><code>S</code></td><td><em>Stop</em></td><td>Worker is administratively stopped; will not accept requests |
322 |
<tr><td><code>S</code></td><td><em>Stop</em></td><td>Worker is administratively stopped; will not accept requests |
302 |
and will not be automatically retried</td></tr> |
323 |
and will not be automatically retried</td></tr> |
303 |
<tr><td><code>I</code></td><td><em>Ign</em></td><td>Worker is in ignore-errors mode and will always be considered available.</td></tr> |
324 |
<tr><td><code>I</code></td><td><em>Ign</em></td><td>Worker is in ignore-errors mode and will always be considered available.</td></tr> |
|
|
325 |
<tr><td><code>R</code></td><td><em>Spar</em></td><td>Worker is a hot spare. For each worker in a given lbset that is unusable |
326 |
(disabled, stopped, in error, etc.), a usable hot spare with the same lbset will be used in |
327 |
its place. Hot spares can help ensure that a specific number of workers are always available |
328 |
for use by a balancer.</td></tr> |
304 |
<tr><td><code>H</code></td><td><em>Stby</em></td><td>Worker is in hot-standby mode and will only be used if no other |
329 |
<tr><td><code>H</code></td><td><em>Stby</em></td><td>Worker is in hot-standby mode and will only be used if no other |
305 |
viable workers are available.</td></tr> |
330 |
viable workers or spares are available in the balancer set.</td></tr> |
306 |
<tr><td><code>E</code></td><td><em>Err</em></td><td>Worker is in an error state, usually due to failing pre-request check; |
331 |
<tr><td><code>E</code></td><td><em>Err</em></td><td>Worker is in an error state, usually due to failing pre-request check; |
307 |
requests will not be proxied to this worker, but it will be retried depending on |
332 |
requests will not be proxied to this worker, but it will be retried depending on |
308 |
the <code>retry</code> setting of the worker.</td></tr> |
333 |
the <code>retry</code> setting of the worker.</td></tr> |