<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>egloo &#187; Clusters</title>
	<atom:link href="http://egloo.wordpress.com/tag/clusters/feed/" rel="self" type="application/rss+xml" />
	<link>http://egloo.wordpress.com</link>
	<description>Linux Sysadmin Blog</description>
	<lastBuildDate>Sat, 18 Apr 2009 19:35:52 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='egloo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/4f738d3a8dae6c0af9ecb7fb5c48f4a5?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>egloo &#187; Clusters</title>
		<link>http://egloo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://egloo.wordpress.com/osd.xml" title="egloo" />
		<item>
		<title>HTTP Load Balancing</title>
		<link>http://egloo.wordpress.com/2008/08/02/http-load-balanding/</link>
		<comments>http://egloo.wordpress.com/2008/08/02/http-load-balanding/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 20:30:34 +0000</pubDate>
		<dc:creator>pcabrerat</dc:creator>
				<category><![CDATA[Clusters]]></category>

		<guid isPermaLink="false">http://egloo.wordpress.com/?p=42</guid>
		<description><![CDATA[The following information is issued as a simple and basic tutorial of how to implement a load balancing system.
Load balancing is a technique to spread work between two or more computers, network links, CPUs, hard drives, or other resources, in order to get optimal resource utilization, throughput, or response time. &#8211; Wikipedia.
With load balancing we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=egloo.wordpress.com&blog=4102430&post=42&subd=egloo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignleft" src="http://www.theslimcompany.co.uk/blog/wp-content/uploads/2008/05/energy-balance.jpg" alt="" width="192" height="210" />The following information is issued as a simple and basic tutorial of how to implement a load balancing system.</p>
<p><em>Load balancing is a technique to spread work between two or more computers, network links, CPUs, hard drives, or other resources, in order to get optimal resource utilization, throughput, or response time. &#8211; </em>Wikipedia.</p>
<p>With load balancing we can get the power of a high availability cluster using cheap machines. Also it is easier to scale the systems horizontally and just add more servers as our needs increase.</p>
<p>Of course there exists hardware solutions specifically designed to take care of load balancing. <em>Citrix </em>and <em>F5 </em>being the most popular among datacenters but this are expensive and mostly targeted at the enterprise market, not the home user.</p>
<p>Fortunately Linux provides us with a powerful tool to develop load balancing: IPVS (Internet Protocol Virtual Server).</p>
<p>The procedure for the set up is fairly easy. First you need to define the machine that us gonna act as the main server and &#8220;father&#8221; of the cluster. Ideally this machine has to be one with post processing capabilities.</p>
<p>By default Linux comes with IPVS pre-installed, but in the case you don&#8217;t have it, just yum or apt-get it.</p>
<p>In this example we are going to set up a cluster with 4 machines:</p>
<p><strong>Main cluster server: 10.50.51.52<br />
cluster member A: 10.51.51.10<br />
</strong><strong>cluster member</strong><strong> B: 10.51.51.20<br />
</strong><strong>cluster member</strong><strong> C: 10.51.51.30<br />
</strong><strong>cluster member</strong><strong> D: 10.51.51.40</strong></p>
<p>Open a terminal on the machine that has installed IPVS (10.50.51.52) and create the virtual host and assing the child machines as follows:</p>
<p><code>$ ipvsadm -A -t 10.50.51.52:http -s rr -p5200</code><br />
<code>$ ipvsadm -a -t 10.50.51.52:http -r 10.51.51.10:http -m</code><br />
<code>$ ipvsadm -a -t 10.50.51.52:http -r 10.51.51.20:http -m</code><br />
<code>$ ipvsadm -a -t 10.50.51.52:http -r 10.51.51.30:http -m</code><br />
<code>$ ipvsadm -a -t 10.50.51.52:http -r 10.51.51.40:http -m</code></p>
<p>A little explanation of the used parameters:</p>
<p><strong>t </strong>- Use TCP protocol pointing to the IP address of the server on the specified port.<br />
<strong>s</strong> &#8211; Use allocation of TCP and UDP connections.<br />
<strong>rr</strong> &#8211; use rr-type balancing Robin Robin (distributes the burden equally in all servers).<br />
<strong>p</strong> &#8211; Specify the persistence of TCP connections. If empty, 300 is assigned by default.<br />
<strong>A </strong>- Registers a new virtual service. This is the main server.</p>
<p>Thats it, we have a fully functional mini cluster on port 80 (http).</p>
<p>But what if someday, one of your machines burns out. Don&#8217;t let the panic attacks you.</p>
<p>To delete a &#8220;child&#8221; machine just issue your godlike root powers and type the following command:</p>
<p><code>$ ipvsadm -d -t 10.50.51.52:http</code></p>
<p>Or if you want to completely remove the whole clustering, then type the following command:</p>
<p><code>ipvsadm -D -t 10.50.51.52:http</code></p>
<p>The <strong>d </strong>deletes the specified server, and <strong>D</strong> deletes the cluster and all related servers it may have assigned.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/egloo.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/egloo.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/egloo.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/egloo.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/egloo.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/egloo.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/egloo.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/egloo.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/egloo.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/egloo.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/egloo.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/egloo.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=egloo.wordpress.com&blog=4102430&post=42&subd=egloo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://egloo.wordpress.com/2008/08/02/http-load-balanding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pcabrerat</media:title>
		</media:content>

		<media:content url="http://www.theslimcompany.co.uk/blog/wp-content/uploads/2008/05/energy-balance.jpg" medium="image" />
	</item>
	</channel>
</rss>