http://wiki3.caucho.com/index.php?title=Two_Cluster_Load_Balancing&feed=atom&action=historyTwo Cluster Load Balancing - Revision history2024-03-29T10:36:47ZRevision history for this page on the wikiMediaWiki 1.18.0http://wiki3.caucho.com/index.php?title=Two_Cluster_Load_Balancing&diff=4066&oldid=prevPcowan: Cookbook: Two Cluster Load Balancing moved to Two Cluster Load Balancing2011-10-21T17:35:18Z<p><a href="/Cookbook:_Two_Cluster_Load_Balancing" class="mw-redirect" title="Cookbook: Two Cluster Load Balancing">Cookbook: Two Cluster Load Balancing</a> moved to <a href="/Two_Cluster_Load_Balancing" title="Two Cluster Load Balancing">Two Cluster Load Balancing</a></p>
<table class='diff diff-contentalign-left'>
<tr valign='top'>
<td colspan='1' style="background-color: white; color:black;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black;">Revision as of 17:35, 21 October 2011</td>
</tr></table>Pcowanhttp://wiki3.caucho.com/index.php?title=Two_Cluster_Load_Balancing&diff=3863&oldid=prevFerg: New page: Category: Cookbook Some sites with multiple virtual hosts may want to load balance to two separate backend clusters. For example, a www.foo.com might have 3 servers in its backend clu...2010-10-18T00:10:51Z<p>New page: <a href="/Category:Cookbook" title="Category:Cookbook">Category: Cookbook</a> Some sites with multiple virtual hosts may want to load balance to two separate backend clusters. For example, a www.foo.com might have 3 servers in its backend clu...</p>
<p><b>New page</b></p><div>[[Category: Cookbook]]<br />
<br />
Some sites with multiple virtual hosts may want to load balance to two separate backend clusters. For example, a www.foo.com might have 3 servers in its backend cluster and www.bar.com might only have 1 server in its backend cluster. Because Resin's <resin:LoadBalance> tag is flexible, you can use it to split the traffic as your site needs.<br />
<br />
== resin.xml for www.foo.com and www.bar.com ==<br />
<br />
This configuration has 5 servers in three separate clusters defined in a single resin.xml file. Although you can split the configuration into multiple files using <resin:import>, the basic single-file configuration is designed so you can review the entire system at once, instead of managing lots of configuration files.<br />
<br />
Features:<br />
<br />
* HTTP load balancing on port 80 of server 192.168.1.10 (the web-tier)<br />
* www.foo.com handled by 3 servers: 192.168.2.10, 192.168.2.11, 192.168.2.12<br />
* www.bar.com handled by 1 server: 192.168.3.10<br />
* proxy-cache enabled on the web-tier, improving performance for all servers<br />
* the web-tier server runs as "resin" user for security<br />
<br />
=== resin.xml ===<br />
<br />
<resin xmlns="http://caucho.com/ns/resin"><br />
xmlns:resin="urn:java:com.caucho.resin"><br />
<br />
<cluster-default><br />
<resin:import path="${__DIR__}/app-default.xml"/><br />
</cluster-default><br />
<br />
<cluster id="web-tier"><br />
<br />
<server id="http-a" address="192.168.1.10" port="6800"><br />
<http port="80"/><br />
<user-name>resin</user-name><br />
<group-name>resin</group-name><br />
</server><br />
<br />
<proxy-cache/><br />
<br />
<host id="www.foo.com"><br />
<web-app id="/"><br />
<resin:LoadBalance regexp="^" cluster="foo-tier"/><br />
</web-app><br />
</host><br />
<br />
<host id="www.bar.com"><br />
<web-app id="/"><br />
<resin:LoadBalance regexp="^" cluster="bar-tier"/><br />
</web-app><br />
</host><br />
</cluster><br />
<br />
<cluster id="foo-tier"><br />
<server id="foo-a" address="192.168.2.10" port="6800"/><br />
<server id="foo-b" address="192.168.2.11" port="6800"/><br />
<server id="foo-c" address="192.168.2.12" port="6800"/><br />
<br />
<host id="/" root-directory="/var/www/www.foo.com"><br />
<web-app-deploy path="webapps"/><br />
</host><br />
</cluster><br />
<br />
<br />
<cluster id="bar-tier"><br />
<server id="bar-a" address="192.168.3.10" port="6800"/><br />
<br />
<host id="/" root-directory="/var/www/www.bar.com"><br />
<web-app-deploy path="webapps"/><br />
</host><br />
</cluster><br />
</resin></div>Ferg