]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy_balancer.html.en
update transformations
[apache] / docs / manual / mod / mod_proxy_balancer.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_proxy_balancer - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.3</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_proxy_balancer</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_balancer.html" title="English">&nbsp;en&nbsp;</a> |
25 <a href="../ja/mod/mod_proxy_balancer.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
26 </div>
27 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td><code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> extension for load balancing </td></tr>
28 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
29 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_balancer_module</td></tr>
30 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy_balancer.c</td></tr>
31 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.1 and later</td></tr></table>
32 <h3>Summary</h3>
33
34     <p>This module <em>requires</em> the service of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>. It provides load balancing support for
35     <code>HTTP</code>, <code>FTP</code> and <code>AJP13</code> protocols
36     </p>
37
38     <p>Load balancing scheduler algorithm is provided by not this
39     module but other modules such as:
40     <code class="module"><a href="../mod/mod_lbmethod_byrequests.html">mod_lbmethod_byrequests</a></code>,
41     <code class="module"><a href="../mod/mod_lbmethod_bytraffic.html">mod_lbmethod_bytraffic</a></code> and
42     <code class="module"><a href="../mod/mod_lbmethod_bybusyness.html">mod_lbmethod_bybusyness</a></code>.
43     </p>
44
45     <p>Thus, in order to get the ability of load balancing,
46     <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>
47     and at least one of load balancing scheduler algorithm modules have
48     to be present in the server.</p>
49
50     <div class="warning"><h3>Warning</h3>
51       <p>Do not enable proxying until you have <a href="mod_proxy.html#access">secured your server</a>. Open proxy
52       servers are dangerous both to your network and to the Internet at
53       large.</p>
54     </div>
55 </div>
56 <div id="quickview"><h3 class="directives">Directives</h3>
57 <p>This module provides no
58             directives.</p>
59 <h3>Topics</h3>
60 <ul id="topics">
61 <li><img alt="" src="../images/down.gif" /> <a href="#scheduler">Load balancer scheduler algorithm</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#example">Example of a balancer configuration</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#environment">Exported Environment Variables</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#enable">Enabling Balancer Manager Support</a></li>
65 </ul><h3>See also</h3>
66 <ul class="seealso">
67 <li><code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code></li>
68 </ul></div>
69 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
70 <div class="section">
71 <h2><a name="scheduler" id="scheduler">Load balancer scheduler algorithm</a></h2>
72     
73     <p>At present, there are 3 load balancer scheduler algorithms available
74     for use: Request Counting, Weighted Traffic Counting and Pending Request 
75     Counting. These are controlled via the <code>lbmethod</code> value of
76     the Balancer definition. See the <code class="directive"><a href="../mod/mod_proxy.html#proxypass">ProxyPass</a></code> 
77     directive for more information.</p>
78
79 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
80 <div class="section">
81 <h2><a name="example" id="example">Example of a balancer configuration</a></h2>
82     
83     <p>Before we dive into the technical details, here's an example of
84     how you might use <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> to provide
85     load balancing between two back-end servers:
86     </p>
87
88     <div class="example"><p><code>
89     &lt;Proxy balancer://mycluster&gt;<br />
90         BalancerMember http://192.168.1.50:80<br />
91         BalancerMember http://192.168.1.51:80<br />
92     &lt;/Proxy&gt;<br />
93     ProxyPass /test balancer://mycluster/
94     </code></p></div>
95 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
96 <div class="section">
97 <h2><a name="environment" id="environment">Exported Environment Variables</a></h2>
98     
99     <p>At present there are 6 environment variables exported:</p>
100
101     <dl>
102     
103     <dt><var><a name="balancer_session_sticky" id="balancer_session_sticky">BALANCER_SESSION_STICKY</a></var></dt>
104     <dd>
105     <p>This is assigned the <var>stickysession</var> value used in the current
106     request.  It is the cookie or parameter name used for sticky sessions</p>
107     </dd>
108
109     
110     <dt><var><a name="balancer_session_route" id="balancer_session_route">BALANCER_SESSION_ROUTE</a></var></dt>
111     <dd>
112     <p>This is assigned the <var>route</var> parsed from the current 
113     request.</p>
114     </dd>
115
116     
117     <dt><var><a name="balancer_name" id="balancer_name">BALANCER_NAME</a></var></dt>
118     <dd>
119     <p>This is assigned the name of the balancer used for the current 
120     request. The value is something like <code>balancer://foo</code>.</p>
121     </dd>
122
123     
124     <dt><var><a name="balancer_worker_name" id="balancer_worker_name">BALANCER_WORKER_NAME</a></var></dt>
125     <dd>
126     <p>This is assigned the name of the worker used for the current request.
127     The value is something like <code>http://hostA:1234</code>.</p>
128     </dd>
129
130     
131     <dt><var><a name="balancer_worker_route" id="balancer_worker_route">BALANCER_WORKER_ROUTE</a></var></dt>
132     <dd>
133     <p>This is assigned the <var>route</var> of the worker that will be 
134     used for the current request.</p>
135     </dd>
136
137     
138     <dt><var><a name="balancer_route_changed" id="balancer_route_changed">BALANCER_ROUTE_CHANGED</a></var></dt>
139     <dd>
140     <p>This is set to 1 if the session route does not match the
141     worker route (BALANCER_SESSION_ROUTE != BALANCER_WORKER_ROUTE) or the
142     session does not yet have an established route.  This can be used to
143     determine when/if the client needs to be sent an updated route
144     when sticky sessions are used.</p>
145     </dd>
146     </dl>
147
148 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
149 <div class="section">
150 <h2><a name="enable" id="enable">Enabling Balancer Manager Support</a></h2>
151     
152     <p>This module <em>requires</em> the service of 
153     <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>.
154     Balancer manager enables dynamic update of balancer
155     members. You can use balancer manager to change the balance
156     factor or a particular member, or put it in the off line
157     mode.
158     </p>
159
160     <p>Thus, in order to get the ability of load balancer management,
161     <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> and <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>
162     have to be present in the server.</p>
163
164     <p>To enable load balancer management for browsers from the example.com
165     domain add this code to your <code>httpd.conf</code>
166     configuration file</p>
167 <div class="example"><p><code>
168     &lt;Location /balancer-manager&gt;<br />
169     SetHandler balancer-manager<br />
170 <br />
171     Order Deny,Allow<br />
172     Deny from all<br />
173     Allow from .example.com<br />
174     &lt;/Location&gt;
175 </code></p></div>
176
177     <p>You can now access load balancer manager by using a Web browser
178     to access the page
179     <code>http://your.server.name/balancer-manager</code></p>
180 </div>
181 </div>
182 <div class="bottomlang">
183 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_balancer.html" title="English">&nbsp;en&nbsp;</a> |
184 <a href="../ja/mod/mod_proxy_balancer.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
185 </div><div id="footer">
186 <p class="apache">Copyright 2008 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
187 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
188 </body></html>