<?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/"
	>

<channel>
	<title>Everlinux's Blog &#187; High Availability</title>
	<atom:link href="http://everlinux.com/blog/category/high-availability/feed" rel="self" type="application/rss+xml" />
	<link>http://everlinux.com/blog</link>
	<description>Sempre vivendo, aprendendo e blogando... :)</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:13:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Balanceamento de carga com Apache e Nginx</title>
		<link>http://everlinux.com/blog/2010/01/19/balanceamento-de-carga-com-apache-e-nginx</link>
		<comments>http://everlinux.com/blog/2010/01/19/balanceamento-de-carga-com-apache-e-nginx#comments</comments>
		<pubDate>Tue, 19 Jan 2010 17:00:29 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Dicas]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nerd]]></category>

		<guid isPermaLink="false">http://everlinux.com/blog/?p=1026</guid>
		<description><![CDATA[Se você precisa balancear a carga em seu webserver e não tem (ou não pode usar) um hardware dedicado para isso, segue alguns exemplos práticos: Apache httpd: NameVirtualhost *:80 &#60;VirtualHost *:80&#62; ServerName everlinux-homolog.com ServerAlias 200.24.12.34 10.10.23.53 10.10.23.56 ServerAdmin suporte@everlinux.com ErrorLog &#34;&#124;/usr/sbin/rotatelogs /var/log/httpd/error_log.%Y%m%d 86400 -180&#34; CustomLog &#34;&#124;/usr/sbin/rotatelogs /var/log/httpd/access_log.%Y%m%d 86400 -180&#34; combined &#160; &#60;Proxy balancer://everhttp&#62; BalancerMember http://10.10.23.53:80/ [...]]]></description>
			<content:encoded><![CDATA[<p>Se você precisa balancear a carga em seu webserver e não tem (ou não pode usar) um hardware dedicado para isso, segue alguns exemplos práticos:</p>
<p><strong>Apache httpd:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">NameVirtualhost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    ServerName everlinux-homolog.com
    ServerAlias 200.24.12.34 10.10.23.53 10.10.23.56
    ServerAdmin suporte<span style="color: #000000; font-weight: bold;">@</span>everlinux.com
    ErrorLog <span style="color: #ff0000;">&quot;|/usr/sbin/rotatelogs /var/log/httpd/error_log.%Y%m%d 86400 -180&quot;</span>
    CustomLog <span style="color: #ff0000;">&quot;|/usr/sbin/rotatelogs /var/log/httpd/access_log.%Y%m%d 86400 -180&quot;</span> combined
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;</span>Proxy balancer:<span style="color: #000000; font-weight: bold;">//</span>everhttp<span style="color: #000000; font-weight: bold;">&gt;</span>
          BalancerMember http:<span style="color: #000000; font-weight: bold;">//</span>10.10.23.53:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">ping</span></span>=<span style="color: #000000;">10</span>
          BalancerMember http:<span style="color: #000000; font-weight: bold;">//</span>10.10.23.56:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">ping</span></span>=<span style="color: #000000;">10</span>
        <span style="color: #000000; font-weight: bold;">&lt;/</span>Proxy<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
ProxyPreserveHost on
ProxyPass <span style="color: #000000; font-weight: bold;">/</span> balancer:<span style="color: #000000; font-weight: bold;">//</span>everhttp<span style="color: #000000; font-weight: bold;">/</span>
ProxyPassReverse <span style="color: #000000; font-weight: bold;">/</span>oii balancer:<span style="color: #000000; font-weight: bold;">//</span>everhttp<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p><strong>Nginx</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">http <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    include       mime.types;
    default_type  application<span style="color: #000000; font-weight: bold;">/</span>octet-stream;
    sendfile        on;
    keepalive_timeout  <span style="color: #000000;">50</span>;
&nbsp;
      upstream everbalance <span style="color: #7a0874; font-weight: bold;">&#123;</span>
         ip_hash;
         server 10.10.23.53 <span style="color: #007800;">max_fails</span>=<span style="color: #000000;">3</span> <span style="color: #007800;">fail_timeout</span>=30s;
         server 10.10.23.56 <span style="color: #007800;">max_fails</span>=<span style="color: #000000;">3</span> <span style="color: #007800;">fail_timeout</span>=30s;
         <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
    server <span style="color: #7a0874; font-weight: bold;">&#123;</span>
         listen  202.34.52.24:<span style="color: #000000;">80</span>;
         server_name  everlinux-homolog.com;
         location <span style="color: #000000; font-weight: bold;">/</span>
           <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            access_log   <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>hdig.log;
            proxy_pass   http:<span style="color: #000000; font-weight: bold;">//</span>everbalance;
            proxy_set_header Host <span style="color: #007800;">$host</span>;
           <span style="color: #7a0874; font-weight: bold;">&#125;</span>
         <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>As linhas &#8220;ProxyPreserveHost on&#8221; (apache) e &#8220;proxy_set_header Host $host;&#8221; (nginx) são importantes caso sua aplicação trabalhe com o nome do domínio da URL para montar alguma coisa dinamicamente. Conteúdo estático geralmente não é necessário estas variáveis.</p>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2010/01/19/balanceamento-de-carga-com-apache-e-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como aumentar seu cluster online (ESX+GFS)</title>
		<link>http://everlinux.com/blog/2009/01/22/como-aumentar-seu-cluster-online-esxgfs</link>
		<comments>http://everlinux.com/blog/2009/01/22/como-aumentar-seu-cluster-online-esxgfs#comments</comments>
		<pubDate>Thu, 22 Jan 2009 22:28:19 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Dicas]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Virtualização]]></category>
		<category><![CDATA[GFS]]></category>
		<category><![CDATA[LVM]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/?p=219</guid>
		<description><![CDATA[Neste exemplo eu tenho um cluster em produção com a LUN compartilhada de 500 GB via GFS. Pretendo dobrar sua capacidade sem parada no sistema. 1-) Adicionar um &#8220;Mapped Raw LUN&#8221; no ESX, em Compatibility Mode &#8220;Physical&#8221;. A &#8220;SCSI Controller&#8221; também precisa ser &#8220;Physical&#8221;, e o disco RAW precisa estar nesta controller dedicada Ex: Hard [...]]]></description>
			<content:encoded><![CDATA[<p>Neste exemplo eu tenho um cluster em produção com a LUN compartilhada de 500 GB via GFS. Pretendo dobrar sua capacidade sem parada no sistema.</p>
<p><strong>1-)</strong> Adicionar um &#8220;Mapped Raw LUN&#8221; no ESX, em Compatibility Mode &#8220;Physical&#8221;.<br />
A &#8220;SCSI Controller&#8221; também precisa ser &#8220;Physical&#8221;, e o disco RAW precisa estar nesta controller dedicada</p>
<p>Ex:<br />
Hard Disk 1 = SCSI Controller 0 = SCSI (0:0)<br />
Hard Disk 2 = SCSI Controller 1 = SCSI (1:0)<br />
Hard Disk 2 = SCSI Controller 1 = SCSI (1:1)</p>
<p><strong>2-) </strong>Adicionar a LUN no Linux:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-02 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cat /proc/scsi/scsi </span>
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: <span style="color: #000000;">1.0</span> 
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: <span style="color: #000000;">1815</span>      FAStT  Rev: 0914
  Type:   Direct-Access                    ANSI SCSI revision: 05
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-02 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># echo &quot;scsi add-single-device 1 0 1 0&quot; &gt; /proc/scsi/scsi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-02 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cat /proc/scsi/scsi </span>
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: <span style="color: #000000;">1.0</span> 
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM      Model: <span style="color: #000000;">1815</span>      FAStT  Rev: 0914
  Type:   Direct-Access                    ANSI SCSI revision: 05
Host: scsi1 Channel: 00 Id: 01 Lun: 00
  Vendor: IBM      Model: <span style="color: #000000;">1815</span>      FAStT  Rev: 0914
  Type:   Direct-Access                    ANSI SCSI revision: 05</pre></div></div>

<p>Sendo: Host &#8211; Channel &#8211; ID &#8211; Lun<br />
(um reboot também funcionaria <img src='http://everlinux.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<p><strong>3-)</strong> Configurar o Cluster de LVM</p>
<p>3a-) Criando um Logical Volume</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># fdisk /dev/sdc (usar ID 8e = Linux LVM)</span>
<span style="color: #666666; font-style: italic;"># partprobe (em todas as maquinas do cluster)</span>
<span style="color: #666666; font-style: italic;"># lvmconf --enable-cluster</span>
<span style="color: #666666; font-style: italic;"># pvcreate /dev/sdb1</span>
<span style="color: #666666; font-style: italic;"># vgcreate -Ay -cy pre_homolog /dev/sdb1</span>
<span style="color: #666666; font-style: italic;"># lvcreate -L 499G -n hotsites pre_homolog</span></pre></div></div>

<p>ou</p>
<p>3b-) Aumentando um já existente</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># pvs</span>
  PV         VG          Fmt  Attr PSize   PFree
  <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1  pre_homolog lvm2 a-   499.99G 1016.00M
  <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdc1              lvm2 <span style="color: #660033;">--</span>   499.99G  499.99G
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># vgextend pre_homolog /dev/sdc1</span>
  Volume group <span style="color: #ff0000;">&quot;pre_homolog&quot;</span> successfully extended
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># vgs</span>
  VG          <span style="color: #666666; font-style: italic;">#PV #LV #SN Attr   VSize   VFree  </span>
  pre_homolog   <span style="color: #000000;">2</span>   <span style="color: #000000;">1</span>   <span style="color: #000000;">0</span> wz--nc 999.98G 500.98G
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># pvs</span>
  PV         VG          Fmt  Attr PSize   PFree
  <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1  pre_homolog lvm2 a-   499.99G 1016.00M
  <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdc1  pre_homolog lvm2 a-   499.99G  499.99G
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># lvextend -Ay -l+128252 /dev/pre_homolog/hotsites</span>
  Extending logical volume hotsites to <span style="color: #000000;">999.98</span> GB
  Logical volume hotsites successfully resized
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># lvs</span>
  LV       VG          Attr   LSize   Origin Snap<span style="color: #000000; font-weight: bold;">%</span>  Move Log Copy<span style="color: #000000; font-weight: bold;">%</span>  Convert
  hotsites pre_homolog <span style="color: #660033;">-wi-ao</span> 999.98G
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># vgs</span>
  VG          <span style="color: #666666; font-style: italic;">#PV #LV #SN Attr   VSize   VFree</span>
  pre_homolog   <span style="color: #000000;">2</span>   <span style="color: #000000;">1</span>   <span style="color: #000000;">0</span> wz--nc 999.98G    <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># pvs</span>
  PV         VG          Fmt  Attr PSize   PFree
  <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1  pre_homolog lvm2 a-   499.99G    <span style="color: #000000;">0</span>
  <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdc1  pre_homolog lvm2 a-   499.99G    <span style="color: #000000;">0</span></pre></div></div>

<p><strong>4-)</strong> Aumentar o GFS</p>
<p>Com o /gfs montado, usando o gfs_grow</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-01 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># gfs_grow -v /gfs</span>
FS: Mount Point: <span style="color: #000000; font-weight: bold;">/</span>gfs
FS: Device: <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>pre_homolog-hotsites
FS: Options: rw,<span style="color: #007800;">hostdata</span>=<span style="color: #007800;">jid</span>=<span style="color: #000000;">0</span>:<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">id</span></span>=<span style="color: #000000;">131073</span>:<span style="color: #007800;">first</span>=<span style="color: #000000;">0</span>
FS: Size: <span style="color: #000000;">130809855</span>
RGRP: Current Resource Group List:
RI: Addr <span style="color: #000000;">130744354</span>, RgLen <span style="color: #000000;">5</span>, Start <span style="color: #000000;">130744359</span>, DataLen <span style="color: #000000;">65496</span>, BmapLen <span style="color: #000000;">16374</span>
RI: Addr <span style="color: #000000;">130678852</span>, RgLen <span style="color: #000000;">5</span>, Start <span style="color: #000000;">130678857</span>, DataLen <span style="color: #000000;">65496</span>, BmapLen <span style="color: #000000;">16374</span>
RI: Addr <span style="color: #000000;">130613350</span>, RgLen <span style="color: #000000;">5</span>, Start <span style="color: #000000;">130613355</span>, DataLen <span style="color: #000000;">65496</span>, BmapLen <span style="color: #000000;">16374</span>
...
...
RI: Addr <span style="color: #000000;">261895985</span>, RgLen <span style="color: #000000;">15</span>, Start <span style="color: #000000;">261896000</span>, DataLen <span style="color: #000000;">243904</span>, BmapLen <span style="color: #000000;">60976</span>
RGRP: <span style="color: #000000;">539</span> Resource <span style="color: #c20cb9; font-weight: bold;">groups</span> <span style="color: #000000; font-weight: bold;">in</span> total
Preparing to <span style="color: #c20cb9; font-weight: bold;">write</span> new FS information...
Done.</pre></div></div>

<p>Antes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-02 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># df -h</span>
Filesystem            Size  Used Avail Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1             6.9G  1.8G  4.7G  <span style="color: #000000;">28</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>
tmpfs                 1.9G     <span style="color: #000000;">0</span>  1.9G   <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>pre_homolog-hotsites
                      493G   12G  482G   <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>gfs</pre></div></div>

<p>Depois:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>cluster-02 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># df -h</span>
Filesystem            Size  Used Avail Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1             6.9G  1.8G  4.7G  <span style="color: #000000;">28</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>
tmpfs                 1.9G     <span style="color: #000000;">0</span>  1.9G   <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>pre_homolog-hotsites
                      994G   12G  983G   <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>gfs</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2009/01/22/como-aumentar-seu-cluster-online-esxgfs/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cluster com VMware ESX + GFS</title>
		<link>http://everlinux.com/blog/2009/01/06/cluster-com-vmware-esx-gfs</link>
		<comments>http://everlinux.com/blog/2009/01/06/cluster-com-vmware-esx-gfs#comments</comments>
		<pubDate>Tue, 06 Jan 2009 23:26:47 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Dicas]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Virtualização]]></category>
		<category><![CDATA[GFS]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/2009/01/06/cluster-com-vmware-esx-gfs/</guid>
		<description><![CDATA[Já escrevemos bastante sobre Virtualização usando Xen e Cluster aqui no Blog. Desta vez, para começar bem 2009 eu irei apenas citar alguns testes que fiz usando VMware ESX com GFS, em um Storage compartilhado, usando tecnologia Red Hat 5.2 x86_64 com um Fence_VMWare Tech Preview do RHEL 5.3 beta. O Problema Eu já o [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.everlinux.com/blog/wp-content/uploads/2009/01/teste_esx_gfs_ever.png' title='Teste_ESX_GFS_Ever'><img src='http://www.everlinux.com/blog/wp-content/uploads/2009/01/teste_esx_gfs_ever.thumbnail.png' alt='Teste_ESX_GFS_Ever' /></a></p>
<p>Já escrevemos bastante sobre <a href="http://www.everlinux.com/blog/category/virtualizacao/">Virtualização </a>usando <a href="http://www.everlinux.com/blog/category/xen/">Xen</a> e <a href="http://www.everlinux.com/blog/category/cluster/">Cluster</a> aqui no Blog. </p>
<p>Desta vez, para começar bem 2009 eu irei apenas citar alguns testes que fiz usando VMware ESX com GFS, em um <a href="http://www.everlinux.com/blog/category/storage/">Storage</a> compartilhado, usando tecnologia Red Hat 5.2 x86_64 com um Fence_VMWare Tech Preview do RHEL 5.3 beta.</p>
<p><strong>O Problema</strong></p>
<p>Eu já o utilizava o GFS com Xen ou até mesmo com <a href="http://www.everlinux.com/blog/2008/06/16/usando-drbd-com-gfs-e-fencing-manual/">DRBD em Muti-Master</a>, porém o grande problema é que não existia um fence para vmware que funcionasse a contento.</p>
<p>O <a href="http://sources.redhat.com/cgi-bin/cvsweb.cgi/cluster/fence/agents/vmware/fence_vmware.pl?cvsroot=cluster">fence_vmware</a>, escrito em perl parou no tempo em Agosto de 2007 e fora que a <a href="http://www.vmware.com/download/sdk/api.html">VMware Perl API</a> necessária não compila em 64 bits.</p>
<p>A Red Hat pretende lançar agora no RHEL 5.3 um <a href="http://sources.redhat.com/cluster/wiki/VMware_FencingConfig">fence_vmware re-escrito em Python</a>, porém ele ainda não trabalha com Cluster, pois conecta-se direto na máquina física, e não no VMCenter.</p>
<p><strong>A Solução</strong></p>
<p>A solução é utilizar o vmware_fence_vi, também da Red Hat que está em fase de desenvolvimento atualmente, que conecta no Virtual Center e não na máquina física que pode estar morta <img src='http://everlinux.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Segue o /etc/cluster/cluster.conf utilizado nos testes:</p>
<p><strong>Configuração do Cluster</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>cluster <span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">alias</span></span>=<span style="color: #ff0000;">&quot;Cluster_GFS&quot;</span> <span style="color: #007800;">config_version</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;Cluster_GFS&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>fence_daemon <span style="color: #007800;">clean_start</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #007800;">post_fail_delay</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #007800;">post_join_delay</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>cman<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>multicast <span style="color: #007800;">addr</span>=<span style="color: #ff0000;">&quot;224.0.0.1&quot;</span> <span style="color: #007800;">interface</span>=<span style="color: #ff0000;">&quot;eth1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>cman<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>clusternodes<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>clusternode <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;cluster-01-node-01&quot;</span> <span style="color: #007800;">nodeid</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #007800;">votes</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>multicast <span style="color: #007800;">addr</span>=<span style="color: #ff0000;">&quot;224.0.0.1&quot;</span> <span style="color: #007800;">interface</span>=<span style="color: #ff0000;">&quot;eth1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	           <span style="color: #000000; font-weight: bold;">&lt;</span>fence<span style="color: #000000; font-weight: bold;">&gt;</span>
        	        <span style="color: #000000; font-weight: bold;">&lt;</span>method <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;single&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
                	        <span style="color: #000000; font-weight: bold;">&lt;</span>device <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;node-01&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	                <span style="color: #000000; font-weight: bold;">&lt;/</span>method<span style="color: #000000; font-weight: bold;">&gt;</span>
	           <span style="color: #000000; font-weight: bold;">&lt;/</span>fence<span style="color: #000000; font-weight: bold;">&gt;</span>
                <span style="color: #000000; font-weight: bold;">&lt;/</span>clusternode<span style="color: #000000; font-weight: bold;">&gt;</span>
                <span style="color: #000000; font-weight: bold;">&lt;</span>clusternode <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;cluster-01-node-02&quot;</span> <span style="color: #007800;">nodeid</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #007800;">votes</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>multicast <span style="color: #007800;">addr</span>=<span style="color: #ff0000;">&quot;224.0.0.1&quot;</span> <span style="color: #007800;">interface</span>=<span style="color: #ff0000;">&quot;eth1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
                   <span style="color: #000000; font-weight: bold;">&lt;</span>fence<span style="color: #000000; font-weight: bold;">&gt;</span>
                        <span style="color: #000000; font-weight: bold;">&lt;</span>method <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;single&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
                                <span style="color: #000000; font-weight: bold;">&lt;</span>device <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;node-02&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
                        <span style="color: #000000; font-weight: bold;">&lt;/</span>method<span style="color: #000000; font-weight: bold;">&gt;</span>
                   <span style="color: #000000; font-weight: bold;">&lt;/</span>fence<span style="color: #000000; font-weight: bold;">&gt;</span>
                <span style="color: #000000; font-weight: bold;">&lt;/</span>clusternode<span style="color: #000000; font-weight: bold;">&gt;</span>
                <span style="color: #000000; font-weight: bold;">&lt;</span>clusternode <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;cluster-01-node-03&quot;</span> <span style="color: #007800;">nodeid</span>=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #007800;">votes</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>multicast <span style="color: #007800;">addr</span>=<span style="color: #ff0000;">&quot;224.0.0.1&quot;</span> <span style="color: #007800;">interface</span>=<span style="color: #ff0000;">&quot;eth1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
                   <span style="color: #000000; font-weight: bold;">&lt;</span>fence<span style="color: #000000; font-weight: bold;">&gt;</span>
                        <span style="color: #000000; font-weight: bold;">&lt;</span>method <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;single&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
                                <span style="color: #000000; font-weight: bold;">&lt;</span>device <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;node-03&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
                        <span style="color: #000000; font-weight: bold;">&lt;/</span>method<span style="color: #000000; font-weight: bold;">&gt;</span>
                   <span style="color: #000000; font-weight: bold;">&lt;/</span>fence<span style="color: #000000; font-weight: bold;">&gt;</span>
                <span style="color: #000000; font-weight: bold;">&lt;/</span>clusternode<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>clusternodes<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>fencedevices<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>fencedevice <span style="color: #007800;">agent</span>=<span style="color: #ff0000;">&quot;fence_vmware_vi&quot;</span> <span style="color: #007800;">ipaddr</span>=<span style="color: #ff0000;">&quot;10.107.113.2&quot;</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">login</span></span>=<span style="color: #ff0000;">&quot;user&quot;</span> <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;node-01&quot;</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">passwd</span></span>=<span style="color: #ff0000;">&quot;xxxxx&quot;</span> <span style="color: #007800;">port</span>=<span style="color: #ff0000;">&quot;Cluster_01_Node_01&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>fencedevice <span style="color: #007800;">agent</span>=<span style="color: #ff0000;">&quot;fence_vmware_vi&quot;</span> <span style="color: #007800;">ipaddr</span>=<span style="color: #ff0000;">&quot;10.107.113.2&quot;</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">login</span></span>=<span style="color: #ff0000;">&quot;user&quot;</span> <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;node-02&quot;</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">passwd</span></span>=<span style="color: #ff0000;">&quot;xxxxx&quot;</span> <span style="color: #007800;">port</span>=<span style="color: #ff0000;">&quot;Cluster_01_Node_02&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>fencedevice <span style="color: #007800;">agent</span>=<span style="color: #ff0000;">&quot;fence_vmware_vi&quot;</span> <span style="color: #007800;">ipaddr</span>=<span style="color: #ff0000;">&quot;10.107.113.2&quot;</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">login</span></span>=<span style="color: #ff0000;">&quot;user&quot;</span> <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;node-03&quot;</span> <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">passwd</span></span>=<span style="color: #ff0000;">&quot;xxxxx&quot;</span> <span style="color: #007800;">port</span>=<span style="color: #ff0000;">&quot;Cluster_01_Node_03&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>fencedevices<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>cluster<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Notas: </p>
<p>1-) Troque parênteses por sinal de maior/ menor (maldito wordpress!) <img src='http://everlinux.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>2-) O IP 10.107.113.2 é o IP do Virtual Center. Ele sempre sabe onde a máquina virtual se encontra, mesmo que ela for migrada para outro host físico.</p>
<p>3-) Forçamos o MultiCast pela eth1, que é uma interface dedicada para o heartbeat do Cluster. Algumas vezes o multicast tentava sair pela interface de loopback e cada máquina achava que estava sozinha no cluster <img src='http://everlinux.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>/etc/hosts dos servidores:</p>
<p><code>10.0.0.1	cluster-01-node-01<br />
10.0.0.2	cluster-01-node-02<br />
10.0.0.3	cluster-01-node-03<br />
10.0.1.1	node-01<br />
10.0.1.2	node-02<br />
10.0.1.3	node-03</code></p>
<p><strong>Script de escrita</strong></p>
<p>Foi utilizado um script para escrever no storage compartilhado a cada segundo com o nome da máquina e a hora exata (minuto, segundo) da escrita.</p>
<p><code># for i in `seq 1 1000`; do a=`echo $RANDOM | cut -c1-2`; dd if=/dev/zero of=/teste/`hostname -s`-`date +%H_%M_%S` bs=512k count=$a; sleep 1; done</code></p>
<p><strong>Nós do Cluster</strong></p>
<p><code>[root@cluster-01-node-02 ~]# cman_tool nodes<br />
Node  Sts   Inc   Joined               Name<br />
   1   M     60   2009-01-06 19:46:11  cluster-01-node-01<br />
   2   M     56   2009-01-06 19:46:11  cluster-01-node-02<br />
   3   M     68   2009-01-06 19:56:35  cluster-01-node-03</code></p>
<p><strong>Fence Device</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>fence_vmware_vi - DEVEL.1229423489
&nbsp;
<span style="color: #666666; font-style: italic;"># The Following agent has been tested on:</span>
<span style="color: #666666; font-style: italic;"># VI Perl API 1.6 against:</span>
<span style="color: #666666; font-style: italic;">#       VMware ESX 3.5</span>
<span style="color: #666666; font-style: italic;">#       VMware ESXi 3.5 update 2</span>
<span style="color: #666666; font-style: italic;">#       VMware Virtual Center 2.5</span>
<span style="color: #666666; font-style: italic;">#&lt;/code&gt;</span></pre></div></div>

<p>Com a seguinte modificação na linha 13:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#sys.path.append(&quot;@FENCEAGENTSLIBDIR@&quot;)</span>
sys.path.append<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;/usr/lib/fence&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p><strong>Desligar máquina VIRTUAL</strong></p>
<p>Teste: Desligar máquina VIRTUAL cluster-01-node-03</p>
<p>Resultado: GFS congelado por ~1 minuto</p>
<p>O que ocorreu: O fence_vmware_vi conectou no vmcenter e tirou a máquina do Cluster, liberando assim o I/O.</p>
<p><strong>Desligar máquina FISICA normalmente</strong></p>
<p>Teste: Desligar com reboot máquina FISICA 01 (que tinha a cluster-01-node-03)</p>
<p>Resultado: GFS congelado por ~2 minutos</p>
<p>O que ocorreu: Máquinas física iniciou o processo de reboot, a máquina virtual cluster-01-node-03 morreu e foi migrada e reiniciada em outro host físico.</p>
<p>PS: A máquina virtual não retornou ao seu host de origem quando a máquina física voltou</p>
<p><code>-rw-r--r-- 1 root root 44040192 Jan  6  2009 cluster-01-node-01-19_50_52<br />
-rw-r--r-- 1 root root 15204352 Jan  6  2009 cluster-01-node-01-19_50_53<br />
-rw-r--r-- 1 root root 10485760 Jan  6  2009 cluster-01-node-01-19_50_54<br />
-rw-r--r-- 1 root root 41418752 Jan  6  2009 cluster-01-node-01-19_52_57<br />
-rw-r--r-- 1 root root 17825792 Jan  6  2009 cluster-01-node-01-19_52_58<br />
-rw-r--r-- 1 root root 23068672 Jan  6  2009 cluster-01-node-01-19_52_59<br />
-rw-r--r-- 1 root root  6815744 Jan  6  2009 cluster-01-node-01-19_53_00<br />
-rw-r--r-- 1 root root 49807360 Jan  6  2009 cluster-01-node-01-19_53_01<br />
-rw-r--r-- 1 root root 10485760 Jan  6  2009 cluster-01-node-01-19_53_03<br />
</code></p>
<p><strong>Desligar máquina FISICA brutalmente</strong></p>
<p>Desligar com RESET (via RSA) máquina FISICA 02 (que tinha a cluster-01-node-03)</p>
<p>Resultado: GFS congelado por ~3 minutos</p>
<p>O que ocorreu: Máquinas física foi brutalmente desligada, a máquina virtual cluster-01-node-03 morreu e foi migrada e reiniciada em outro host físico.</p>
<p>O fence_vmware_vi tentou várias vezes tirar a máquina do cluster com falhas consecutivas pois a máquina não mais existia e o ESX demorou um pouco para entender o que estava acontecendo.</p>
<p>PS: A máquina virtual não retornou ao seu host de origem quando a máquina física voltou</p>
<p><code>-rw-r--r-- 1 root root 12058624 Jan  6 20:17 cluster-01-node-01-20_17_57<br />
-rw-r--r-- 1 root root 11534336 Jan  6 20:17 cluster-01-node-01-20_17_58<br />
-rw-r--r-- 1 root root 10485760 Jan  6 20:17 cluster-01-node-01-20_17_59<br />
-rw-r--r-- 1 root root  5242880 Jan  6 20:18 cluster-01-node-01-20_18_00<br />
-rw-r--r-- 1 root root  5767168 Jan  6 20:20 cluster-01-node-01-20_18_01<br />
-rw-r--r-- 1 root root  6291456 Jan  6 20:21 cluster-01-node-01-20_21_00<br />
-rw-r--r-- 1 root root 37748736 Jan  6 20:21 cluster-01-node-01-20_21_02<br />
-rw-r--r-- 1 root root 17825792 Jan  6 20:21 cluster-01-node-01-20_21_03<br />
-rw-r--r-- 1 root root 12582912 Jan  6 20:21 cluster-01-node-01-20_21_04<br />
-rw-r--r-- 1 root root 34603008 Jan  6 20:21 cluster-01-node-01-20_21_05<br />
-rw-r--r-- 1 root root  5242880 Jan  6 20:21 cluster-01-node-01-20_21_06<br />
-rw-r--r-- 1 root root 12582912 Jan  6 20:21 cluster-01-node-01-20_21_07<br />
-rw-r--r-- 1 root root 12582912 Jan  6 20:21 cluster-01-node-01-20_21_08</code></p>
<p><strong>Trechos de logs</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">10</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>TOTEM<span style="color: #7a0874; font-weight: bold;">&#93;</span> The token was lost <span style="color: #000000; font-weight: bold;">in</span> the OPERATIONAL state. 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">10</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>TOTEM<span style="color: #7a0874; font-weight: bold;">&#93;</span> Receive multicast socket recv buffer <span style="color: #c20cb9; font-weight: bold;">size</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">288000</span> bytes<span style="color: #7a0874; font-weight: bold;">&#41;</span>. 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">10</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>TOTEM<span style="color: #7a0874; font-weight: bold;">&#93;</span> Transmit multicast socket send buffer <span style="color: #c20cb9; font-weight: bold;">size</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">262142</span> bytes<span style="color: #7a0874; font-weight: bold;">&#41;</span>. 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">10</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>TOTEM<span style="color: #7a0874; font-weight: bold;">&#93;</span> entering GATHER state from 2. 
&nbsp;
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>CLM  <span style="color: #7a0874; font-weight: bold;">&#93;</span> CLM CONFIGURATION CHANGE 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>CLM  <span style="color: #7a0874; font-weight: bold;">&#93;</span> New Configuration: 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>CLM  <span style="color: #7a0874; font-weight: bold;">&#93;</span> 	r<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> ip<span style="color: #7a0874; font-weight: bold;">&#40;</span>10.0.0.1<span style="color: #7a0874; font-weight: bold;">&#41;</span>  
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>CLM  <span style="color: #7a0874; font-weight: bold;">&#93;</span> 	r<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> ip<span style="color: #7a0874; font-weight: bold;">&#40;</span>10.0.0.2<span style="color: #7a0874; font-weight: bold;">&#41;</span>  
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>CLM  <span style="color: #7a0874; font-weight: bold;">&#93;</span> Members Left: 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: cluster-01-node-03 not a cluster member after <span style="color: #000000;">0</span> sec post_fail_delay
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> cluster-01-node-01 openais<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2646</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>CLM  <span style="color: #7a0874; font-weight: bold;">&#93;</span> 	r<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> ip<span style="color: #7a0874; font-weight: bold;">&#40;</span>10.0.0.3<span style="color: #7a0874; font-weight: bold;">&#41;</span>  
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: fencing node <span style="color: #ff0000;">&quot;cluster-01-node-03&quot;</span>
&nbsp;
  Please use <span style="color: #ff0000;">'-h'</span> <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #007800;">usagcation</span>=HASH<span style="color: #7a0874; font-weight: bold;">&#40;</span>0x1df33bd0<span style="color: #7a0874; font-weight: bold;">&#41;</span>ing with the remote host.eports: vmware_helper returned Cannot power off vm Cluster_01_Node_03<span style="color: #000000; font-weight: bold;">!</span>
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">47</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: agent <span style="color: #ff0000;">&quot;fence_vmware_vi&quot;</span> reports: e 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">47</span> cluster-01-node-01 ccsd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2636</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Attempt to close an unopened CCS descriptor <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">44880</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>. 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">47</span> cluster-01-node-01 ccsd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2636</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Error <span style="color: #000000; font-weight: bold;">while</span> processing disconnect: Invalid request descriptor 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">47</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: fence <span style="color: #ff0000;">&quot;cluster-01-node-03&quot;</span> failed
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">18</span>:<span style="color: #000000;">52</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: fencing node <span style="color: #ff0000;">&quot;cluster-01-node&quot;</span>
&nbsp;
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">28</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: agent <span style="color: #ff0000;">&quot;fence_vmware_vi&quot;</span> reports: Connection timed out 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">28</span> cluster-01-node-01 ccsd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2636</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Attempt to close an unopened CCS descriptor <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">45600</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>. 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">28</span> cluster-01-node-01 ccsd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2636</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Error <span style="color: #000000; font-weight: bold;">while</span> processing disconnect: Invalid request descriptor 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">28</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: fence <span style="color: #ff0000;">&quot;cluster-01-node-03&quot;</span> failed
&nbsp;
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">33</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: fencing node <span style="color: #ff0000;">&quot;cluster-01-node-03&quot;</span>
  Please use <span style="color: #ff0000;">'-h'</span> <span style="color: #007800;">tNotConnected</span>=HASH<span style="color: #7a0874; font-weight: bold;">&#40;</span>0x19bb0090<span style="color: #7a0874; font-weight: bold;">&#41;</span>mote host, since it is disconnected.ware_helper returned Cannot power on vm Cluster_01_Node_03<span style="color: #000000; font-weight: bold;">!</span>
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">46</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: agent <span style="color: #ff0000;">&quot;fence_vmware_vi&quot;</span> reports: <span style="color: #000000; font-weight: bold;">for</span> usage 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">46</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: fence <span style="color: #ff0000;">&quot;cluster-01-node-03&quot;</span> failed
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">51</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: fencing node <span style="color: #ff0000;">&quot;cluster-01-node-03&quot;</span>
&nbsp;
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 ccsd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2636</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Attempt to close an unopened CCS descriptor <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">46710</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>. 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 ccsd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2636</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Error <span style="color: #000000; font-weight: bold;">while</span> processing disconnect: Invalid request descriptor 
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 fenced<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2666</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: fence <span style="color: #ff0000;">&quot;cluster-01-node-03.ig.com.br&quot;</span> success
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 kernel: GFS: <span style="color: #007800;">fsid</span>=Cluster_GFS:gfs.0: <span style="color: #007800;">jid</span>=<span style="color: #000000;">2</span>: Trying to acquire journal lock...
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 kernel: GFS: <span style="color: #007800;">fsid</span>=Cluster_GFS:gfs.0: <span style="color: #007800;">jid</span>=<span style="color: #000000;">2</span>: Looking at journal...
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 kernel: GFS: <span style="color: #007800;">fsid</span>=Cluster_GFS:gfs.0: <span style="color: #007800;">jid</span>=<span style="color: #000000;">2</span>: Acquiring the transaction lock...
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 kernel: GFS: <span style="color: #007800;">fsid</span>=Cluster_GFS:gfs.0: <span style="color: #007800;">jid</span>=<span style="color: #000000;">2</span>: Replaying journal...
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 kernel: GFS: <span style="color: #007800;">fsid</span>=Cluster_GFS:gfs.0: <span style="color: #007800;">jid</span>=<span style="color: #000000;">2</span>: Replayed <span style="color: #000000;">79</span> of <span style="color: #000000;">93</span> blocks
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 kernel: GFS: <span style="color: #007800;">fsid</span>=Cluster_GFS:gfs.0: <span style="color: #007800;">jid</span>=<span style="color: #000000;">2</span>: replays = <span style="color: #000000;">79</span>, skips = <span style="color: #000000;">13</span>, sames = <span style="color: #000000;">1</span>
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 kernel: GFS: <span style="color: #007800;">fsid</span>=Cluster_GFS:gfs.0: <span style="color: #007800;">jid</span>=<span style="color: #000000;">2</span>: Journal replayed <span style="color: #000000; font-weight: bold;">in</span> 1s
Jan  <span style="color: #000000;">6</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">20</span>:<span style="color: #000000;">59</span> cluster-01-node-01 kernel: GFS: <span style="color: #007800;">fsid</span>=Cluster_GFS:gfs.0: <span style="color: #007800;">jid</span>=<span style="color: #000000;">2</span>: Done</pre></div></div>

<p><strong>Conclusão</strong></p>
<p>Estes testes foram realizados buscando alternativas que reduzam o downtime dos serviços e/ou aplicações contidos em um servidor, chegando a manter sua disponibilidade próxima dos 99,999%.</p>
<p>Como você pôde perceber, esta estrutura permite chegarmos a este número, mas até o momento em que está sendo escrito este post, a versão usada ainda não está homologada, usando pacotes ainda em desenvolvimento (cman+fence_vmware). </p>
<p>Num futuro próximo, já devemos ter algum retorno das empresas desenvolvedoras, pois focam em uma fatia do merdado muito forte e competitiva ($$$).</p>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2009/01/06/cluster-com-vmware-esx-gfs/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mantendo sistemas &#8220;alive&#8221; com uso de Bond&#8217;s</title>
		<link>http://everlinux.com/blog/2008/11/21/mantendo-sistemas-alive-com-uso-de-bonds</link>
		<comments>http://everlinux.com/blog/2008/11/21/mantendo-sistemas-alive-com-uso-de-bonds#comments</comments>
		<pubDate>Fri, 21 Nov 2008 22:09:52 +0000</pubDate>
		<dc:creator>Carlos Mangini</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/2008/11/21/mantendo-sistemas-alive-com-uso-de-bonds/</guid>
		<description><![CDATA[Recentemente precisei colocar um grupo de servidores em alta disponibilidade (High availability) e resolvi usar um recurso conhecido como &#8220;bond&#8221;. Fácil de implementar, tudo que você irá precisar são 2 placas de rede, 2 cabos de rede, sendo cada um destes conectado a 1 switch. Dessa forma, um dos switch&#8217;s ficando indisponível, conseguiremos manter o [...]]]></description>
			<content:encoded><![CDATA[<p>Recentemente precisei colocar um grupo de servidores em alta disponibilidade (High availability) e resolvi usar um recurso conhecido como <a href="http://en.wikipedia.org/wiki/Channel_bonding">&#8220;bond&#8221;</a>.</p>
<p>Fácil de implementar, tudo que você irá precisar são 2 placas de rede, 2 cabos de rede, sendo cada um destes conectado a 1 switch. Dessa forma, um dos switch&#8217;s ficando indisponível, conseguiremos manter o Servidor atendendo à demanda.</p>
<p>Vamos as configurações:</p>
<p>Precisamos manter as configurações das 2 interfaces de rede sem IP&#8217;s. Isso acontece, porque o bond vai assumir as duas placas de rede ele pode balancear a carga de dados entre elas, a opção default do bond, ou no caso, fazer a soma dos links, ou seja, se tivermos cada interface trabalhando a 1Gb o <a href="http://pt.wikipedia.org/wiki/Throughput">&#8220;throughput&#8221;</a> do link será de 2Gb. <img src='http://everlinux.com/blog/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> </p>
<p>Abaixo a conf de cada eth:</p>
<blockquote><p> /etc/sysconfig/network-scripts/ifcfg-eth0<br />
# Intel Corporation 82571EB Gigabit Ethernet Controller<br />
DEVICE=eth0<br />
BOOTPROTO=none<br />
HWADDR=&#8221;seu MAC ADDRESS&#8221;<br />
IPV6ADDR=<br />
IPV6PREFIX=<br />
ONBOOT=yes<br />
MASTER=bond0<br />
SLAVE=yes<br />
USERCTL=no</p>
<p>/etc/sysconfig/network-scripts/ifcfg-eth1<br />
# Intel Corporation 82571EB Gigabit Ethernet Controller<br />
DEVICE=eth1<br />
BOOTPROTO=none<br />
HWADDR=&#8221;seu MAC ADDRESS&#8221;<br />
ONBOOT=yes<br />
MASTER=bond0<br />
SLAVE=yes<br />
USERCTL=no
</p></blockquote>
<p>Além da configuração das 2 eth&#8217;s, precisamos criar um arquivo com as configurações do bond.<br />
Iremos chamá-lo de /etc/sysconfig/network-scripts/ifcfg-bond0 e seu conteúdo será:</p>
<blockquote><p>
#bond0<br />
DEVICE=bond0<br />
BOOTPROTO=none<br />
ONBOOT=yes<br />
NETWORK=10.10.4.0<br />
NETMASK=255.255.255.0<br />
IPADDR=10.10.4.1<br />
USERCTL=no
</p></blockquote>
<p>Agora, para subirmos a interface de bond, precisamos setar algumas variáveis no arquivo /etc/modprobe.conf</p>
<blockquote><p>alias bond0 bonding<br />
options bonding max_bonds=1 mode=0 miimon=100</p></blockquote>
<p>- A primeira linha, irá criar um alias para a interface virtual bond0 baseado nas informações contidas no arquivo /etc/sysconfig/network-scripts/ifcfg-bond0.<br />
- A segunda linha diz max_bonds=1 para termos um bond no servidor e mode=0 onde os links onde os links trabalharão em balanceamento roudrobin. Caso queira aumentar somar o link, esse valor deverá ser alterado.</p>
<p>Caso seu servidor precise mais de um bond (4 ou mais placas de rede), você precisará aumentar o valor da variável max_bonds para o numero de bonds necessários.</p>
<p>Pronto! As configurações estão feitas, apenas reinicie a rede e você acaba de ter um servidor rodando com alta disponibilidade dos links de rede.</p>
<p>Você pode testar o balanceamento olhando o arquivo /proc/net/bonding/bond0. Rode o comando abaixo e tire um dos cabos. Em tempo real ele lhe informará se o link está down ou up de cada interface agregada ao bond</p>
<p>Para mais informações, consulte:<br />
/usr/share/doc/iputils-20020927/README.bonding</p>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2008/11/21/mantendo-sistemas-alive-com-uso-de-bonds/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  everlinux.com/blog/category/high-availability/feed ) in 1.60030 seconds, on Jul 30th, 2010 at 8:42 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Jul 30th, 2010 at 9:42 pm UTC -->