<?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; Red Hat</title>
	<atom:link href="http://everlinux.com/blog/category/red-hat/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>Atividades Open Source segundo a Red Hat</title>
		<link>http://everlinux.com/blog/2009/04/24/atividades-open-source-segundo-a-red-hat</link>
		<comments>http://everlinux.com/blog/2009/04/24/atividades-open-source-segundo-a-red-hat#comments</comments>
		<pubDate>Fri, 24 Apr 2009 15:31:42 +0000</pubDate>
		<dc:creator>leandro298</dc:creator>
				<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://everlinux.com/blog/?p=383</guid>
		<description><![CDATA[A Red Hat, juntamente com a Georgia Tech Mapping Open Source, disponibilizou um estudo conduzido em 75 países. O estudo designado Open Source Index (OSI), pretende medir a atividade mundial do software livre. Foram levados em consideração fatores dos países como políticas em setores como Governo, indústria e comunidade. Os resultados demonstram uma distribuição bem [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Redhat" src="http://everlinux.com/img/redhat090423.jpg" alt="" width="200" height="150" />A <a href="http://http://www.redhat.com">Red Hat</a>, juntamente com a Georgia Tech Mapping Open Source, disponibilizou um estudo conduzido em 75 países. O estudo designado <a href="http://www.redhat.com/f/pdf/OSSI_Research.pdf">Open Source Index</a> (OSI), pretende medir a atividade mundial do software livre. Foram levados em consideração fatores dos países como políticas em setores como Governo, indústria e comunidade.</p>
<p>Os resultados demonstram uma distribuição bem definida, do software Open Source pelo mundo.</p>
<p>O estudo com os resultados, que também se encontra numa representação no <a href="http://google.com/maps">Google Maps</a><a href="http://www.redhat.com/about/where-is-open-source/activity/"></a>, que tem o intuito de mapear a utilização dos softwares livres e open source e sua atividade, numa perspectiva interessante que pode ser aproveitada por estudos academicos ou de mercado. Segundo a informação presente na FAQ da <a href="http://http://www.redhat.com">Red Hat</a> sobre o estudo, os dados têm algum valor especulativo.</p>
<p style="text-align: center;"><a title="Mapa com as Atividades Open Source" href="http://www.redhat.com/about/where-is-open-source/activity/"><img class="alignnone" title="Radhat - Map" src="http://everlinux.com/img/redhatmap090423.jpg" alt="" width="400" height="220" /></a></p>
<p>“Mesmo um país que não tenha um alto grau de penetração de open source, pode ter um número elevado número de usuários na Internet e ser possuidor de patentes na área de tecnologias de informação. Estes fatores podem indicar um ambiente favorável, para este software poder ser divulgado.”</p>
<p>Acesse o <a href="http://www.redhat.com/about/where-is-open-source/activity/">mapa</a> com as <a href="http://www.redhat.com/about/where-is-open-source/activity/">Atividades Open Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2009/04/24/atividades-open-source-segundo-a-red-hat/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>Apache autenticando no LDAP</title>
		<link>http://everlinux.com/blog/2008/09/08/apache-autenticando-no-ldap</link>
		<comments>http://everlinux.com/blog/2008/09/08/apache-autenticando-no-ldap#comments</comments>
		<pubDate>Mon, 08 Sep 2008 16:54:40 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/2008/09/08/apache-autenticando-no-ldap/</guid>
		<description><![CDATA[Dica rápida: Taí uma coisa mais velha do que andar pra frente: Colocara o apache para autenticar no LDAP. Porém, fui tentar fazer isso em um Red Hat EL 5.2 e não funcionou. Seguindo a documentação, um simples trecho como este deveria ser suficiente: AuthName &#8220;Autenticadao Fodastica&#8221; AuthType Basic AuthLDAPURL ldap://ldapserver.com.br:389/ou=People,dc=empresa,dc=com,dc=br?uid?one require user huguinho zezinho [...]]]></description>
			<content:encoded><![CDATA[<p>Dica rápida: Taí uma coisa mais velha do que andar pra frente: Colocara o apache para autenticar no LDAP.</p>
<p>Porém, fui tentar fazer isso em um Red Hat EL 5.2 e não funcionou. Seguindo a <a href="http://httpd.apache.org/docs/2.0/mod/mod_auth_ldap.html">documentação</a>, um simples trecho como este deveria ser suficiente:</p>
<blockquote><p>        AuthName &#8220;Autenticadao Fodastica&#8221;<br />
        AuthType Basic<br />
        AuthLDAPURL ldap://ldapserver.com.br:389/ou=People,dc=empresa,dc=com,dc=br?uid?one<br />
        require user huguinho zezinho luizinho<br />
        Allow from all</p></blockquote>
<p>Porém, só colocando essas linhas antes, que a autenticação funcionou (tudo em um Directory, como de costume)</p>
<blockquote><p>        AuthBasicProvider ldap<br />
        AuthzLDAPAuthoritative off</p></blockquote>
<p>E erro que dava era esse: <em>access to / failed, reason: verification of user id &#8216;tiagocruz&#8217; not configured</em></p>
<p>A dica está ae, para quando eu precisar disso novamente&#8230; <img src='http://everlinux.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2008/09/08/apache-autenticando-no-ldap/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conhecendo o ChironFS &#8211; Tolerante a Falhas com Replicação de Dados</title>
		<link>http://everlinux.com/blog/2008/08/06/conhecendo-o-chironfs-tolerante-a-falhas-com-replicacao-de-dados</link>
		<comments>http://everlinux.com/blog/2008/08/06/conhecendo-o-chironfs-tolerante-a-falhas-com-replicacao-de-dados#comments</comments>
		<pubDate>Wed, 06 Aug 2008 22:29:21 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[FISL9.0]]></category>
		<category><![CDATA[Red Hat]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/2008/08/06/conhecendo-o-chironfs-tolerante-a-falhas-com-replicacao-de-dados/</guid>
		<description><![CDATA[Suponha um cenário com um &#8220;cluster&#8221; de máquinas atendendo um serviço qualquer, como um apache por exemplo. Poderíamos usar &#8220;n&#8221; ferramentas para manter este cluster em sincronia, porém neste artigo eu gostaria de introduzir o poder de um Software Livre 100% Nacional criado pelo Luis Furquim! Portanto, para que todas as máquinas fiquem em sincronia, [...]]]></description>
			<content:encoded><![CDATA[<p>Suponha um cenário com um &#8220;cluster&#8221; de máquinas atendendo um serviço qualquer, como um apache por exemplo. Poderíamos usar &#8220;n&#8221; ferramentas para manter este cluster em sincronia, porém neste artigo eu gostaria de introduzir o poder de um Software Livre 100% Nacional criado pelo Luis Furquim!</p>
<p>Portanto, para que todas as máquinas fiquem em sincronia, usaremos o <a href="http://www.furquim.org/chironfs/">ChironFS</a> que é um Sistema de Arquivos Tolerante a Falhas com Replicação de Dados, no qual tive contato em Porto Alegre durante o<a href="http://www.everlinux.com/blog/category/fisl/fisl90/"> FISL 9.0.</a></p>
<p>Você pode fazer da apresentação do mesmo aqui: <a href='http://www.everlinux.com/blog/wp-content/uploads/2008/08/chironfs_fisl9.pdf' title='ChironFS FISL 9.0'>ChironFS</a></p>
<p><a href='http://www.everlinux.com/blog/wp-content/uploads/2008/08/chironfs.png' title='ChironFS'><img src='http://www.everlinux.com/blog/wp-content/uploads/2008/08/chironfs.thumbnail.png' alt='ChironFS' /></a></p>
<p>O ChironFS é um Filesystem virtual que utiliza o FUSE. Funciona sincronizando dados entre dois ou mais diretórios, porém, cada um deste diretório pode ser um ponto de montagem de uma máquina remota. Desta forma, o ChironFS atua como uma camada de abstração, sincronizando, por exemplo, um Debian com ext3 local com um Red Hat usando ReiserFS remotamente, usando NFS, SSHFS ou qualquer outro sistema que trabalhe com pontos de montagem.</p>
<p>No Red Hat Enterprise, infelizmente não existe os pacotes para o fuse e nem para seu módulo do kernel, mas você pode busca-los nos repositórios &#8220;dag&#8221;</p>
<p><a href="http://dag.wieers.com/rpm/packages/dkms-fuse/">http://dag.wieers.com/rpm/packages/dkms-fuse/</a><br />
<a href="http://dag.wieers.com/rpm/packages/fuse/">http://dag.wieers.com/rpm/packages/fuse/</a></p>
<p>Neste caso, as 03 máquinas de front-end exportam o diretório /data/dominios via NFS para que seja possível a montagem remota destes diretórios:</p>
<p><code># cat /etc/hosts<br />
192.168.0.1	site-1 site-1.com.br<br />
192.168.0.2	site-2 site-2.com.br<br />
192.168.0.3	site-3 site-3.com.br </p>
<p># cat /etc/exports<br />
/data/sync/site-1	192.168.0.0/24(async,rw,no_root_squash)</p>
<p># cat /etc/fstab<br />
nfsd 			/proc/fs/nfsd 			nfsd 		auto,defaults 0 0<br />
sunrpc 		/var/lib/nfs/rpc_pipefs		rpc_pipefs	auto,defaults 0 0<br />
site-2:/data/sync/site-2	/data/sync/site-2	nfs	soft,timeo=3	0 0<br />
site-3:/data/sync/site-3	/data/sync/site-3	nfs	soft,timeo=3	0 0</code></p>
<p>Portanto:</p>
<p>Site-1: monta a site-2 e a site-3<br />
Site-2: monta a site-1 e a site-3<br />
Site-3: monta a site-1 e a site-2</p>
<p>O ChironFS cuidará para que a escrita feita localmente seja replicada para as outras duas máquinas, configurado desta forma pelo /etc/fstab (atenção, um uma única linha!):</p>
<p><code>chironfs#/data/sync/site-1=:/data/sync/site-2=:/data/sync/site-3	/data/dominios<br />
fuse	allow_other,ctl=/var/run/chironctl,log=/var/log/chironfs.log 0 0</code></p>
<p>O que quer dizer:</p>
<p>O diretório /data/sync/site-1 (local) deve ser sincronizado com o /data/sync/site-2 (NFS, mais lento) e também com o /data/sync/site-3 (NFS) cada vez que houver escrita em <strong>/data/dominios</strong>.</p>
<p>Quando houver <strong>leitura</strong> em /data/domínios, o ChironFS irá dar preferência ao device local, pois é o único que não apresenta os dois pontos (&#8220;:&#8221;) em sua montagem no /etc/fstab.</p>
<p>Portanto, toda e qualquer escrita no disco que tenha o objetivo de ser sincronizada com as demais máquinas, devem ser feitas diretamente no /data/dominios de qualquer uma das máquinas.</p>
<p><strong>- Monitoramento</strong></p>
<p>O ChironFS a partir da versão 1.1 já vem pronto para ser monitorado pelo Nagios, bastando para isso acrescentar em seu nrpe.cfg:</p>
<p><code>command[check_site1]=/var/run/chironctl/_data_sync_site-1/check_chironfs.sh<br />
command[check_site2]=/var/run/chironctl/_data_sync_site-2/check_chironfs.sh<br />
command[check_site3]=/var/run/chironctl/_data_sync_site-3/check_chironfs.sh</code></p>
<p><strong>- Em caso de Problemas</strong></p>
<p>Algumas dicas retiradas do manual oficial: <a href="http://www.furquim.org/chironfs/pt/howto.html#fail">Capítulo 5. Falhas das Réplicas</a></p>
<p>Toda vez que uma réplica falha, o ChironFS tenta manter seus sistemas rodando. Se a falha ocorrer durante uma operação de leitura, o ChironFS tenta ler de alguma outra réplica e, se conseguir, retorna os dados para o chamador sem gerar erro.</p>
<p>Se a falha ocorrer durante uma operação de escrita, o ChironFS continua tentando escrever nas outras réplicas. Se ao menos uma das réplicas escrever com sucesso, o ChironFS retorna ao chamador sem gerar erro. Mas, desta vez, além de logar o evento, ele desabilita as réplicas que tiverem falhado. Isto significa que não haverá mais leituras ou escritas de/para as réplicas que falharam.</p>
<p>O crontab das máquinas possui um pequeno script para gerar gravação no /data/dominios a fim de tentar detectar quando alguma máquina do &#8220;cluster&#8221; está fora do ar:</p>
<p><code># Verificacao ChironFS<br />
* * * * * /bin/touch /data/dominios/`hostname`; sleep 15; /bin/rm -f /data/dominios/`hostname`</code></p>
<p>Outra dica importante é &#8220;congelar&#8221; updates no kernel, pois o ChironFS depende o FUSE que tem um módulo específico para um kernel específico. Portanto, se você atualizar o kernel no RHEL, provavelmente o módulo do fuse não irá mais funcionar e conseqüentemente, o chironfs também não. Para que isso não ocorra acidentalmente:</p>
<p><code># cat /etc/yum.conf<br />
[main]<br />
cachedir=/var/cache/yum<br />
distroverpkg=redhat-release<br />
...<br />
exclude=kernel* fuse-kmdl*</code></p>
<p>Você tem a opção de montar um sistema de arquivos semelhante ao /proc para controlar o ChironFS, que é um sistema de arquivos de controle é composto de um diretório para cada réplica. Seus nomes são o pathname completo da réplica com as barras (&#8220;/&#8221;) mudadas para caracteres de sublinha.</p>
<p>Cada um deles contém dois arquivos: o primeiro é chamado &#8220;status&#8221; e contém um número &#8220;0&#8243; nas réplicas que estiverem em bom estado ou um número &#8220;2&#8243; se a réplica estiver desabilitada e os dados inconsistentes. Basta gravar &#8220;0&#8243; ou &#8220;2&#8243; neste arquivo para habilitar ou desabilitar a réplica.</p>
<p>Enfim, depois de detectar a falha, corrija a sua causa no servidor de réplica falhado. VOCÊ DEVE PROVER POR SUA CONTA O RESTABELECIMENTO DA CONSISTÊNCIA DOS DADOS NO SERVIDOR DE RÉPLICA QUE FALHOU. EU SUGIRO O USO DO <strong>RSYNC</strong> PARA ATUALIZAR OS DADOS. ESTE PASSO DEVE SER EFETUADO ANTES DE COLOCAR A RÉPLICA EM ESTADO HABILITADO DE NOVO, CASO CONTRÁRIO, VOCÊ IRÁ CORROMPER SEUS DADOS NAS DEMAIS RÉPLICAS.</p>
<p>Para restabelecer o uso da réplica após o procedimento de recuperação:</p>
<p><code># echo 0 > /var/run/chironctl/_data_sync_site-3/status</code></p>
<p>E acompanhe as mudanças em /var/log/chironfs.log:</p>
<p><code>2008/08/04 11:35 init: version 1.1.2<br />
2008/08/04 11:44 open+chown failed accessing /data/sync/site-3/site/htdocs/pops/index.html Input/output error<br />
2008/08/04 11:44 disabling replica failed accessing /data/sync/site-3<br />
2008/08/04 11:55 trusting replica /data/sync/site-3 Forced by administrator</code></p>
<p>Ou simplesmente &#8220;reinicie&#8221; o ChironFS:</p>
<p><code># umount /var/run/chironctl /data/dominios<br />
# mount /data/dominios</code></p>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2008/08/06/conhecendo-o-chironfs-tolerante-a-falhas-com-replicacao-de-dados/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Usando DRBD com GFS e Fencing Manual</title>
		<link>http://everlinux.com/blog/2008/06/16/usando-drbd-com-gfs-e-fencing-manual</link>
		<comments>http://everlinux.com/blog/2008/06/16/usando-drbd-com-gfs-e-fencing-manual#comments</comments>
		<pubDate>Mon, 16 Jun 2008 19:42:02 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/2008/06/16/usando-drbd-com-gfs-e-fencing-manual/</guid>
		<description><![CDATA[* DRBD 8.x DBRD é a acrônimo para o nome inglês Distributed Replicated Block Device. O DRBD consiste num módulo para o kernel de Linux que, juntamente com alguns scripts, oferece um dispositivo de bloco projetado para disponibilizar dispositivos de armazenamento distribuídos, geralmente utilizado em clusters de alta disponibilidade. Isto é feito espelhando conjuntos de [...]]]></description>
			<content:encoded><![CDATA[<p><strong>* DRBD 8.x </strong></p>
<p>DBRD é a acrônimo para o nome inglês <em>Distributed Replicated Block Device</em>. O DRBD consiste num módulo para o kernel de Linux que, juntamente com alguns scripts, oferece um dispositivo de bloco projetado para disponibilizar dispositivos de armazenamento distribuídos, geralmente utilizado em clusters de alta disponibilidade. Isto é feito espelhando conjuntos de blocos via rede (dedicada). O DRBD funciona, portanto, como um sistema RAID baseado em rede.</p>
<p>Referência: <a href="http://pt.wikipedia.org/wiki/DRBD">http://pt.wikipedia.org/wiki/DRBD</a></p>
<p><strong>* GFS 1.x </strong></p>
<p>O &#8220;<em>Red Hat Global File System</em>&#8221; é um Sistema de Arquivos para Cluster, que permite que vários nós leiam e escrevam dados simultaneamente em um dispositivo compartilhado.</p>
<p>O GFS suporta ACL&#8217;s e atributos extendidos, diferente se seu concorrente direto, o OCFS (Oracle Cluster File System)</p>
<p>Vale observar que a versão 2.0 do GFS ainda é considerado &#8220;Technology Preview&#8221; e não deve ser usado em produção.</p>
<p>Porém, o GFS congela todo o I/O se ele perde um nó (cliente), e fica congelado até o que o nó retorne ou que o mesmo seja &#8220;fenced&#8221;.</p>
<p>Referência: <a href="http://www.redhat.com/gfs/">http://www.redhat.com/gfs/</a><br />
<a href="http://en.wikipedia.org/wiki/Comparison_of_file_systems">http://en.wikipedia.org/wiki/Comparison_of_file_systems</a></p>
<p><strong>* Fence Devices </strong></p>
<p>Fence é algo difícil de traduzir para a nossa língua, assim como a palavra &#8220;proxy&#8221; O Babylon sugere &#8220;grade; muro; cercar; proteger&#8221; enquanto o Google Translator sugere &#8220;vedação&#8221;.</p>
<p>Enfim, é algo nesse sentido: Se um nó do cluster apresenta problemas, para evitar que esse cara escreva algo no FileSystem? e acabe por corromper o mesmo, é necessário que o mesmo seja &#8220;fenceado&#8221;, ou seja, tirado da jogada. As formas comuns se se fazer isso são:</p>
<p>- Desligando a alimentação de energia deles;<br />
- Desligando a porta do switch;<br />
- Reiniciando a máquina usando DRAC/RSA/ILO (Dell, IBM e HP respectivamente);<br />
- Manualmente;</p>
<p>Utilizaremos a forma menos recomendada (manual) devido a falta de infra-estrutura para utilizarmos as demais. Um script do modificado do DRBD irá tornar o fencing_manual em um fencing automatizado <img src='http://everlinux.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<p>Referência: <a href="http://www.everlinux.com/blog/2008/04/22/redhat-enterprise-linux-51-cluster-suite/">http://www.everlinux.com/blog/2008/04/22/redhat-enterprise-linux-51-cluster-suite/</a></p>
<p><strong>* LVM </strong></p>
<p>Usaremos LVM para garantir flexibilidade da solução:</p>
<p>Criar volumes LV nas duas máquinas</p>
<p># pvcreate /dev/sda9<br />
# vgcreate vol0 /dev/sda9<br />
# lvcreate -L 105.94G -n lvm vol0</p>
<p><strong> &#8211; Configurando o DRBD</strong></p>
<p>Configurar o /etc/hosts para conter todas as maquinas, principalmente o hostname no IP principal e um nome para os IPs da rede de sincronismo: </p>
<p>127.0.0.1        localhost.localdomain localhost<br />
10.10.10.1     hotsite-1.com.br<br />
10.10.10.2     hotsite-2.com.br<br />
192.168.0.3     drbd_hotsite-1 drdb_hotsite-1.com.br<br />
192.168.0.4     drdb_hotsite-2 drdb_hotsite-2.com.br</p>
<p>Configurar o /etc/drbd.conf no master e slave</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># DRDB Configuration</span>
global <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        usage-count no;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
resource hotsite <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        protocol C;
&nbsp;
        startup <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                wfc-timeout <span style="color: #000000;">0</span>;
                degr-wfc-timeout <span style="color: #000000;">120</span>;
                become-primary-on both;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
        disk    <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                fencing resource-and-stonith;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
       handlers <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                outdate-peer <span style="color: #ff0000;">&quot;/sbin/obliterate&quot;</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
        net     <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                cram-hmac-alg sha1;
                shared-secret <span style="color: #ff0000;">&quot;senha_secreta&quot;</span>;
                timeout <span style="color: #000000;">60</span>;
                connect-int <span style="color: #000000;">10</span>;
                ping-int <span style="color: #000000;">10</span>;
                max-buffers <span style="color: #000000;">2048</span>;
                max-epoch-size <span style="color: #000000;">2048</span>;
                allow-two-primaries;
                after-sb-0pri discard-zero-changes;
                after-sb-1pri discard-secondary;
                after-sb-2pri disconnect;
                rr-conflict violently;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
        syncer  <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                rate 650M;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        on hotsite-1.com.br <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                device    <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>drbd0;
                disk      <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>vol0<span style="color: #000000; font-weight: bold;">/</span>lvm;
                address   192.168.0.3:<span style="color: #000000;">7789</span>;
                flexible-meta-disk internal;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
        on hotsite-2.com.br <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                device    <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>drbd0;
                disk      <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>vol0<span style="color: #000000; font-weight: bold;">/</span>lvm;
                address   192.168.0.4:<span style="color: #000000;">7789</span>;
                flexible-meta-disk internal;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Inicializar as partições para o drbd no master e slave </p>
<p><code># drbdadm create-md hotsite  |<br />
# drbdadm attach hotsite     |  drbdadm up hotsite<br />
# drbdadm connect hotsite    |</p>
<p># drbdadm -- --overwrite-data-of-peer primary hotsite<br />
# watch -n1 cat /proc/drbd<br />
# drbdadm primary hotsite<br />
</code></p>
<p>Obs: Caso de erro de carga de modulo inicie o drbd com &#8220;service drbd start&#8221; mesmo acusando erro, isso fará com que carregue o modulo corretamente.</p>
<p>Inicializar o drbd no master e slave </p>
<p><code># service drbd start</code></p>
<p><strong>- Configurando o cluster para o GFS</strong></p>
<p>* Crie o arquivo de configuração do cluster (/etc/cluster/cluster.conf) para o gfs, em todas as maquinas: </p>
<p>Vou colocar ele em um arquivo separado pois o wordpress não está(va) gostando as tags do mesmo: <a href='http://www.everlinux.com/blog/wp-content/uploads/2008/06/clusterconf.txt' title='cluster.conf'>cluster.conf</a></p>
<p>Update:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>?xml <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span>?<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>cluster <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;hotsite&quot;</span> <span style="color: #007800;">config_version</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>cman <span style="color: #007800;">two_node</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #007800;">expected_votes</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>fence_daemon <span style="color: #007800;">post_join_delay</span>=<span style="color: #ff0000;">&quot;60&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: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<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;drdb_hotsite-1&quot;</span> <span style="color: #007800;">nodeid</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>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;node1&quot;</span> <span style="color: #007800;">ipaddr</span>=<span style="color: #ff0000;">&quot;192.168.0.3&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;drdb_hotsite-2&quot;</span> <span style="color: #007800;">nodeid</span>=<span style="color: #ff0000;">&quot;2&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;node2&quot;</span> <span style="color: #007800;">ipaddr</span>=<span style="color: #ff0000;">&quot;192.168.0.4&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>
&nbsp;
<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;">name</span>=<span style="color: #ff0000;">&quot;manual&quot;</span> <span style="color: #007800;">agent</span>=<span style="color: #ff0000;">&quot;fence_manual&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><strong>Formatar a partição DRBD com GFS</strong></p>
<p><code># gfs_mkfs -t hotsite:gfs-00 -p lock_dlm -j 2 /dev/drbd0</code></p>
<p>Com isto ele irá iniciar o sincronismo com slave, pode ser observado executando o comando:</p>
<p><code># watch -n 1 cat /proc/drbd</code></p>
<p><strong>Inicie o serviços de cluster: </strong></p>
<p># service cman start</p>
<p><strong>Testando</strong></p>
<p><code># mount -v /dev/drbd0 /data<br />
# for i in `seq 1 10`; do a=`echo $RANDOM`; dd if=/dev/zero of=/data/$a bs=1k count=$a; sleep 1; done<br />
# ls -ltrk /data</code></p>
<p><strong>Forçando um reboot:</strong><br />
<code># echo 1 > /proc/sys/kernel/sysrq<br />
# echo b > /proc/sysrq-trigger<br />
</code></p>
<p>Para forçar o sincronismo de uma máquina<br />
(faça somente se souber o que está fazendo)<br />
<code># drbdsetup /dev/drbd0 primary -o</code></p>
<p><strong>Ordem dos scripts:</strong></p>
<p>Essa deverá ser a ordem para init level 0 e 6, pois durante o reboot/ shutdown da máquina o procedimento é o seguinte:<br />
- Desmonta a partição<br />
- Tira a máquina do Cluster<br />
- Para o DRBD</p>
<p><code>[root@hotsite-2 /etc/rc0.d]# ll | egrep '(partition|drbd|cman)'<br />
lrwxrwxrwx 1 root root 12 Jun 13 11:57 K80partition -> ../init.d/partition<br />
lrwxrwxrwx 1 root root 14 Jun 13 11:47 K81cman -> ../init.d/cman<br />
lrwxrwxrwx 1 root root 14 Jun 13 11:57 K82drbd -> ../init.d/drbd</code></p>
<p>Para os init level 3, 4 e 5 deverá ser:<br />
- Coloca a máquina do Cluster<br />
- Inicia o DRBD<br />
- Monta a partição do drbd (pois o mesmo irá falhar durante a inicialização)</p>
<p><code>[root@hotsite-2 /etc/rc3.d]# ll | egrep '(partition|drbd|cman)'<br />
lrwxrwxrwx 1 root root 14 Jun 13 11:55 S21cman -> ../init.d/cman<br />
lrwxrwxrwx 1 root root 14 Jun 13 11:55 S70drbd -> ../init.d/drbd<br />
lrwxrwxrwx 1 root root 12 Jun 13 11:55 S91partition -> ../init.d/partition</code></p>
<p><strong>O Script obliterate</strong></p>
<p>O script Obliterate foi escrito pelo Lon Hohberger e está disponível <a href="http://people.redhat.com/lhh/obliterate">aqui</a>.</p>
<p>Eu alterei as últimas linhas pois o fence_manual precisa que o comando fence_ack_manual seja executado, senão o GFS não vai liberar o I/O do cluster enquanto o outro nó não retornar com sucesso&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#</span>
fence_node <span style="color: #007800;">$REMOTE</span>
fence_ack_manual <span style="color: #660033;">-O</span> <span style="color: #660033;">-e</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$REMOTE</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #666666; font-style: italic;"># Reference:</span>
	<span style="color: #666666; font-style: italic;"># http://osdir.com/ml/linux.kernel.drbd.devel/2006-11/msg00005.html</span>
	<span style="color: #666666; font-style: italic;"># 7 = node got blown away.  </span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">7</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Fencing failed?!</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span></pre></div></div>

<p>Referência: <a href="http://sources.redhat.com/cluster/wiki/DRBD_Cookbook">http://sources.redhat.com/cluster/wiki/DRBD_Cookbook</a></p>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2008/06/16/usando-drbd-com-gfs-e-fencing-manual/feed</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>RedHat Enterprise Linux 5.1 Cluster Suite</title>
		<link>http://everlinux.com/blog/2008/04/22/redhat-enterprise-linux-51-cluster-suite</link>
		<comments>http://everlinux.com/blog/2008/04/22/redhat-enterprise-linux-51-cluster-suite#comments</comments>
		<pubDate>Tue, 22 Apr 2008 14:47:32 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/2008/04/22/redhat-enterprise-linux-51-cluster-suite/</guid>
		<description><![CDATA[Por Fábio Silva em seu blog: &#8220;Recentemente precisei configurar um ambiente com RHEL 5.1 Cluster Suite. Em contato com o pessoal do canal #linux-cluster no irc.freenode.net, eles me esclareceram algumas dúvidas e então consegui montar o ambiente. Assim, resolvi criar um howto em português para que fosse disponibilizado na página do projeto de cluster da [...]]]></description>
			<content:encoded><![CDATA[<p>Por Fábio Silva em <a href="http://www.fabiosilva.eti.br/">seu blog</a>:</p>
<p>&#8220;Recentemente precisei configurar um ambiente com RHEL 5.1 Cluster Suite.</p>
<p>Em contato com o pessoal do canal #linux-cluster no irc.freenode.net, eles me esclareceram algumas dúvidas e então consegui montar o ambiente.</p>
<p>Assim, resolvi criar um howto em português para que fosse disponibilizado na página do projeto de cluster da redhat, e aqui está o link para os interessados.&#8221;</p>
<p><a href="http://sources.redhat.com/cluster/wiki/QuickStart-Portuguese">http://sources.redhat.com/cluster/wiki/QuickStart-Portuguese</a></p>
<p>Este post é somente para agregar mais uns links interessantes sobre o assunto:</p>
<p><a href="http://sources.redhat.com/cluster/wiki/FAQ/Fencing">FAQ Sobre Fencing Devices</a></p>
<p><a href="http://wiki.samba.org/index.php/6.0._DRBD">Replicated Failover Domain Controller and file server using LDAP</a></p>
<p><a href="https://open.datacore.ch/DCwiki.open/Wiki.jsp?page=GFS.GNBD.Usage">How to use GNBD to export and import devices for GFS</a></p>
<p><a href="http://http://www.redhatmagazine.com/2007/03/19/teaching-your-cluster-and-storage-systems-to-dance-an-introduction-to-conga/">Teaching your cluster and storage systems to dance: An introduction to Conga</a></p>
<p><a href="http://www.redhat.com/docs/manuals/csgfs/admin-guide/cs-gfs-cons.html">Using Red Hat GFS with Red Hat Cluster Suite</a></p>
<p>Por último, mas não menos importante, um &#8220;txt&#8221; tosco, mas nem por isso com menas informações do que os demais: <a href="http://people.redhat.com/teigland/cluster2-arch.txt">cluster2-arch.txt</a>. Lá existe uma seção muito esclarecedora sobre <strong>&#8220;Fencing: What, When, Why&#8221;</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2008/04/22/redhat-enterprise-linux-51-cluster-suite/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Repositório Interno CPAN</title>
		<link>http://everlinux.com/blog/2008/02/25/repositorio-interno-cpan</link>
		<comments>http://everlinux.com/blog/2008/02/25/repositorio-interno-cpan#comments</comments>
		<pubDate>Mon, 25 Feb 2008 20:43:20 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/2008/02/25/repositorio-interno-cpan/</guid>
		<description><![CDATA[Se você vive compilando módulos Perl em máquinas sem saída para a Internet, ou se você sofre com problemas de lentidão ou disponibilidade de links externos, seus problemas acabaram Utilizando o CPAN-Mini (sua única dependência é o File-HomDir) você pode construir um repositório interno com menos de 1 GB e mante-lo atualizado diariamente com a [...]]]></description>
			<content:encoded><![CDATA[<p>Se você vive compilando módulos Perl em máquinas sem saída para a Internet, ou se você sofre com problemas de lentidão ou disponibilidade de links externos, seus problemas acabaram <img src='http://everlinux.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Utilizando o <a href="http://search.cpan.org/dist/CPAN-Mini/">CPAN-Mini</a> (sua única dependência é o <a href="http://search.cpan.org/dist/File-HomeDir/">File-HomDir</a>) você pode construir um repositório interno com menos de 1 GB e mante-lo atualizado diariamente com a seguinte entrada no crontab:</p>
<blockquote><p># Repositorio CPAN<br />
30 04 * * * /usr/bin/minicpan -l /var/www/cpan/ -r http://cpan.kinghost.net/</p></blockquote>
<p>Para utiliza-lo, você pode alterar o arquivo /etc/perl/CPAN/Config.pm da seguinte forma (no <strong>Debian/ Ubuntu</strong>):</p>
<p><code>'urllist' => [q[http://cpan.empresa.com.br/]],</code></p>
<p>Para os <strong>Red Hat&#8217;s</strong> da vida, você pode utilizar esta configuração:</p>
<p><code>[root@xen4-vm3 ~]# cat /usr/lib/perl5/5.8.5/CPAN/Config.pm</p>
<p># This is CPAN.pm's systemwide configuration file. This file provides<br />
# defaults for users, and the values can be changed in a per-user<br />
# configuration file. The user-config file is being looked for as<br />
# ~/.cpan/CPAN/MyConfig.pm.</p>
<p>$CPAN::Config = {<br />
  'build_cache' => q[10],<br />
  'build_dir' => q[/root/.cpan/build],<br />
  'cache_metadata' => q[1],<br />
  'cpan_home' => q[/root/.cpan],<br />
  'ftp' => q[/usr/kerberos/bin/ftp],<br />
  'ftp_proxy' => q[],<br />
  'getcwd' => q[cwd],<br />
  'gpg' => q[/usr/bin/gpg],<br />
  'gzip' => q[/bin/gzip],<br />
  'histfile' => q[/root/.cpan/histfile],<br />
  'histsize' => q[100],<br />
  'http_proxy' => q[],<br />
  'inactivity_timeout' => q[0],<br />
  'index_expire' => q[1],<br />
  'inhibit_startup_message' => q[0],<br />
  'keep_source_where' => q[/root/.cpan/sources],<br />
  'links' => q[/usr/bin/links],<br />
  'make' => q[/usr/bin/make],<br />
  'make_arg' => q[],<br />
  'make_install_arg' => q[],<br />
  'makepl_arg' => q[],<br />
  'ncftp' => q[],<br />
  'ncftpget' => q[],<br />
  'no_proxy' => q[],<br />
  'pager' => q[/usr/bin/less],<br />
  'prerequisites_policy' => q[ask],<br />
  'scan_cache' => q[atstart],<br />
  'shell' => q[/bin/bash],<br />
  'tar' => q[/bin/tar],<br />
  'term_is_latin' => q[1],<br />
  'unzip' => q[/usr/bin/unzip],<br />
  'urllist' => [q[http://cpan.empresa.com.br/]],<br />
  'wget' => q[/usr/bin/wget],<br />
};<br />
1;<br />
__END__<br />
</code></p>
<p>Depois basta deixa-lo disponível a partir de algum webserver como por exemplo o apache, algo mais ou menos assim:</p>
<p><code>< VirtualHost cpan.empresa.com.br:80 ><br />
    ServerName cpan.empresa.com.br:80<br />
    ServerAdmin implantacao@dc.com.br<br />
    DocumentRoot /var/www/cpan<br />
    ErrorLog /var/www/cpan/logs/cpan-error_log<br />
    CustomLog /var/www/cpan/logs/cpan-access_log combined env=!gif-image</code></p>
<p><code>    < Directory "/var/www/cpan" ><br />
        Options Indexes FollowSymLinks<br />
        AllowOverride None<br />
        Order allow,deny<br />
        Allow from 192.168.44.0/22 192.168.50.0/22<br />
    < / Directory ><br />
< / VirtualHost ><br />
</code></p>
<p>Se as entradas estiverem todas corretas,  para testar você pode fazer o seguinte:</p>
<blockquote><p># perl -MCPAN -e shell<br />
cpan> install Crypt::SmbHash</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2008/02/25/repositorio-interno-cpan/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  everlinux.com/blog/category/red-hat/feed ) in 0.88601 seconds, on Jul 30th, 2010 at 8:52 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Jul 30th, 2010 at 9:52 pm UTC -->