<?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>LINternUX</title>
	<atom:link href="http://linternux.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://linternux.com</link>
	<description>For Linux System Administrator</description>
	<lastBuildDate>Sat, 15 Mar 2014 12:33:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.6.2</generator>

<image>
	<url>http://linternux.com/wordpress/wp-content/uploads/2016/03/linternux-150x150.png</url>
	<title>LINternUX</title>
	<link>http://linternux.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Creating a Red Hat Cluster: Part 5</title>
		<link>http://linternux.com/2011/04/creating-a-redhat-cluster-part-5/</link>
					<comments>http://linternux.com/2011/04/creating-a-redhat-cluster-part-5/#comments</comments>
		
		<dc:creator><![CDATA[Jacques Duplessis]]></dc:creator>
		<pubDate>Sat, 16 Apr 2011 13:37:44 +0000</pubDate>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[cluster]]></category>
		<guid isPermaLink="false">http://linternux.com/?p=1817</guid>

					<description><![CDATA[Welcome back to LINternUX, for our last article of this series on how to build a working Red Hat cluster. So far we have a working cluster, but it only move the IP from server to server. In this article, we will put in place everything so that we have an FTP and a web [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Welcome back to LINternUX, for our last article of this series on how to build a working Red Hat cluster. So far we have a working cluster, but it only move the IP from server to server. In this article, we will put in place everything so that we have an FTP and a web service that will be fully redundant within our cluster. In our previous article, we have create a GFS filesystem under the mount point &#8220;/cadmin&#8221;, this is where we will put our scripts, configuration files and log used for our cluster. The content of the &#8220;/cadmin&#8221; filesystem can be downloaded <a href="http://linternux.com/download/cluster/cadmin.tar">here</a>, it include all the directories structure and scripts used in our cluster articles. After this article, you will have a fully configured cluster, running an ftp and a web service. We will have a lot to do, so let&#8217;s begin.</p>
<p>&nbsp;</p>
<h2>FTP prerequisite</h2>
<p>We need to make sure that the ftp server &#8220;vsftpd&#8221; is installed on every server in our cluster. You can check if it is installed by typing the following command ;</p>
<blockquote><p>root@gandalf:~# <strong><span style="color: #0000ff;">rpm -q vsftpd</span></strong><br />
vsftpd-2.0.5-16.el5_5.1<br />
root@gandalf:~#</p></blockquote>
<p>If is not installed, we need to run the following command to instal it on the servers where it&#8217;s not installed ;</p>
<blockquote><p>root@bilbo:~# <strong><span style="color: #0000ff;">yum install vsftpd</span></strong></p></blockquote>
<p>We must make sure the vsftpd is not started and doesn&#8217;t start upon reboot. To do so use the following commands on all servers;</p>
<blockquote><p>root@bilbo:~#<strong><span style="color: #0000ff;"> service vsftpd stop</span></strong><br />
Shutting down vsftpd:                                      [FAILED]<br />
root@bilbo:~# <strong><span style="color: #0000ff;">chkconfig vsftpd off</span></strong></p></blockquote>
<p><span id="more-1817"></span></p>
<h2>Script to stop/start/status our FTP service</h2>
<p>Now we need to create a script for each of our services  (ftp and web) that the cluster software will use to stop and start the  appropriate service and add it to our cluster configuration. We&#8217;ll put  these scripts if our /cadmin GFS filesystem, so it&#8217;s accessible by our 3  servers. We will start by creating the script for the ftp service. The  script used by the Red Hat Cluster Suite,  receive one  parameter when called by the cluster software. These parameter  can be &#8220;stop&#8221;, &#8220;start&#8221; and &#8220;status&#8221;.  You can d<a title="FTP Service Script" href="http://linternux.com/download/cluster/srv_ftp.sh">ownload a copy of the script</a> and the <a title="FTP Service configuration file" href="http://linternux.com/download/cluster/srv_ftp.conf">vsftpd configuration file </a>if you want. but remember that if you want to use them as is, you must put them in  the /cadmin filesystem. The &#8220;<a href="http://linternux.com/download/cluster/srv_ftp.sh">srv_ftp.sh</a>&#8221; script will go in a subdirectory  name &#8220;/cadmin/srv&#8221; and the configuration file &#8220;<a href="http://linternux.com/download/cluster/srv_ftp.conf">srv_ftp.conf</a>&#8221; must go in &#8220;/cadmin/cfg&#8221;  directory. But nothing beat an example, let&#8217;s  built the one for our FTP service.</p>
<pre>#! /bin/bash
# ---------------------------------------------------------------------------------
# Script to stop/start and give a status of ftp service in the cluster.
# This script is build to receive 3 parameters.
#    - start :  Executed by cluster to start the application(s) or service(s)
#    - stop  :  Executed by cluster to stop  the application(s) or service(s)
#    - status:  Executed by cluster every 30 seconds to check service status.
# ---------------------------------------------------------------------------------
# Author    : Jacques Duplessis - April 2011
# ---------------------------------------------------------------------------------
#set -x
CDIR="/cadmin"              ; export CDIR       # Root directory for Services
CSVC="$CDIR/srv"            ; export CSVC       # Service Scripts Directory
CCFG="$CDIR/cfg"            ; export CCFG       # Service Config. Directory
INST="srv_ftp"              ; export INST       # Service Instance Name
LOG="$CDIR/log/${INST}.log" ; export LOG        # Service Log file name
HOSTNAME=`hostname -a`      ; export HOSTNAME   # HostName
VSFTPD="/usr/sbin/vsftpd"   ; export VSFTPD     # Service Program name
FCFG="${CCFG}/${INST}.conf" ; export FCFG       # Service Config. file name
RC=0                        ; export RC         # Service Return Code
DASH="---------------------"; export DASH       # Dash Line

# Where the Action Start
# ---------------------------------------------------------------------------------
case "$1" in
  start)  echo -e "\n${DASH}" &gt;&gt; $LOG 2&gt;&amp;1
          echo -e "Starting service $INST on $HOSTNAME at `date`" &gt;&gt; $LOG 2&gt;&amp;1
          echo -e "${VSFTPD} ${FCFG}" &gt;&gt; $LOG 2&gt;&amp;1
          ${VSFTPD} ${FCFG} &gt;&gt; $LOG 2&gt;&amp;1
          RC=$?
          FPID=`ps -ef |grep -v grep |grep ${FCFG} |awk '{ print $2 }'|head -1`
          echo "Service $INST started on $HOSTNAME - PID=${FPID} RC=$RC"&gt;&gt; $LOG
          echo "${DASH}" &gt;&gt; $LOG 2&gt;&amp;1
          ;;
  stop )  echo -e "\n${DASH}" &gt;&gt; $LOG 2&gt;&amp;1
          echo -e "Stopping Service $INST on $HOSTNAME at `date` " &gt;&gt; $LOG
          ps -ef | grep ${FCFG}| grep -v grep &gt;&gt; $LOG 2&gt;&amp;1
          FPID=`ps -ef |grep -v grep |grep ${FCFG} |awk '{ print $2 }'|head -1`
          echo -e "Killing PID ${FPID}" &gt;&gt; $LOG 2&gt;&amp;1
          kill $FPID  &gt;&gt; $LOG 2&gt;&amp;1
          echo -e "Service $INST is stopped ..." &gt;&gt; $LOG 2&gt;&amp;1
          RC=0
          echo "${DASH}" &gt;&gt; $LOG 2&gt;&amp;1
          ;;
  status) COUNT=`ps -ef | grep ${FCFG}| grep -v grep | wc -l`
          FPID=`ps -ef |grep -v grep |grep ${FCFG} |awk '{ print $2 }'|head -1`
          echo -n "`date` Service $INST ($COUNT) on $HOSTNAME"&gt;&gt; $LOG 2&gt;&amp;1
          if [ $COUNT -gt 0 ]
             then echo " - PID=${FPID} - OK"  &gt;&gt; $LOG 2&gt;&amp;1
                  RC=0
             else echo " - NOT RUNNING" &gt;&gt; $LOG 2&gt;&amp;1
                  ps -ef | grep -i ${FCFG} | grep -v grep  &gt;&gt; $LOG 2&gt;&amp;1
                  RC=1
          fi
          ;;
esac
exit $RC</pre>
<p>This script is placed in the directory &#8220;/cadmin/svc&#8221; and name &#8220;svc_ftp.sh&#8221;. Now, let&#8217;s add this script to our ftp service, run the &#8220;system-config-cluster&#8221; command to start the cluster configuration GUI.</p>
<p>&nbsp;</p>
<h2>Add ftp script to our ftp cluster service</h2>
<p>Now, let&#8217;s add this script to our ftp service, run the &#8220;system-config-cluster&#8221; command.</p>
<blockquote><p>root@gandalf:~#<strong><span style="color: #0000ff;"> system-config-cluster &amp;</span></strong></p></blockquote>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_01.png"><img loading="lazy" class="alignleft size-medium wp-image-1853" title="Adding our ftp script to the ftp service" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_01-300x292.png" alt="" width="300" height="292" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_01-300x292.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_01.png 725w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>Click on &#8220;Resources&#8221; on the left side and then on  the  &#8220;Create a Resource&#8221;&#8216; button at the bottom right of the screen. This will allow us insert our ftp service script into the cluster configuration.</p>
<p>&nbsp;</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_02.png"><img loading="lazy" class="alignleft size-medium wp-image-1854" title="Creating a resource for our ftp script" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_02-254x300.png" alt="" width="254" height="300" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_02-254x300.png 254w, http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_02.png 373w" sizes="(max-width: 254px) 100vw, 254px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Select &#8220;Script&#8221; from the &#8220;Resource Type&#8221; list and then enter the name of our ressource &#8220;srv_ftp&#8221;  and then specify the name of the script the service will use, with it&#8217;s full path. Here, like I said we decided to place it in our &#8220;/cadmin&#8221; GFS filesystem so it is seen by every node in the cluster.</p>
<p>&nbsp;</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_03.png"><img loading="lazy" class="alignleft size-medium wp-image-1855" title="Add_ftp_service_03" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_03-300x292.png" alt="" width="300" height="292" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_03-300x292.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_03.png 725w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>Now we need to edit our &#8220;srv_ftp&#8221; service to add the resource we just created.</p>
<p>&nbsp;</p>
<p>Select the &#8220;srv_ftp&#8221; service at the bottom left of the screen and then press the &#8220;Edit Service Properties&#8221; button.</p>
<p>&nbsp;</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_04.png"><img loading="lazy" class="alignleft size-medium wp-image-1856" title="Add_ftp_service_04" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_04-300x261.png" alt="" width="300" height="261" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_04-300x261.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_04.png 561w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Click on the &#8220;Add a Shared Resource to this service&#8221; button. This will bring up the screen below, where we select the &#8220;srv_ftp&#8221; script that we want to add the our service.</p>
<p>&nbsp;</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_05.png"><img loading="lazy" class="alignleft size-full wp-image-1857" title="Add_ftp_service_05" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_05.png" alt="" width="261" height="260" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_05.png 261w, http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_05-150x150.png 150w" sizes="(max-width: 261px) 100vw, 261px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_06.png"><img loading="lazy" class="alignleft size-medium wp-image-1858" title="Add_ftp_service_06" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_06-300x260.png" alt="" width="300" height="260" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_06-300x260.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_06.png 561w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>After adding our script to the resource, press the &#8220;Close&#8221; button.</p>
<p>We are now ready to push our new configuration to the member of our cluster, press the &#8220;Send to Cluster&#8221; button to do so.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_07.png"><img loading="lazy" class="alignleft size-full wp-image-1859" title="Add_ftp_service_07" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/Add_ftp_service_07.png" alt="" width="251" height="96" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Web site prerequisite</h2>
<p>Make sure that the &#8220;httpd&#8221; and the &#8220;php&#8221; package is installed on  every server in our cluster. You can check if it is installed by typing  the following command ;</p>
<blockquote><p>root@gandalf # <strong>rpm -q httpd php</strong><br />
httpd-2.2.3-45.el5<br />
php-5.1.6-27.el5_5.3<br />
root@gandalf #</p>
<p>#</p></blockquote>
<p>If is not installed, we need to run the following command to instal them on the servers where it&#8217;s not installed ;</p>
<blockquote><p>root@bilbo:~# <strong>yum install httpd php<br />
</strong></p></blockquote>
<p>We must make sure the &#8220;httpd&#8221; is not started and doesn&#8217;t start upon reboot. To do so use the following commands on all servers;</p>
<blockquote><p>root@bilbo:~#<strong> service httpd stop</strong><br />
Shutting down httpd:                                      [FAILED]<br />
root@bilbo:~# <strong>chkconfig httpd off</strong></p></blockquote>
<h2>Script to stop/start/status our Web service</h2>
<p>We have simplify the configuration of our web site to the minimum. This was done intentionnaly, we wanted to demonstrate the cluster functionnaly and not the &#8220;httpd&#8221; possibilites. But our web site will be functionnal and redundant. As with the ftp script, the function of our web server script is very similar. You can <a title="Web Service Script" href="http://linternux.com/download/cluster/srv_www.sh">download this script</a> and the <a title="HTTPD configuration file" href="http://linternux.com/download/cluster/srv_www.conf">httpd configuration file</a> if you want, but remember that if you want to use them as is, you must put them in the /cadmin filesystem. The &#8220;<a href="http://linternux.com/download/cluster/srv_www.sh">srv_www.sh</a>&#8221; script will go in a subdirectory name &#8220;/cadmin/srv&#8221; and the configuration file &#8220;<a href="http://linternux.com/download/cluster/srv_www.conf">srv_www.conf</a>&#8221; must go in &#8220;/cadmin/cfg&#8221; directory.</p>
<pre>#! /bin/bash
# ---------------------------------------------------------------------------------
# Script to stop/start and give a status of our web service in the cluster.
# This script is build to receive 3 parameters.
#    - start :  Executed by cluster to start the application(s) or service(s)
#    - stop  :  Executed by cluster to stop  the application(s) or service(s)
#    - status:  Executed by cluster every 30 seconds to check service status.
# ---------------------------------------------------------------------------------
# Author    : Jacques Duplessis - April 2011
# ---------------------------------------------------------------------------------
#set -x
CDIR="/cadmin"              ; export CDIR       # Root directory for Services
CSVC="$CDIR/srv"            ; export CSVC       # Service Scripts Directory
CCFG="$CDIR/cfg"            ; export CCFG       # Service Config. Directory
INST="srv_www"              ; export INST       # Service Instance Name
LOG="$CDIR/log/${INST}.log" ; export LOG        # Service Log file name
HOSTNAME=`hostname -a`      ; export HOSTNAME   # HostName
HTTPD="/usr/sbin/httpd"     ; export HTTPD      # Service Program name
HCFG="${CCFG}/${INST}.conf" ; export HCFG       # Service Config. file name
RC=0                        ; export RC         # Service Return Code
DASH="---------------------"; export DASH       # Dash Line

# Where the Action Start
# ---------------------------------------------------------------------------------
case "$1" in
 start)  echo -e "\n${DASH}" &gt;&gt; $LOG 2&gt;&amp;1
         echo -e "Starting service $INST on $HOSTNAME at `date`" &gt;&gt; $LOG 2&gt;&amp;1
         echo -e "${HTTPD} ${HCFG}" &gt;&gt; $LOG 2&gt;&amp;1
         ${HTTPD} -f ${HCFG} &gt;&gt; $LOG 2&gt;&amp;1
         RC=$?
         HPID=`cat ${CCFG}/${INST}.pid`
         echo "Service $INST started on $HOSTNAME - PID=${HPID} RC=$RC"&gt;&gt; $LOG
         echo "${DASH}" &gt;&gt; $LOG 2&gt;&amp;1       
         ;;
 stop )  echo -e "\n${DASH}" &gt;&gt; $LOG 2&gt;&amp;1
         echo -e "Stopping Service $INST on $HOSTNAME at `date` " &gt;&gt; $LOG
         HPID=`cat ${CCFG}/${INST}.pid`
         echo -e "Killing PID ${HPID}" &gt;&gt; $LOG 2&gt;&amp;1
         kill $HPID  &gt; /dev/null 2&gt;&amp;1
         echo -e "Service $INST is stopped ..." &gt;&gt; $LOG 2&gt;&amp;1
         RC=0
         echo "${DASH}" &gt;&gt; $LOG 2&gt;&amp;1       
         ;;
 status) COUNT=`ps -ef | grep ${HCFG}| grep -v grep | wc -l`
         HPID=`cat ${CCFG}/${INST}.pid`
         echo -n "`date` Service $INST ($COUNT) on $HOSTNAME"&gt;&gt; $LOG 2&gt;&amp;1
         if [ $COUNT -gt 0 ]
            then echo " - PID=${HPID} - OK"  &gt;&gt; $LOG 2&gt;&amp;1
                 RC=0
            else echo " - NOT RUNNING" &gt;&gt; $LOG 2&gt;&amp;1
                 ps -ef | grep -i ${HCFG} | grep -v grep  &gt;&gt; $LOG 2&gt;&amp;1
                 RC=1
         fi
         ;;
esac
exit $RC</pre>
<h2>Updating our cluster Configuration</h2>
<p>To add our web service, please follow the same sequence as we did when we inserted our ftp service into the cluster configuration. You only need to replace &#8220;srv_ftp.sh&#8221; by &#8220;srv_www.sh&#8221; and the script path will be the same, we have decide to place our scripts into the directory &#8220;/cadmin/srv&#8221;. Once we have push the new configuration to all servers in the cluster, we should now have a working cluster.The web site define in the configuration have its &#8220;Root Directory&#8221; set to &#8220;/cadmin/www/html&#8221; it contains only one file that will display the name of the it is running on. The will help us testing our cluster configuration.</p>
<p>I you wish to use the cluster configuration, scripts and configuration files we have used in this series of articles, I would encourage you to download the &#8220;<a title="Complete Working Environment" href="http://linternux.com/download/cluster/cadmin.tar">cadmin.tar</a>&#8221; file. The file is the actual content of the &#8220;/cadmin&#8221; directory used throught out this article. To use it, download the &#8220;<a href="http://linternux.com/download/cluster/cadmin.tar">cadmin.tar</a>&#8221; file then copy it to your &#8220;/cadmin&#8221; directory and enter the command &#8220;tar -xvf ./cadmin.tar&#8221;. This will explode the tar file and then you will have the working envirionnment I used in this article.</p>
<h2>Testing our ftp service</h2>
<p>So here we are (finally you would say &#8230; hum me too), we have now a fully working cluster. So if we issue the &#8220;clustat&#8221; command this is what we should see.</p>
<pre>root@gollum:/# <strong>clustat</strong>
Cluster Status for our_cluster @ Sat Apr 16 11:37:25 2011
Member Status: Quorate

 Member Name                        ID   Status
 ------ ----                       ---- ------
 hbbilbo.maison.ca                    1 Online, rgmanager
 hbgandalf.maison.ca                  2 Online, rgmanager
 hbgollum.maison.ca                   3 Online, Local, rgmanager

 Service Name                     Owner (Last)            State        
 ------- ----                     ----- ------            -----        
 <strong>service:srv_ftp                  hbgollum.maison.ca      started </strong>     
 service:srv_www                  hbbilbo.maison.ca       started      
root@gollum:/#</pre>
<p>From the information above, we can see that all our cluster member status are online and that the resource manager is running on all of them. The resource manager is important, it is responsable for moving service around when needed.  Our service &#8220;srv_ftp&#8221; is started (running) on the &#8220;hbgollum&#8221; server and &#8220;srv_www&#8221; is running on the &#8220;hbbilbo&#8221; like we decided at the beginning (remember ?</p>
<pre>root@gollum:/#<strong> ip addr show | grep 192</strong>
    inet 192.168.1.104/24 brd 192.168.1.255 scope global eth0
    inet <strong>192.168.1.204</strong>/24 scope global secondary eth0
root@gollum:/#
root@gollum:/#<strong> ps -ef | grep vsftpd | grep -v grep</strong>
root      7858     1  0 10:05 ?        00:00:00 /usr/sbin/vsftpd /cadmin/cfg/srv_ftp.conf
root@gollum:/#</pre>
<p>The command &#8220;ip addr show | grep 192&#8221;  is confirming that the virtual IP is defined on &#8220;hbgollum&#8221; server and if we check if the ftp process is also running, we can see that it is. So let&#8217;s try to do an FTP to our virtual IP that we have name &#8220;ftp.maison.ca&#8221; (192.168.1.204). We will try it from the &#8220;gandalf&#8221; server and we see that it is working.</p>
<pre><strong>root@gandalf:/# ftp ftp.maison.ca</strong>
Connected to ftp.maison.ca.
220 ftp.maison.ca
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (ftp.maison.ca:root):</pre>
<p>&nbsp;</p>
<p>Now let&#8217;s move the ftp service from &#8220;hbgollum&#8221; to &#8220;hbbilbo&#8221;, to see if the ftp service will continue to work. To move the service we will use the &#8220;clusvcadm&#8221; command, we need to specify the service name we need to relocate (-r) and the server (-m for machine) we wish to move it. You can issue the &#8220;clusvccmd&#8221; command on any of the server within our cluster. So enter the following command to move our service to &#8220;hbbilbo&#8221; ;</p>
<pre>root@gandalf:/# <strong>clusvcadm -r srv_ftp -m hbbilbo</strong>
'hbbilbo' not in membership list
Closest match: 'hbbilbo.maison.ca'
Trying to relocate service:srv_ftp to hbbilbo.maison.ca...Success
service:srv_ftp is now running on hbbilbo.maison.ca
root@gandalf:/#</pre>
<p>Notice that just after pressing [Enter], we got &#8220;&#8216;hbbilbo&#8217; nit in membership list&#8221;, this is because we did not mention the domain name &#8216;maison.ca&#8217;, but it managed to assume that we were refering to &#8220;hbbilbo.maison.ca&#8221;. So our command succeeded, so let&#8217;s see if everything went like it should have.</p>
<p>Fisrt, let&#8217;s execute the clustat command to see in the &#8220;srv_ftp&#8221; service is now running on &#8216;hbbilbo&#8217;.</p>
<pre>root@gandalf:/# <strong>clustat </strong>
Cluster Status for our_cluster @ Sat Apr 16 12:10:01 2011
Member Status: Quorate

 Member Name                      ID   Status
 ------ ----                      ---- ------
 hbbilbo.maison.ca                    1 Online, rgmanager
 hbgandalf.maison.ca                  2 Online, Local, rgmanager
 hbgollum.maison.ca                   3 Online, rgmanager

 Service Name            Owner (Last)            State
 ------- ----            ----- ------            -----
<strong> service:srv_ftp         hbbilbo.maison.ca       started      </strong>
 service:srv_www         hbbilbo.maison.ca       started
root@gandalf:/#</pre>
<p>We can see that our ftp service is now running on &#8220;hbbilbo&#8221;, let&#8217;s see if it reallly is. If we check if the 192.168.1.204 (ftp.maison,ca) is now defined on &#8220;hbbilbo&#8217; we can see that it is. The FTP process is also running now on the server.</p>
<pre><strong>root@bilbo:~# ip addr show | grep 192</strong>
    inet 192.168.1.111/24 brd 192.168.1.255 scope global eth0
    inet 192.168.1.211/24 scope global secondary eth0
    inet 192.168.1.204/24 scope global secondary eth0
root@bilbo:~# <strong>ps -ef | grep vsftpd | grep -v grep</strong>
root      8616     1  0 12:05 ?        00:00:00 /usr/sbin/vsftpd /cadmin/cfg/srv_ftp.conf
root@bilbo:~#</pre>
<p>But what happen on &#8216;hbgollum&#8217;, the IP 192.168.1.204 should not be there anymore and the FTP process should not be running anymore. So that&#8217;s what happen the IP is gone and the ftp process is no longer running. So far so good, the move to &#8216;hbbilbo&#8217; server have worked.</p>
<pre><strong>root@gollum:/etc/profile.d#<strong> ip addr show | grep 192</strong></strong>
    inet 192.168.1.104/24 brd 192.168.1.255 scope global eth0
root@gollum:/etc/profile.d# ps -ef | grep vsftpd | grep -v grep
root@gollum:/etc/profile.d#</pre>
<p>The last test if to try to do an ftp to ftp.maison.ca and see if it respond.</p>
<pre>root@gandalf:/# <strong>ftp ftp.maison.ca</strong>
Connected to ftp.maison.ca.
220 ftp.maison.ca
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (ftp.maison.ca:root):</pre>
<p>Great evrything worked !! Let&#8217;s move the ftp process back to &#8216;hbgollum&#8217; before testing our web site. Open another terminal window and enter the &#8220;clustat -i 2&#8221; command and see watch the status change from &#8216;started/stopping/starting/started&#8217; while the move is going on. Check your /var/log/message and familiar yourself with the line recorded when the move happen.</p>
<pre>root@gandalf:/# <strong>clusvcadm -r srv_ftp -m hbgollum</strong>
'hbgollum' not in membership list
Closest match: 'hbgollum.maison.ca'
Trying to relocate service:srv_ftp to hbgollum.maison.ca...Success
service:srv_ftp is now running on hbgollum.maison.ca
root@gandalf:/#</pre>
<p>One of the test we should make, is to unplug the network cable or poweroff &#8220;hbgollum&#8221; and see if the service move to the next server in the failover domain (It will). So we have now completed and tested our ftp service. It as been a long road but it woth it, no ?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Testing our web service</h2>
<p>You know now, how to move service from server to another, Let&#8217;s do the same test with our web server service. The web site is actually just one simple page. It just display the name of the server that it is running on, this simplify our testing.</p>
<p>If we issue the &#8220;clustat&#8221; command we should have the following picture ;</p>
<pre># <strong>clustat</strong>
Cluster Status for our_cluster @ Sat Apr 16 14:15:37 2011
Member Status: Quorate

Member Name                      ID   Status
------ ----                      ---- ------
hbbilbo.maison.ca                    1 Online, rgmanager
hbgandalf.maison.ca                  2 Online, Local, rgmanager
hbgollum.maison.ca                   3 Online, rgmanager

Service Name            Owner (Last)            State
------- ----            ----- ------            -----
service:srv_ftp         hbgollum.maison.ca      started
<strong>service:srv_www         hbbilbo.maison.ca       started</strong></pre>
<p>Let&#8217;s see if it is working, open your browser type this URL &#8220;http://www.maison.ca&#8221; , you should have a the following ;</p>
<p style="text-align: center;"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/www_bilbo.png"><img loading="lazy" class="size-medium wp-image-1911 aligncenter" title="www_bilbo" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/www_bilbo-300x92.png" alt="" width="300" height="92" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/04/www_bilbo-300x92.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/04/www_bilbo-1024x316.png 1024w, http://linternux.com/wordpress/wp-content/uploads/2011/04/www_bilbo.png 1031w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p style="text-align: left;">Now, let&#8217;s move the wev site to &#8220;gandalf&#8221; server, type the following command ;</p>
<pre>root@gollum:/cadmin/cfg# <strong>clusvcadm -r srv_www -m hbgandalf</strong>
'hbgandalf' not in membership list
Closest match: 'hbgandalf.maison.ca'
Trying to relocate service:srv_www to hbgandalf.maison.ca...Success
service:srv_www is now running on hbgandalf.maison.ca
root@gollum:/cadmin/cfg#
root@gollum:/cadmin/cfg#<strong> clustat</strong>
Cluster Status for our_cluster @ Sat Apr 16 14:27:14 2011
Member Status: Quorate

 Member Name                         ID   Status
 ------ ----                         ---- ------
 hbbilbo.maison.ca                       1 Online, Local, rgmanager
 hbgandalf.maison.ca                     2 Online, rgmanager
 hbgollum.maison.ca                      3 Online, rgmanager

 Service Name               Owner (Last)               State
 ------- ----               ----- ------               -----
 service:srv_ftp            hbgollum.maison.ca         started
<strong> service:srv_www            hbgandalf.maison.ca        started </strong></pre>
<p style="text-align: left;"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/04/www_gandalf.png"><img loading="lazy" class="aligncenter size-medium wp-image-1913" title="www_gandalf" src="http://linternux.com/wordpress/wp-content/uploads/2011/04/www_gandalf-300x92.png" alt="" width="300" height="92" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/04/www_gandalf-300x92.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/04/www_gandalf-1024x316.png 1024w, http://linternux.com/wordpress/wp-content/uploads/2011/04/www_gandalf.png 1031w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p style="text-align: left;">&nbsp;</p>
<p>We can see that the web site is now running on &#8220;gandalf&#8221; server.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Disabling and Enabling Services</h2>
<p>There may come a time, when you need to stop a service completely. We will demonstrate how to acheive that, first let&#8217;s display the status of our cluster</p>
<pre>root@bilbo:~# <strong>clustat</strong>
Cluster Status for our_cluster @ Sat Apr 16 14:39:48 2011
Member Status: Quorate

 Member Name                                  ID   Status
 ------ ----                                  ---- ------
 hbbilbo.maison.ca                                1 Online, Local, rgmanager
 hbgandalf.maison.ca                              2 Online, rgmanager
 hbgollum.maison.ca                               3 Online, rgmanager

 Service Name                        Owner (Last)                        State
 ------- ----                        ----- ------                        -----
 service:srv_ftp                     hbgollum.maison.ca                  started
<strong> service:srv_www                     hbgandalf.maison.ca                 started  </strong></pre>
<p>We are going to disable the &#8220;srv_www&#8221; service, to do so enter the following command ;</p>
<pre>root@bilbo:~# <strong>clusvcadm -d srv_www </strong>
Local machine disabling service:srv_www...Success</pre>
<p>The clustat command show us that the service is now disable.</p>
<pre>root@bilbo:~# <strong>clustat</strong>
Cluster Status for our_cluster @ Sat Apr 16 14:40:04 2011
Member Status: Quorate

 Member Name                                  ID   Status
 ------ ----                                  ---- ------
 hbbilbo.maison.ca                                1 Online, Local, rgmanager
 hbgandalf.maison.ca                              2 Online, rgmanager
 hbgollum.maison.ca                               3 Online, rgmanager

 Service Name                        Owner (Last)                        State
 ------- ----                        ----- ------                        -----
 service:srv_ftp                     hbgollum.maison.ca                  started
 service:srv_www                     (hbgandalf.maison.ca)               disabled</pre>
<p>We will now enable the service, but this time we will enable it on another server than &#8220;hbgandalf&#8221;. This command enable the &#8220;srv_www&#8221; service on the server &#8220;hbbilbo&#8221;.</p>
<pre>root@bilbo:~# <strong>clusvcadm -e srv_www -m hbbilbo</strong>
'hbbilbo' not in membership list
Closest match: 'hbbilbo.maison.ca'
Member hbbilbo.maison.ca trying to enable service:srv_www...Success
service:srv_www is now running on hbbilbo.maison.ca
root@bilbo:~#</pre>
<p>We can see the it is now running on &#8220;hbbilbo&#8221;.</p>
<pre>root@bilbo:~# <strong>clustat</strong>
Cluster Status for our_cluster @ Sat Apr 16 14:47:36 2011
Member Status: Quorate

 Member Name                                  ID   Status
 ------ ----                                  ---- ------
 hbbilbo.maison.ca                                1 Online, Local, rgmanager
 hbgandalf.maison.ca                              2 Online, rgmanager
 hbgollum.maison.ca                               3 Online, rgmanager

 Service Name                        Owner (Last)                        State
 ------- ----                        ----- ------                        -----
 service:srv_ftp                     hbgollum.maison.ca                  started
<strong> service:srv_www                     hbbilbo.maison.ca                   started  </strong>
root@bilbo:~#</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>This conclude our implementation of a small cluster. It was intended just to show every one how the Red Hat Cluster Suite actually work and to give a brief overview how it work. We will now move on to other interesting topic. Don&#8217;t know what it will be, but I can assure that it should fit into one article, So I hope you appreciate it and hope to see you soon.</p>
<p>&nbsp;</p>
<p><a title="Part 1 - Creating a RedHat/CentOS Cluster" href="http://linternux.com/2010/11/creating-cluster-part-1/" target="_blank">Part 1 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a href="http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/" target="_blank">Part 2 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 3 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/03/creating-a-red-hatcentos-cluster-part-3/" target="_blank">Part 3 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 4 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-4/" target="_blank">Part 4 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 5 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-5/" target="_blank">Part 5 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p>&nbsp;</p>
<style>.pf-button.pf-button-excerpt { display: none; }</style>]]></content:encoded>
					
					<wfw:commentRss>http://linternux.com/2011/04/creating-a-redhat-cluster-part-5/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Red Hat Cluster: Part 4</title>
		<link>http://linternux.com/2011/04/creating-a-redhat-cluster-part-4/</link>
					<comments>http://linternux.com/2011/04/creating-a-redhat-cluster-part-4/#respond</comments>
		
		<dc:creator><![CDATA[Jacques Duplessis]]></dc:creator>
		<pubDate>Sun, 03 Apr 2011 15:46:02 +0000</pubDate>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[cluster]]></category>
		<guid isPermaLink="false">http://linternux.com/?p=1647</guid>

					<description><![CDATA[Welcome back to LINternUX, where we continue the creation of our cluster. By now you should have a working cluster running an ftp service and a web service. Although the service are created, our ftp and web service are not really running yet. In this article we will create a GFS filesystem that will allows [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Welcome back to LINternUX, where we continue the creation of our cluster. By now you should have a working cluster running an ftp service and a web service. Although the service are created, our ftp and web service are not really running yet. In this article we will create a GFS filesystem that will allows us to share data between nodes. In the next and last article we&#8217;ll finalise the cluster by completing our ftp and web service so they really work. We will also show you how to manually move service from one server to another. So we still have some work to do, so let&#8217;s start right away.</p>
<p>&nbsp;</p>
<h2>Adding a SAN disk to our servers</h2>
<p>The Linux operating system is installed on the internal disks for each of our server. We will now add a SAN disk that will be visible be each of our server. I assume here that your SAN and your Brocade switch are configure accordingly. Explaining how to set up the SAN and the Brocade switch is not in the scope of this article. But I think that you get the idea that the new disk must be visible by every node in our cluster. In the example below we already have a SAN disk (sda) with one partition (sda1) on it. Adding a disk to the server, can be done (live) without any interruption of service, if you follow the steps below. I would suggest you practice on a test server, to become familiar with the procedure.</p>
<p>Before we add a disk, let’s see what are the visible disks on the system, by looking at the /proc/partitions file. We can see that we already have a disk (sda) with one partition on it. So the new disk that we&#8217;re going to add, should be seen as &#8220;sdb&#8221;.</p>
<blockquote><p>root@gollum~# <span style="color: #0000ff;"><strong>grep sd /proc/partitions</strong></span><br />
8     0  104857920 sda<br />
8     1  104856223 sda1</p></blockquote>
<p>Let&#8217;s rescan the SCSI bus by typing the command below. This command must be run on each of the server within the cluster. Here, we have only one HBA (Host Base Adapter)  card connected to the SAN on each server. If you have a second HBA, you need to run the same command for the second HBA, but replace the &#8220;host0&#8221; by &#8220;host1&#8221;.</p>
<blockquote><p>root@gollum~#  <strong><span style="color: #0000ff;">echo &#8220;- &#8211; -&#8221; &gt; /sys/class/scsi_host/host0/scan</span></strong><br />
root@gandalf~# <strong><span style="color: #0000ff;"> echo &#8220;- &#8211; -&#8221; &gt; /sys/class/scsi_host/host0/scan</span></strong><br />
root@bilbo~#    <span style="color: #0000ff;"> <strong>echo &#8220;- &#8211; -&#8221; &gt; /sys/class/scsi_host/host0/scan</strong></span></p></blockquote>
<p>Let’s see if we have some new disk(s) that were detected (sdb) (check each servers)</p>
<blockquote><p>root@gollum~# <span style="color: #0000ff;"><strong>grep sd /proc/partitions</strong></span><br />
8     0  104857920 sda<br />
8     1  104856223 sda1<br />
<span style="color: #0000ff;">8    16   15728640 sdb</span></p></blockquote>
<p><span id="more-1647"></span></p>
<p>Let’s create a LVM partition on our new disk (sdb) by running the &#8220;fdisk&#8221; command..</p>
<blockquote><p># <strong><span style="color: #0000ff;">fdisk /dev/sdb</span></strong></p>
<p>Command (m for help): p</p>
<p>Disk /dev/sdh: 107.3 GB, 107374510080 bytes<br />
255 heads, 63 sectors/track, 13054 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Device Boot      Start         End      Blocks   Id  System</p>
<p>Command (m for help):<strong> n </strong><span style="color: #0000ff;">(n=new partition)</span><br />
Command action<br />
e   extended<br />
p   primary partition (1-4) <strong>p</strong><span style="color: #0000ff;"> (p=primary partition)</span><br />
Partition number (1-4):<strong> 1</strong><span style="color: #0000ff;"> (first partition =1)</span><br />
First cylinder (1-13054, default 1):  <strong>1 </strong><span style="color: #0000ff;"> (Start at the beginning of disk)</span><br />
Last cylinder or +size or +sizeM or +sizeK (1-13054, default 13054): <strong>13054</strong><span style="color: #0000ff;"> (End of the Disk)</span><br />
Command (m for help): <strong>p</strong><span style="color: #0000ff;"> (p=Print partition information)</span></p>
<p>Disk /dev/sdh: 107.3 GB, 107374510080 bytes<br />
255 heads, 63 sectors/track, 13054 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Device Boot      Start         End      Blocks   Id  System<br />
<strong>/dev/sdb1               1       13054   104856223+  83  Linux</strong></p>
<p>Command (m for help): <strong>t</strong> <span style="color: #0000ff;">(t=type of partition)</span><br />
Selected partition <strong>1</strong><span style="color: #0000ff;"> (Change type of partition 1)</span><br />
Hex code (type L to list codes): <strong>8e</strong><span style="color: #0000ff;"> (8e=LVM partition &#8211; Type L to list partition code)</span><br />
Changed system type of partition 1 to 8e (Linux LVM)<br />
Command (m for help): <strong>p</strong><span style="color: #0000ff;"> (</span><span style="color: #0000ff;">p=print partition information)</span><strong><br />
</strong></p>
<p>Disk /dev/sdh: 107.3 GB, 107374510080 bytes<br />
255 heads, 63 sectors/track, 13054 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Device Boot      Start         End      Blocks   Id  System<br />
<strong>/dev/sdb1               1       13054   104856223+  8e  Linux LVM</strong></p>
<p>Command (m for help): <strong>w</strong><span style="color: #0000ff;"> (w=write partition to disk)</span><strong><br />
</strong></p>
<p>The partition table has been altered!<br />
Calling ioctl() to re-read partition table.<br />
Syncing disks.</p></blockquote>
<p>If we look again at our /proc/partition, we should see our new disk and partition are being seen by this server.</p>
<blockquote><p>root@gollum~# <span style="color: #0000ff;"><strong>grep sd /proc/partitions</strong></span><br />
8     0  104857920 sda<br />
8     1  104856223 sda1<br />
<strong><span style="color: #0000ff;">8    16   15728640 sdb</span></strong><br />
<strong> <span style="color: #0000ff;">8    16   15727658 sdb1</span></strong></p></blockquote>
<p>Now we need to make sure that the new disk and partition are seen by every servers within the cluster. We now need to go on every servers in the cluster and run the command &#8220;partprobe&#8221; (Partition probe). After running the command, you should check like we did on &#8220;gollum&#8221;, if all the disks and partitions are seen by each servers.</p>
<blockquote><p>root@gollum~#<span style="color: #0000ff;"> <strong>partprobe</strong></span><br />
root@gandalf~#<span style="color: #0000ff;"> <strong>partprobe</strong></span><br />
root@bilbo~# <span style="color: #0000ff;"><strong>partprobe</strong></span></p></blockquote>
<p>&nbsp;</p>
<p><strong>Creating our physical volume</strong></p>
<p>Now that we know that the disk is seen by every node, let&#8217;s create the physical volume on one of the server and then check on all others servers in the cluster, the physical should be seen on all the servers. The command to create a physical volume is &#8220;pvcreate&#8221;, so what we are really doing here, is creating a physical volume of the partition (/dev/sdb1) we created earlier.</p>
<blockquote><p>#<strong><span style="color: #0000ff;"> pvcreate /dev/sdb1</span></strong><br />
Physical volume &#8220;/dev/sdb1&#8221; successfully created</p></blockquote>
<p>Let&#8217;s run a pvscan on every node, to validate that every node can actually see the new disk.</p>
<blockquote><p># <strong><span style="color: #0000ff;">pvscan</span><br />
</strong>PV /dev/sda1           VG     datavg      lvm2 [100.00 GB / 22.02 GB free]<br />
<span style="color: #0000ff;">PV /dev/sdb1                                                 lvm2 [100.00 GB]</span></p></blockquote>
<p>&nbsp;</p>
<p><strong>Create our clustered volume group</strong></p>
<p>We will now create a new volume group named &#8220;sharevg&#8221; and we will assign the physical volume &#8220;/dev/sdb1&#8221; as part of that group. If we ever ran out of disk space within &#8220;sharevg&#8221;, we could add another physical volume to the volume group and continue to work without any service disruption. This is a real advantage when working in production environment.</p>
<blockquote><p><strong><br />
# <span style="color: #0000ff;">vgcreate  sharevg /dev/sdb1</span></strong><br />
Clustered volume group &#8220;sharevg&#8221; successfully created</p></blockquote>
<p>&nbsp;</p>
<p><strong>Display the &#8220;sharevg&#8221; volume group properties</strong></p>
<p>We  can display the volume group properties by issueing the &#8220;vgdisplay&#8221; command. We can see that our volume group is &#8220;Clustered&#8221;, so it is cluster aware. This will allow later on,  to create &#8220;LV&#8221; (Logical volume/Filesystem) on one server and have the cluster software automatically advise the cluster member that a new logical volume (filesystem) is available.<strong><br />
</strong></p>
<pre>root@gollum~# <strong><span style="color: #0000ff;">vgdisplay sharevg</span></strong>
 --- Volume group ---
<strong><span style="color: #0000ff;"> VG Name               sharevg</span></strong>
 System ID            
 Format                lvm2
 Metadata Areas        1
 Metadata Sequence No  25
 VG Access             read/write
 VG Status             resizable
<strong><span style="color: #0000ff;"> Clustered             yes</span></strong>
 Shared                no
 MAX LV                0
 Cur LV                0
 Open LV               0
 Max PV                0
 Cur PV                1
 Act PV                1
 VG Size               100.00 GB
 PE Size               4.00 MB
 Total PE              24999
 Alloc PE / Size       1 / 2.10 MB
 Free  PE / Size       24980 / 98.00 GB
 VG UUID               V8Ag76-vdW2-NAk4-JjOo-or3l-GuPz-x5LEKP</pre>
<p>&nbsp;</p>
<p><strong>Create a logical volume of 1024MB named &#8220;cadmin&#8221; of the &#8220;sharevg&#8221; volume group</strong></p>
<p>We will create a logical volume named &#8220;cadminlv&#8221; (Cluster Admin), in our sharevg volume group. The command below is asking to create a logical volume of 1024MB, name &#8220;cadminlv&#8221; in the volume group &#8220;sharevg&#8221;.  This command can be done one server and the logical volume will be seen by every member of the cluster.<strong><br />
</strong></p>
<blockquote><p><span style="color: #0000ff;"><strong>#/usr/sbin/lvcreate -L1024M -n cadminlv sharevg</strong></span><br />
Logical volume &#8220;cadminlv&#8221; created</p></blockquote>
<p>&nbsp;</p>
<p>The &#8220;lvs&#8221; command allow you to display a list of all your logical volumes. Since this is currently the only one on the volume group &#8220;sharevg&#8221;, we filter the list (with the grep command) to only display the logical volume on &#8220;sharevg&#8221; volume group.Let’s check if it seen by all nodes.</p>
<blockquote><p>root@gandalf~# <strong><span style="color: #0000ff;">lvs | grep sharevg</span></strong><br />
cadminlv    sharevg -wi-a- 1024.00M</p>
<p>root@gollum~# <span style="color: #0000ff;"><strong>lvs | grep sharevg</strong></span><br />
cadminlv    sharevg -wi-a- 1024.00M</p>
<p>root@bilbo~#<span style="color: #0000ff;"> <strong>lvs | grep sharevg</strong></span><br />
cadminlv    sharevg -wi-a- 1024.00M</p></blockquote>
<p>&nbsp;</p>
<h2>Creating the /cadmin GFS Filesystem</h2>
<p>Finally, we are going to create a GFS filesystem within that logical volume &#8220;cadminlv&#8221; we&#8217;ve just created. But first we need to create our GFS filesystem mount point on every nodes. We need to do that, because we want this filesystem to be mounted on every node and be available for the 3 nodes.</p>
<blockquote><p>root@gandalf~# <strong><span style="color: #0000ff;">mkdir /cadmin</span></strong></p>
<p>root@bilbo~#    <span style="color: #0000ff;"><strong>mkdir /cadmin</strong></span></p>
<p>root@gollum~# <span style="color: #0000ff;"><strong>mkdir /cadmin</strong></span></p></blockquote>
<p>&nbsp;</p>
<p>We have choosen to have the GFS filesystem &#8220;/cadmin&#8221; to be mounted on all  servers at all time. We could have include it as part of our service,  so it would be mounted only when a service is started. But we found out,  that the process of unmounting and mounting a couple of GFS take time  and this time adds up to the time it take to move a service from one  server to another.  In production we have 5 servers in a cluster for  more that 2 years now,  we have around 30 GFS mounted at all time on all  the five servers and we had very little problem. The only thing you  have to be careful about is the number of journals that you assign to  each GFS. One journal is needed for each concurrent mount in the  cluster, in our case we have at least 5 journals for each of our GFS  filesystem (more on that below).Create the GFS on the LVM cadmin created previously. This need to be done only on one node, the creation is done once and all the nodes are made aware of the new GFS by the cluster daemon<strong>.</strong></p>
<p>The command we use to create a GFS filesystem is &#8220;gfs_mkfs&#8221;.  We need to use a couple of options and I will explain them all.</p>
<p>First, the &#8220;<strong><span style="color: #0000ff;">-O</span></strong>&#8221;  prevents  &#8220;gfs_mkfs&#8221;  from  asking  for confirmation before creating the filesystem.</p>
<p>The option &#8220;<strong><span style="color: #0000ff;">-p lock_dlm</span></strong>&#8220;, indicate the name of the  locking  protocol to use.  The  locking  protocol should  be  &#8220;lock_dlm&#8221; for a clustered file system.</p>
<p>The &#8220;<strong><span style="color: #0000ff;">-t our_cluster:cadminlv</span></strong>&#8221; It&#8217;s the <em>cluster-name, followed by &#8220;:&#8221; and the logical volume name</em>.  The cluster name must match the one you have defined in your cluster configuration file (in our case &#8220;our_cluster&#8221;),  only members  of  this cluster are permitted to use this file system.  The filesystem name (cadminlv)  is a unique file system name used to distinguish this GFS file system from others created (1 to 16  characters).</p>
<p>The &#8220;-<strong><span style="color: #0000ff;">j 4</span></strong>&#8221; is the number of journals for gfs_mkfs to create.  You need at least one  journal  per machine that will mount the filesystem. This number should have been 3, but I always add one more, in case a add a member in the cluster. This number is important, if I had put 3 and I added a node within the cluster and I wanted the 4 nodes to mount simultaneously this filesystem, I would need to make sure that the filesystem have 4 journals, because the GFS wound not mount. You can always add a journal to an existing GFS filesystem with the &#8220;gfs_jadd&#8221; command. <strong>Each journal reserve 128 MB in the filesystem, so you need take into consideration. </strong>Let look at our example, we want all our nodes to mount the &#8220;/cadmin&#8221; GFS filesystem, we created an logical volume of 1024M and on it we created a GFS, we reserved 4 journals (4*128=512MB) <strong>, </strong>so will have only around 500 MB available for data out of the 1024MB we allocated to our logical volume.<strong><br />
</strong></p>
<p>The last parameter &#8220;<strong><span style="color: #0000ff;">/dev/sharevg/cadmlv</span></strong>&#8221; is the name of the logical volume we created previously.</p>
<blockquote><p># <strong><span style="color: #0000ff;">/sbin/gfs_mkfs -O -p lock_dlm -t our_cluster:cadmlv -j 4 /dev/sharevg/cadmlv</span></strong><br />
Device:                    /dev/sharevg/cadmlv<br />
Blocksize:                 4096<br />
Filesystem Size:           98260<br />
Journals:                  4<br />
Resource Groups:           8<br />
Locking Protocol:          lock_dlm<br />
Lock Table:                our_cluster:cadminlv<br />
Syncing&#8230;<br />
All Done</p></blockquote>
<p>We are now able to mount our GFS filesystem on all the servers, by using the command below on all the servers,</p>
<blockquote><p><strong><span style="color: #0000ff;"># mount -t gfs /dev/sharevg/cadminlv  /cadmin</span></strong></p></blockquote>
<p>We want that filesystem to be mounted every time a server boot, so don’t forget to add your filesystem to /etc/fstab, so it will mount  after the next reboot and don’t forget to change the owner and  protection of the filesystem.</p>
<blockquote><p><span style="color: #0000ff;"><strong># echo “/dev/sharevg/cadminlv /cadmin  gfs defaults 0 0&#8243; &gt;&gt; /etc/fstab</strong></span></p></blockquote>
<p>The filesystem should be available on all our nodes.</p>
<blockquote><p><strong><span style="color: #0000ff;"># df -h /cadmin</span></strong><br />
Filesystem                                                  Size     Used    Avail    Use%  Mounted on<br />
/dev/mapper/sharevg-cadminlv  <strong><span style="color: #0000ff;">510 M</span></strong> 1.5M   508M   1%      <strong><span style="color: #0000ff;">/cadmin</span></strong></p></blockquote>
<p>&nbsp;</p>
<p>So we&#8217;ve just created our first GFS filesystem and it is mounted on all our nodes in the cluster.</p>
<div>
<p>In our last article we will finalise our cluster, by creating the needed scripts for our ftp/web services to start and to move from server to server. We will add these scripts to our cluster configuration and we will show you how to move service from one server to another using the command line and GUI. So stay tune, for this last article on how to build a Red Hat cluster.</p>
<p>&nbsp;</p>
<p><a title="Part 1 - Creating a RedHat/CentOS Cluster" href="http://linternux.com/2010/11/creating-cluster-part-1/" target="_blank">Part 1 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a href="http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/" target="_blank">Part 2 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 3 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/03/creating-a-red-hatcentos-cluster-part-3/" target="_blank">Part 3 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 4 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-4/" target="_blank">Part 4 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 5 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-5/" target="_blank">Part 5 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p>&nbsp;</p>
</div>
<style>.pf-button.pf-button-excerpt { display: none; }</style>]]></content:encoded>
					
					<wfw:commentRss>http://linternux.com/2011/04/creating-a-redhat-cluster-part-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Red Hat Cluster: Part 3</title>
		<link>http://linternux.com/2011/03/creating-a-red-hatcentos-cluster-part-3/</link>
					<comments>http://linternux.com/2011/03/creating-a-red-hatcentos-cluster-part-3/#comments</comments>
		
		<dc:creator><![CDATA[Jacques Duplessis]]></dc:creator>
		<pubDate>Sat, 19 Mar 2011 14:04:33 +0000</pubDate>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[cluster]]></category>
		<guid isPermaLink="false">http://linternux.com/?p=1454</guid>

					<description><![CDATA[Here is the third of a series of article describing how to create a Linux Red Hat/CentOS cluster. At the end of this article, we will have a working cluster, all that will be left to do is the creation of the GFS filesystem and the scripts that will stop, start and give a status [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Here is the third of a series of article describing how to create a Linux Red Hat/CentOS cluster. At the end of this article, we will have a working cluster, all that will be left to do is the creation of the GFS filesystem and the scripts that will stop, start and give a status of our ftp and web services. You can refer to &#8220;<a title="Part 1 of Creating a RedHat cluster" href="http://linternux.com/2010/11/creating-cluster-part-1/" target="_blank">Part1</a> , &#8220;<a title="Part 2 - Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/" target="_blank">Part 2</a>&#8221; and our <a title="Network Diagram of cluster" href="http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster.png">network diagram</a> before reading this article, but for now let&#8217;s move on and continue our journey into building our cluster.</p>
<h2>Defining the fencing devices</h2>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/fence_device_bilbo.png"><img loading="lazy" class="size-medium wp-image-1455 alignleft" title="Create fencing device for bilbo.maison.ca" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/fence_device_bilbo-300x291.png" alt="" width="300" height="291" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/fence_device_bilbo-300x291.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/fence_device_bilbo.png 726w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>The fencing device is use by the cluster software to power-off the node when it is considered in problem. We need to define a fencing device for all the nodes that we defined in the <a title="Part 2 of this article" href="http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/" target="_blank">previous article</a>.</p>
<p>In our cluster, the fencing device used is the HP ILO interface. Select “the “HP ILO Device” from the pull down menu and enter the device information needed to connect to it. If you would like to see what are the fencing device supported by Red Hat cluster, you can consult the fencing FAQ on this <a title="Fencing device FAQ" href="http://sources.redhat.com/cluster/wiki/FAQ/Fencing" target="_blank">page</a>.</p>
<p>You could use <a title="Manual fencing" href="http://sources.redhat.com/cluster/wiki/FAQ/Fencing#fence_manual3" target="_blank">manual fence</a> for testing purpose but it is not supported in a production environment, since manual intervention is required to fence a server.</p>
<ul>
<li>We choose to prefix the fencing device name with a lowercase “f_”, followed by the name assigned to its IP in <a title="/etc/hosts" href="http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster_hosts_file.png" target="_blank">/etc/hosts</a>.</li>
<li>The login name to access the device.</li>
<li>The password used to authenticate to the device.</li>
<li>The host name as defined is our <a title="/etc/hosts file content" href="http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster_hosts_file.png" target="_blank">host file</a> used to connect to the device.</li>
</ul>
<p>&nbsp;</p>
<p>Repeat the operation for each server in the cluster.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/fence_device_gollum1.png"><img loading="lazy" class="size-full wp-image-1483 alignleft" title="Fencing Device for server &quot;gollum&quot;" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/fence_device_gollum1.png" alt="" width="258" height="261" /></a></p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/fence_device_gandalf.png"><img loading="lazy" class="size-full wp-image-1457  alignleft" title="Fencing Device for server &quot;gandalf&quot;" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/fence_device_gandalf.png" alt="" width="258" height="261" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span id="more-1454"></span></p>
<h2>Defining the fence level</h2>
<p>Next, we need to associate a fencing device with each server in our cluster. Let&#8217;s begin by clicking on the node name &#8220;hbbilbo.maison.ca&#8221;, then press on the button name (“Manage Fencing For This Node”) at the bottom right of the screen. You will be presented with a similar screen than the one below.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo.png"><img loading="lazy" class="size-medium wp-image-1459 alignleft" title="Defining fencing for bilbo.maison.ca" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo-300x291.png" alt="" width="300" height="291" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo-300x291.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo.png 725w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now click on the &#8220;Add a New Fence Level&#8221; button, this will create a new fence level named &#8220;Fence_Level-1&#8221;.</p>
<p>Next, select &#8220;Fence-Level-1&#8221; on the left of the screen and then click on the button &#8220;Add a New Fence to this Level&#8221; . A little pop-up will appear, allowing you to assign the  fencing device to the host name. In our case we select the fencing device name &#8220;f_bilbo&#8221;. So we just created an association between a fencing device and a node.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo_2.png"><img loading="lazy" class="size-medium wp-image-1462  alignleft" title="Adding a fence level " src="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo_2-300x259.png" alt="" width="270" height="233" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo_2-300x259.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo_2.png 502w" sizes="(max-width: 270px) 100vw, 270px" /></a></p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo_3.png"><img loading="lazy" class="size-medium wp-image-1471  alignleft" title="Assigning fence level to node" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo_3-300x262.png" alt="" width="270" height="236" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo_3-300x262.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/fencing_bilbo_3.png 501w" sizes="(max-width: 270px) 100vw, 270px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Click on the &#8220;OK&#8221;  button to close the screen above and then press the &#8220;Close&#8221;  button.</p>
<p>Back on this screen, press the &#8220;Close&#8221; button again to end the definition of our fence level.</p>
<p>&nbsp;</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencinv_bilbo_4.png"><img loading="lazy" class="size-medium wp-image-1472  alignleft" title="Fence level assigned to hbbilbo node" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencinv_bilbo_4-300x260.png" alt="" width="300" height="260" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/fencinv_bilbo_4-300x260.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/fencinv_bilbo_4.png 500w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>We need to repeat the operation for each node in our cluster.</p>
<p>Once a fence level is created for all nodes, you can proceed with the next step.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Define Failover Domain</h2>
<p>A failover domain is a named subset of cluster nodes that are eligible to run a cluster service in the event of a node failure. The name of our failover domain, will always begin with “fd_<em>” </em>(lowercase), this is the standard that I choose.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/FailDomain_1.png"><img loading="lazy" class="size-medium wp-image-1505  alignleft" title="Creating a failover Domain" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/FailDomain_1-300x292.png" alt="" width="300" height="292" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/FailDomain_1-300x292.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/FailDomain_1.png 725w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>So let&#8217;s begin defining our failover domain, by clicking on &#8220;Failover Domains&#8221; on the right side of the GUI and pressing the &#8220;Create a Failover Domain&#8221; button.</p>
<p>Now enter the name of the failover domain, in this case for &#8220;bilbo&#8221; server will be &#8220;fd_bilbo&#8221; to stick to our standard.  Press the &#8220;OK&#8221; button to proceed.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/FailDomain_2.png"><img loading="lazy" class="size-medium wp-image-1506 alignleft" title="Defining hbbilbo.maison.ca failover Domain" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/FailDomain_2-300x262.png" alt="" width="300" height="262" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/FailDomain_2-300x262.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/FailDomain_2.png 397w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_3.png"><img loading="lazy" class="size-medium wp-image-1507 alignleft" title="Defining where bilbo service are allow to be move" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_3-300x259.png" alt="" width="300" height="259" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_3-300x259.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_3.png 397w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>The failover domain configuration, list all the servers that will be part of the specified failover domain. We choose, that each member of the cluster will be listed in our failover domain.</p>
<p>So<strong> <em>select each server one at a time from the selection list &#8220;Available Cluster Nodes&#8221;</em></strong> , until they have all been selected.  When all the servers are selected, the selection list will display &#8220;No Cluster Nodes Available&#8221;.</p>
<p>We choose to <strong><em>restrict the failover domain</em></strong> to the list of servers we have included. This means all of them for this cluster, but they can be situation were you could have six nodes in a cluster and we want one service to run on only three of the servers because they have more cpu and memory then the three others .</p>
<p>We also want the service to be prioritized, <strong>check the “Prioritized List” checkbox</strong>.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_4.png"><img loading="lazy" class="size-medium wp-image-1508 alignleft" title="Gandalf Failover Domain" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_4-300x261.png" alt="" width="300" height="261" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_4-300x261.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_4.png 396w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_5.png"><img loading="lazy" class="size-medium wp-image-1509 alignleft" title="Failover Domain for gollum server" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_5-300x261.png" alt="" width="300" height="261" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_5-300x261.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/failDomain_5.png 398w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>You may then highlight the nodes listed in the “Member Node” box and click the “Adjust Priority”  buttons to select the order in which the failover should occur. The node with the highest priority (priority 1) will be the initial node for running the service. If that node fails, the service will be relocated to the node with the next higher priority (priority 2) and so forth.</p>
<p>So for the failover domain  &#8220;fd_bilbo&#8221;  the &#8220;hbbilbo&#8221;  will be prioritize (1), if the server is power-off then the service will be move to &#8220;hbgandalf&#8221; (2) our passive node and if it unavailable then service will move to the server &#8220;hbgollum&#8221; (3).</p>
<p>The preferred server for the failover domain &#8220;fd_gollum&#8221; will be &#8220;hbgollum&#8221; (1), if it is not available then our passive server &#8220;hbgandalf&#8221;  (2) will take over. And in the eventuality that the two servers are not available then &#8220;hbbilbo&#8221; (3) will take over.</p>
<p>For the failover domain &#8220;fd_gandalf&#8221; we have choosen to give &#8220;hbgandalf&#8221;  priority one, &#8220;hbgollum&#8221; priority two and three to &#8220;hbbilbo&#8221; .</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Defining cluster resources</h2>
<p>Cluster resource can be IP addresses, scripts, NFS and/or GFS filesystem mount point, database that are needed to run a service. In this case our services will be a FTP and a web site.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Ressource_IP1.png"><img loading="lazy" class="size-medium wp-image-1523 alignleft" title="Defining a new IP resource" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Ressource_IP1-300x292.png" alt="" width="300" height="292" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/Ressource_IP1-300x292.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/Ressource_IP1.png 725w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>If you remember inl our <a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster.png">cluster network diagram</a>, we&#8217;ll be running 2 services in our cluster. The first service will be a FTP server name &#8220;ftp.maison.ca&#8221; running at IP 192.168.1.204 and a web service &#8220;www.maison.ca&#8221; running at IP 192.168.2.211.</p>
<p>So let&#8217;s define an &#8220;IP Resource&#8221; for our ftp server at 192.168.1.204. Click on &#8220;Resources&#8221; on the left part of the screen and then click on the button &#8220;Create a Resource&#8221;  at the lower right of the screen. From the drop down list, select the &#8220;IP Address&#8221; resource type.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Ressource_IP21.png"><img loading="lazy" class="size-medium wp-image-1539 alignleft" title="Defining our IP Resource for ftp service" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Ressource_IP21-300x292.png" alt="" width="300" height="292" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/Ressource_IP21-300x292.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/Ressource_IP21.png 725w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Enter the IP of our ftp server &#8220;192.168.1.204&#8221; and make sure that the &#8220;Monitor Link&#8221; check box is selected. That means that if for a reason or another this IP is no longer responding, then this will trigger the move of our ftp service to the next server that we have defined in our failover domain for that node.</p>
<p>Repeat the process for our web site at IP 192.168.1.211.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Defining our cluster services</h2>
<p>We have decided that we would be running two services in our cluster, one for the ftp and one for the web site.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/service_01.png"><img loading="lazy" class="size-medium wp-image-1543 alignleft" title="Creating our ftp service" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/service_01-300x291.png" alt="" width="300" height="291" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/service_01-300x291.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/service_01.png 725w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Now is the time to define these services, we will begin by creating our ftp service. Click on &#8220;Services&#8221; on the bottom left of the screen and then press the button called &#8220;Create a Service&#8221; to begin the process.</p>
<p>First, we need to assign a name to our service, we choose to prefix our service by &#8220;srv_&#8221; , this will be our standard. We choose a short name, because they are nicer when they are displayed by the &#8220;clustat&#8221; command that we will see later on. So enter the service name &#8220;srv_ftp&#8221; and click on the &#8220;OK&#8221; button.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_02.png"><img loading="lazy" class="size-medium wp-image-1544 alignleft" title="Assign our ftp service to a failover domain fd_gollum" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_02-300x275.png" alt="" width="300" height="275" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_02-300x275.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_02.png 672w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Next you will see a screen similar to this one.</p>
<p>First we need to<strong> assign a failover domain</strong> to our ftp service. As planned on our<a title="Cluster Network Diagram" href="http://linternux.com/wordpress/wp-content/uploads/2011/02/cluster.png" target="_blank"> cluster network diagram</a> we were going to run the ftp service on the gollum server, so from the failover domain drop down list we select the failover domain &#8220;fd_gollum&#8221; for our ftp service.</p>
<p>Next we need to make our FTP server IP (192.168.1.204)  part of the service. To do so <strong>click on the button &#8220;Add a Shared Resource to this service&#8221;</strong> and select the IP used for our ftp service.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_03.png"><img loading="lazy" class="size-full wp-image-1545 alignleft" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_03.png" alt="" width="143" height="74" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_04.png"><img loading="lazy" class="alignleft size-full wp-image-1546" title="Select our FTP service IP" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_04.png" alt="" width="282" height="260" /></a></p>
<p>After pressing the button above,  you should see a screen similar to this one.</p>
<p>Click on the IP that our ftp server will use (192.168.2.204) and press the &#8220;OK&#8221; button.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_05.png"><img loading="lazy" class="size-medium wp-image-1547  alignleft" title="Include the FTP IP into the FTP service" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_05-300x263.png" alt="" width="300" height="263" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_05-300x263.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_05.png 562w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>One last thing before finishing the definition of our ftp service,<strong> make sure you select &#8220;Relocate&#8221; from the &#8220;Recovery Policy&#8221;</strong>. This allow our service to be move automatically to another server if the FTP service become inaccessible.</p>
<p>We can now press the &#8220;Close&#8221; button and repeat the operation to create of our web service.</p>
<p>Follow the name procedure as the ftp service to create the web service.</p>
<p>The name that we decided to call the service for the web site is &#8220;srv_www&#8221; .</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_06.png"><img loading="lazy" class="size-full wp-image-1548" title="The name of our web service" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_06.png" alt="" width="241" height="126" /></a></p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_07.png"><img loading="lazy" class="size-medium wp-image-1549 alignleft" title="Add of web IP to the service" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_07-300x262.png" alt="" width="300" height="262" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_07-300x262.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/Service_07.png 561w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>The web site service &#8220;srv_www&#8221; will be part of the &#8220;fb_bilbo&#8221; failover domain, so it will start on the &#8220;bilbo&#8221; server.</p>
<p>If the web service become unavailable, the service will be relocated to another server within the cluster. The server to where the web service will be move, is be based on the priority order we have put in the failover domain. So the IP will automatically be move when the service is relocated to another server within the cluster. We will demonstrate that later on in this article.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Propagate cluster configuration</h2>
<p>We should have now a working cluster, it does not have the final configuration but we will be able to bring it up and move services from one node to another. The missing part of our cluster in order to finalize it, is the creation of the GFS filesystem and our scripts that will bring up and down our ftp/web site. We will look at that in the next article.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_config.png"><img loading="lazy" class="size-medium wp-image-1550 alignleft" title="Propagate our cluster definition" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_config-300x260.png" alt="" width="300" height="260" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_config-300x260.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_config.png 808w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>But for now let&#8217;s push this configuration to our cluster, by pressing the &#8220;Sent to Cluster&#8221; button. This will copy our new configuration file &#8220;/etc/cluster/cluster.conf&#8221; to every member of the cluster and activate it.</p>
<p>We will need to confirm our intention, by pressing the &#8220;Yes&#8221; button to the pop up below.</p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_02.png"><img loading="lazy" class="size-medium wp-image-1551  alignleft" title="Saving and propagate cluster configuration" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_02-300x106.png" alt="" width="300" height="106" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_02-300x106.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_02.png 464w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_03.png"><img loading="lazy" class="size-medium wp-image-1552 alignleft" title="Success config activated on all nodes" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_03-300x125.png" alt="" width="300" height="125" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_03-300x125.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/Propagate_03.png 388w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>I had some problem pushing the initial configuration to other member of the cluster, on my first attempt. If this happen, you may have to copy it manually. The cluster configuration file is stored in /etc/cluster and is named cluster.conf.  If you have ran the &#8220;system-config-cluster&#8221; GUI on &#8220;bilbo&#8221; server, then issue the following command on &#8220;bilbo&#8221; to copy the configuration file to the other servers ;</p>
<blockquote><p><strong>scp /etc/cluster/cluster.conf  gandalf:/etc/cluster</strong></p>
<p><strong>scp /etc/cluster/cluster.conf  gollum:/etc/cluster</strong></p></blockquote>
<p>If the copy is done manually, you will have to restart the cluster services on each node or reboot all the nodes. Once you have a working cluster, you will not have to manually copy the cluster configuration file, pressing the button &#8220;Send to Cluster&#8221; will be enough. You can also the command &#8220;ccs_tools&#8221; to propagate the cluster configuration change (describe below).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Manual adjustment to cluster configuration file</h2>
<p>I made the following changes to the cluster configuration file to prevent the reboot of the server after it is fenced (For the HP ILO). When a server is fenced, the service is transferred to another node and the server that was hosting that service is power off (fenced). If we do not make the following change, the server that was power off will automatically reboot and perhaps then same error condition may occur (network, switch, FC problem), it would power off / power on, / power off / power on …. We want to eliminate that.</p>
<p>Every time you update the cluster configuration file manually you need to increment the configuration version number, so it will trigger an update on the others servers .</p>
<blockquote><p>root@gandalf:~# vi /etc/cluster/cluster..conf</p></blockquote>
<p>&nbsp;</p>
<p><strong><span style="color: #800000;">Increment the version number</span></strong></p>
<p>Since we are changing the configuration file<strong>, </strong>need to increment the version number.<strong><br />
</strong></p>
<p><strong>Before change </strong></p>
<blockquote><p>&lt;cluster alias=&#8221;our_cluster&#8221; config_version=&#8221;<strong><span style="color: #0000ff;">74</span></strong>&#8221; name=&#8221;our_cluster&#8221;&gt;</p></blockquote>
<p><strong>After the change</strong></p>
<blockquote><p>&lt;cluster alias=&#8221;our_cluster&#8221; config_version=&#8221;<strong><span style="color: #0000ff;">75</span></strong>&#8221; name=&#8221;our_cluster&#8221;&gt;</p></blockquote>
<p>&nbsp;</p>
<p><strong><span style="color: #800000;">Changes to prevent rebooting of the node after a power-off</span><br />
</strong></p>
<p>We need to do this modification for each of the &#8220;clusternode name&#8221; section. This will prevent a restart of the node after it has been fenced.</p>
<p><strong>Before the change</strong></p>
<blockquote><p>&lt;clusternode name=&#8221;hbbilbo.maison.ca&#8221; nodeid=&#8221;1&#8243; votes=&#8221;1&#8243;&gt;<br />
&lt;fence&gt;<br />
&lt;method name=&#8221;1&#8243;&gt;<br />
<strong><span style="color: #0000ff;">&lt;device name=&#8221;f_bilbo&#8221;/&gt;</span></strong><br />
&lt;/method&gt;<br />
&lt;/fence&gt;<br />
&lt;/clusternode&gt;</p></blockquote>
<p><strong>After the change</strong></p>
<blockquote><p>&lt;clusternode name=&#8221;hbbilbo.maison.ca&#8221; nodeid=&#8221;1&#8243; votes=&#8221;1&#8243;&gt;<br />
&lt;fence&gt;<br />
&lt;method name=&#8221;1&#8243;&gt;<br />
<span style="color: #0000ff;"><strong>&lt;device </strong><strong>action=&#8221;off&#8221; </strong><strong>name=&#8221;f_bilbo&#8221;/&gt;</strong></span><br />
&lt;/method&gt;<br />
&lt;/fence&gt;<br />
&lt;/clusternode&gt;</p></blockquote>
<p>&nbsp;</p>
<p><span style="color: #800000;"><strong>Increase resource manager verbosity</strong></span></p>
<p>I include here something optional, if you are having some problem with your cluster, increasing verbosity of the resource manager daemon &#8220;rgmanager&#8221; may help you.  Changing the &lt;rm&gt; line will add more debugging information in the /var/log/rgmanager file (syslogd need to be restarted).</p>
<p><strong>Before the change</strong></p>
<blockquote><p>&lt;/fencedevices&gt;<br />
<strong><span style="color: #000080;">&lt;rm&gt;</span></strong><br />
&lt;failoverdomains&gt;</p></blockquote>
<p><strong>After the change</strong></p>
<blockquote><p>&lt;/fencedevices&gt;<br />
<span style="color: #0000ff;"><strong>&lt;rm log_facility=&#8221;local4&#8243; log_level=&#8221;7&#8243;&gt;</strong></span><br />
&lt;failoverdomains&gt;</p></blockquote>
<p>Whenever you update the configuration file manually you can use the “<strong>ccs_tool</strong>” command to propagate the new cluster configuration file to all cluster members. Don&#8217;t forget to update the version number.</p>
<div id="attachment_1592" style="width: 310px" class="wp-caption aligncenter"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/ccs_tool.png"><img aria-describedby="caption-attachment-1592" loading="lazy" class="size-medium wp-image-1592 " title="Click to enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/ccs_tool-300x60.png" alt="" width="300" height="60" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/ccs_tool-300x60.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/ccs_tool.png 489w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1592" class="wp-caption-text">Distribute new cluster config file</p></div>
<p>&nbsp;</p>
<h2>Checking cluster functionality</h2>
<p>We can check the status of your cluster in two different ways. The simplest one is to use the &#8220;clustat&#8221; command (see output below).  If you want a continuous display, you can add &#8220;-i 2&#8221; to the &#8220;clustat&#8221; command, to have the output refreshed every two seconds (Press CTRL-C to stop the display).</p>
<div id="attachment_1602" style="width: 310px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/clustat.png"><img aria-describedby="caption-attachment-1602" loading="lazy" class="size-medium wp-image-1602" title="click to enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/clustat-300x96.png" alt="" width="300" height="96" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/clustat-300x96.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/clustat.png 999w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1602" class="wp-caption-text">clustat command output</p></div>
<p>This is the normal output you should have. All our members are &#8220;Online&#8221;  with the resource manager running on them.</p>
<p>The name of each members of the cluster, their &#8220;Node ID&#8221; and their status are displayed.</p>
<p>Our two services &#8220;srv_ftp&#8221; and &#8220;srv_www&#8221;  are running (started) on the selected server.</p>
<div id="attachment_1603" style="width: 310px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/clustat_GUI.png"><img aria-describedby="caption-attachment-1603" loading="lazy" class="size-medium wp-image-1603" title="Click top enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/clustat_GUI-300x203.png" alt="" width="300" height="203" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/clustat_GUI-300x203.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/clustat_GUI.png 721w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1603" class="wp-caption-text">system-config-cluster (cluster mgmt tab)</p></div>
<p>The second way to get the cluster status, is to run the cluster GUI (system-config-cluster) and then click on the &#8220;Cluster Management&#8221; tab.</p>
<p>In the upper part of the screen, we can see the current member of our cluster and their &#8220;Node ID&#8221; .</p>
<p>Below, we can visualise the status of each services define within the cluster.</p>
<p>We can also see that our service &#8220;srv_ftp&#8221;, is running (started) on &#8220;hbgollum&#8221; and that the service &#8220;srv_www&#8221; is running on &#8220;hbbilbo.maison.ca&#8221; .</p>
<p>With the &#8220;Cluster Management&#8221; tab , we can disable (stop), enable (start) or restart each of these services. More on this later.</p>
<p><strong>Let&#8217;s check if our services IP are alive.</strong></p>
<p>The IP address of the ftp service that we have define is &#8220;192.168.1.204&#8221; and from the &#8220;clustat&#8221; command above we know that it is running on the server &#8220;gollum&#8221;. So let&#8217;s logon on that server and check if that IP is active. Be aware that the output of the &#8220;ifconfig -a&#8221;  does not include our FTP IP, we need to use the &#8220;ip&#8221; command to see it.  From the output below, we can see that server IP &#8220;192.168.1.104&#8221;  is active on &#8220;eth0&#8221; and that our ftp server IP  &#8220;192.168.1.204&#8221; is also active on the same interface. So our cluster software is doing it&#8217;s job, we have the &#8220;ftp.maison.ca&#8221; IP defined on the interface &#8220;eth0&#8221;. You will also notice that on &#8220;eth1&#8221;, we have our heartbeat IP &#8220;10.10.10.104&#8221; is active.</p>
<blockquote><p><strong><span style="color: #0000ff;">root@gollum</span></strong>:~# <strong><span style="color: #0000ff;">ip addr list</span></strong><br />
<strong><span style="color: #0000ff;">1: lo</span></strong>: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 16436 qdisc noqueue<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
inet 127.0.0.1/8 scope host lo<br />
inet6 ::1/128 scope host<br />
valid_lft forever preferred_lft forever<br />
<strong><span style="color: #0000ff;">2: eth0:</span></strong> &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast qlen 1000<br />
link/ether 00:50:da:68:df:9b brd ff:ff:ff:ff:ff:ff<br />
inet <strong><span style="color: #0000ff;">192.168.1.104</span></strong>/24 brd 192.168.1.255 scope global eth0<br />
inet <strong><span style="color: #0000ff;">192.168.1.204</span></strong>/24 scope global secondary eth0<br />
inet6 fe80::250:daff:fe68:df9b/64 scope link<br />
valid_lft forever preferred_lft forever<br />
<span style="color: #0000ff;"><strong>3: eth1</strong></span>: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast qlen 1000<br />
link/ether 00:02:a5:b1:a0:d4 brd ff:ff:ff:ff:ff:ff<br />
inet <strong><span style="color: #0000ff;">10.10.10.104</span></strong>/24 brd 10.10.10.255 scope global eth1<br />
inet6 fe80::202:a5ff:feb1:a0d4/64 scope link<br />
valid_lft forever preferred_lft forever<br />
<strong><span style="color: #0000ff;">4: sit0</span></strong>: &lt;NOARP&gt; mtu 1480 qdisc noop<br />
link/sit 0.0.0.0 brd 0.0.0.0<br />
root@gollum:~#</p></blockquote>
<p>&nbsp;</p>
<p>On the server &#8220;bilbo&#8221; we have our web IP (192.168.1.211) active on the interface &#8220;eth0&#8221; along with the server IP (192.168.1.111). Our heartbeat IP is defined on the interface &#8220;eth1&#8221; .</p>
<blockquote><p><strong><span style="color: #0000ff;">root@bilbo</span></strong>:~# <strong><span style="color: #0000ff;">ip addr list</span></strong><br />
<strong><span style="color: #0000ff;">1: lo:</span></strong> &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 16436 qdisc noqueue<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
inet 127.0.0.1/8 scope host lo<br />
inet6 ::1/128 scope host<br />
valid_lft forever preferred_lft forever<br />
<strong><span style="color: #0000ff;">2: eth0</span></strong>: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast qlen 1000<br />
link/ether 00:01:02:75:80:58 brd ff:ff:ff:ff:ff:ff<br />
inet <strong><span style="color: #0000ff;">192.168.1.111</span></strong>/24 brd 192.168.1.255 scope global eth0<br />
inet <strong><span style="color: #0000ff;">192.168.1.21</span>1</strong>/24 scope global secondary eth0<br />
inet6 fe80::201:2ff:fe75:8058/64 scope link<br />
valid_lft forever preferred_lft forever<br />
<strong>3: eth1:</strong> &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast qlen 1000<br />
link/ether 00:50:8b:f4:c5:59 brd ff:ff:ff:ff:ff:ff<br />
inet <strong><span style="color: #0000ff;">10.10.10.111</span></strong>/24 brd 10.10.10.255 scope global eth1<br />
inet6 fe80::250:8bff:fef4:c559/64 scope link<br />
valid_lft forever preferred_lft forever<br />
<strong><span style="color: #0000ff;">4: sit0</span></strong>: &lt;NOARP&gt; mtu 1480 qdisc noop<br />
link/sit 0.0.0.0 brd 0.0.0.0<br />
root@bilbo:~#</p></blockquote>
<p>I think we should stop the article here, we have now a working cluster that we will exploit in our next article.</p>
<p>In our next article, we will create our services scripts and our GFS filesystem so that our server can share the same filesystem. This feature will give us the ability to share information between server via a common filesystem. So when the service has to moved from one server to another, the service can start using the same data it was using on the previous server.</p>
<p>I don&#8217;t know if the next article will be the last one of this series of article on the cluster, but we will see.</p>
<p>Stay tune for part 4 of this series of article on creating a Linux Red Hat cluster.</p>
<p><a title="Part 1 - Creating a RedHat/CentOS Cluster" href="http://linternux.com/2010/11/creating-cluster-part-1/" target="_blank">Part 1 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a href="http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/" target="_blank">Part 2 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 3 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/03/creating-a-red-hatcentos-cluster-part-3/" target="_blank">Part 3 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 4 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-4/" target="_blank">Part 4 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 5 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-5/" target="_blank">Part 5 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p>&nbsp;</p>
<style>.pf-button.pf-button-excerpt { display: none; }</style>]]></content:encoded>
					
					<wfw:commentRss>http://linternux.com/2011/03/creating-a-red-hatcentos-cluster-part-3/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Red Hat Cluster: Part 2</title>
		<link>http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/</link>
					<comments>http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/#respond</comments>
		
		<dc:creator><![CDATA[Jacques Duplessis]]></dc:creator>
		<pubDate>Mon, 03 Jan 2011 17:52:43 +0000</pubDate>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[cluster]]></category>
		<guid isPermaLink="false">http://linternux.com/?p=1295</guid>

					<description><![CDATA[&#160; Here is the second article on how to to build a Red Hat/CentOS cluster. The &#8220;Part One of this article&#8221; was posted a couple of month ago, I&#8217;m sorry for the delay but I have been a bit busy at work and at home.  I can promise that Part 3 will not take a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Here is the second article on how to to build a Red Hat/CentOS cluster. The &#8220;<a title="Part one of this article" href="http://linternux.com/2010/11/creating-cluster-part-1/" target="_blank">Part One of this articl</a>e&#8221; was posted a couple of month ago, I&#8217;m sorry for the delay but I have been a bit busy at work and at home.  I can promise that Part 3 will not take a couple of month to post. I want to terminate this series on the cluster and post some new ideas that I have.  In this article, we continue our journey on how-to build our cluster and stay tune for Part 3 coming soon.</p>
<h2>Installing the cluster software</h2>
<p>If you are using Red Hat, you need to register your server in order to download new software or update. You also need to subscribe to the &#8220;Clustering&#8221; and &#8220;Cluster Storage&#8221; channel in order to install these groups of software. With CentOS, this is not needed since we can download these groups of software without registration. Let&#8217;s install the clustering software, by typing this command;</p>
<blockquote><p><span style="color: #002060;"><span style="color: #000080;"><strong># yum groupinstall Clustering</strong></span><br />
</span></p></blockquote>
<p>Since we will be using GFS filesystem, we will need the &#8220;Cluster Storage&#8221; software group.</p>
<blockquote><p><span style="color: #002060;"><span style="color: #000080;"><strong># yum groupinstall &#8220;Cluster Storage&#8221;</strong></span><br />
</span></p></blockquote>
<p>I also found out that this package is also needed by the cluster software, so let install it.</p>
<blockquote><p><span style="color: #002060;"><span style="color: #000080;"># <strong>yum install perl-Crypt-SSLeay </strong></span><br />
</span></p></blockquote>
<p>If you are using a 32 bits kernel and you have more than 4 GB of memory on it, you need to install the PAE kernel and GFS modules. This will ensure that you are using all the memory available on the server.</p>
<blockquote><p><span style="color: #002060;"><strong><span style="color: #000080;"># yum install kmod-gnbd-PAE kmod-gfs-PAE kernel-PA</span>E<br />
</strong></span></p></blockquote>
<p>Finally, let&#8217;s make sure that you have that the servers have the latest OS update.</p>
<blockquote><p><strong><span style="color: #000080;"># yum –y update</span><br />
</strong></p></blockquote>
<h2>Setting the locking type for GFS filesystem</h2>
<p>To use the <a title="RedHat GFS information page" href="http://www.redhat.com/gfs/" target="_blank">GFS (Global File System)</a> with the cluster you need to activate the GFS locking in the /etc/lvm/lvm.conf file. We need to change the &#8220;locking_type&#8221; variable from 0 to 3, to inform LVM that we will be dealing iwth GFS volume group and GFS filesystem. This command needs to be <span style="color: blue;"><strong><em>run on all the servers</em></strong></span>.</p>
<pre># grep -i locking_type /etc/lvm/lvm.conf
locking_type = 0
# <strong><span style="color: #0000ff;">lvmconf --enable-cluster</span></strong>
# grep -i locking_type /etc/lvm/lvm.conf
locking_type = 3
</pre>
<p><span id="more-1295"></span></p>
<h2>Making sure SELinux and firewall are disable</h2>
<p>We do not want to deal with SELinux and the firewall in our cluster, so we will disable them. From the gnome desktop run the following the following command ;</p>
<pre><strong><span style="color: #000080;"># system-config-securitylevel</span></strong>
</pre>
<div style="width: 268px" class="wp-caption alignleft"><img loading="lazy" class="   " title="Disabling SELinux need a reboot to be activated" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/010311_1252_CreatingaRe13.png" alt="Disable SELinux" width="258" height="273" align="left" /><p class="wp-caption-text">Disabling SELinux need a reboot</p></div>
<div style="width: 268px" class="wp-caption alignleft"><img loading="lazy" class=" " title="Disable Firewall" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/010311_1252_CreatingaRe21.png" alt="Disable Firewall" width="258" height="272" align="left" /><p class="wp-caption-text">Disable Firewall</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Activating cluster service</h2>
<p>Let&#8217;s make sure that the cluster service are started each time the server is started.</p>
<div id="attachment_1597" style="width: 310px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/01/activate_cluster_service.png"><img aria-describedby="caption-attachment-1597" loading="lazy" class="size-medium wp-image-1597 " title="Click to enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/activate_cluster_service-300x94.png" alt="" width="300" height="94" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/01/activate_cluster_service-300x94.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/01/activate_cluster_service.png 329w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1597" class="wp-caption-text">Activate cluster services</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>We now we can start the cluster services manually or reboot the server.</p>
<div id="attachment_1599" style="width: 310px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/01/start_cluster_services.png"><img aria-describedby="caption-attachment-1599" loading="lazy" class="size-medium wp-image-1599" title="start_cluster_services" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/start_cluster_services-300x134.png" alt="" width="300" height="134" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/01/start_cluster_services-300x134.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/01/start_cluster_services.png 779w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1599" class="wp-caption-text">Start cluster services</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Starting cluster configuration</h2>
<p>There are two tools you can use to configure and maintain your cluster. The first one is a web interface called &#8220;<a title="Article on Conga" href="http://magazine.redhat.com/2007/03/19/teaching-your-cluster-and-storage-systems-to-dance-an-introduction-to-conga/" target="_blank">Conga</a>&#8221; that require the installation of a agent on each node (ricci) and a centralize configuration center named (lucy).  If you want to use the web interface (Seem to be working a lot better now),  it is advisable to install the configuration center on a Linux server outside of the cluster. This was fairly new when I first created my first cluster and we decided to used the second interface name &#8220;Cluster Configuration&#8221;.  This tool can be started from any node within the cluster and does not require to install any additional software. To start the cluster configuration GUI, type the following command using the &#8220;root&#8221; account ;</p>
<div id="attachment_1385" style="width: 310px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/01/system-config-cluster1.png"><img aria-describedby="caption-attachment-1385" loading="lazy" class="size-medium wp-image-1385  " title="system-config-cluster" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/system-config-cluster1-300x54.png" alt="Start cluster configuration GUI from the command line" width="300" height="54" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/01/system-config-cluster1-300x54.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/01/system-config-cluster1.png 333w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1385" class="wp-caption-text">Start cluster GUI from the command line</p></div>
<p style="margin-left: 36pt;">&nbsp;</p>
<p style="margin-left: 36pt;">&nbsp;</p>
<p style="margin-left: 36pt;">&nbsp;</p>
<p style="margin-left: 36pt;">&nbsp;</p>
<div id="attachment_1396" style="width: 280px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/01/new_cluster_config.png"><img aria-describedby="caption-attachment-1396" loading="lazy" class="size-medium wp-image-1396   " title="Click to enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/new_cluster_config-300x135.png" alt="new_cluster_config_warning" width="270" height="122" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/01/new_cluster_config-300x135.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/01/new_cluster_config.png 497w" sizes="(max-width: 270px) 100vw, 270px" /></a><p id="caption-attachment-1396" class="wp-caption-text">new_cluster_config_warning</p></div>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">The first time you run the cluster configuration GUI, a warning message may display.  It is just informing us that the cluster configuration file &#8220;/etc/cluster/cluster.conf&#8221; was not found. Click on the &#8220;Create New Configuration&#8221; button and let&#8217;s move on.</p>
<p style="text-align: left;">&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1403" style="width: 154px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_MCast.png"><img aria-describedby="caption-attachment-1403" loading="lazy" class="size-medium wp-image-1403 " title="Cluster_GUI_MCast" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_MCast-144x300.png" alt="Cluster general setting" width="144" height="300" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_MCast-144x300.png 144w, http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_MCast.png 288w" sizes="(max-width: 144px) 100vw, 144px" /></a><p id="caption-attachment-1403" class="wp-caption-text">Cluster general setting</p></div>
<p>&nbsp;</p>
<ul>
<li>Next we need to enter the name of our cluster, we have choose to name it “our_cluster”.  The name of a cluster cannot be change. The only way to change the name of the cluster is to create a new one, so choose it wisely.</li>
<li>We use the recommend Lock Manager (Dynamic Lock Manager), the      GULM is depreciated.</li>
<li>The multicast address we used for the heartbeat will be “239.1.1.1”.</li>
<li>The usage of the &#8220;Quorum Disk&#8221; is outside the scope of this article. But basically, you define a small disk on the SAN that is shared among the nodes in the cluster and node status are regularly written to that disk. If a node haven&#8217;t updated its status for a period of time, it will be considered down and the cluster will then fence that node. If you are interested to use the &#8220;Quorum Disk&#8221; there is an article <a title="Enhancing cluster quorum with QDisk" href="http://magazine.redhat.com/2007/12/19/enhancing-cluster-quorum-with-qdisk/" target="_blank">here </a>that describe how to set it up.</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Cluster Properties</h2>
<div id="attachment_1409" style="width: 310px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_Properties.png"><img aria-describedby="caption-attachment-1409" loading="lazy" class="size-medium wp-image-1409  " title="Click on the image to enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_Properties-300x292.png" alt="Click on the image to enlarge" width="300" height="292" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_Properties-300x292.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_Properties.png 726w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1409" class="wp-caption-text">Cluster Properties</p></div>
<p>&nbsp;</p>
<p>Now let&#8217;s check some of the default setting given to our cluster. Click on “Cluster” on the left hand side of the screen and then click on the “Edit Cluster Properties”.</p>
<p>The <strong>Configuration Version</strong> value is by default to 1 and automatically incremented each time you modify your  cluster configuration.</p>
<p>The <strong>Post-Join Delay </strong>parameter is the number of seconds the fence daemon (fenced) waits before fencing a node after the node joins the fence domain. The <strong>Post-Join Delay </strong>default value is <strong>3</strong>. A typical setting for <strong>Post-Join Delay </strong>is between 20 and 30 seconds, but can vary according to cluster and network performance.</p>
<p>The <strong>Post-Fail Delay </strong>parameter is the number of seconds the fence daemon (fenced) waits before fencing a node (a member of the fence domain) after the node has failed. The <strong>Post-Fail Delay </strong>default value is <strong>0</strong>. Its value may be varied to suit cluster and network performance. <strong><em>CHANGE THE “POST FAIL DELAY” to 30 Seconds</em></strong>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Adding our nodes to cluster</h2>
<div id="attachment_1425" style="width: 310px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_Node_Bilbo.png"><img aria-describedby="caption-attachment-1425" loading="lazy" class="size-medium wp-image-1425 " title="Click on the image to enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_Node_Bilbo-300x290.png" alt="" width="300" height="290" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_Node_Bilbo-300x290.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/01/Cluster_GUI_Node_Bilbo.png 727w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1425" class="wp-caption-text">Insert our first node &quot;bilbo&quot;</p></div>
<p>&nbsp;</p>
<p>To add node into the cluster let’s select “Cluster Nodes” on the upper left side of the screen and click on the “Add a Cluster Node” button. You will be then presented the “Node Properties” screen.  Enter the node name, the “Quorum Votes” and the name of the interface used for the “Multicast” (Heartbeat), in our case it is eth0. The avoid problem, I always used the first interface for the network cluster heartbeat.</p>
<ul>
<li>Enter the name of the host name used for the heartbeat, for our first node it will be &#8220;hbbilbo.maison.ca. Remember that this name MUST be defined in<img src="file:///C:/Users/jacques/AppData/Local/Temp/moz-screenshot.png" alt="" /> <a title="View our /etc/hosts file" href="http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster_hosts_file.png" target="_blank">our hosts file</a> and in your DNS (if you have one).</li>
</ul>
<ul>
<li>Quorum is a voting algorithm used by the cluster manager. We say a cluster has &#8216;quorum&#8217; if a majority of nodes are alive,  communicating, and agree on the active cluster members.  So in a  thirteen-node cluster, quorum is only reached if seven or more nodes are  communicating.  If the seventh node dies, the cluster loses quorum and  can no longer function. For our cluster we will <strong>leave the Quorum Votes to the default value of 1</strong>.</li>
</ul>
<p>If we would have a two-node clusters, we would need to make a special exception to the  quorum rules. There is a special setting &#8220;two_node&#8221; in the  /etc/cluster.conf file that looks like this:  &lt;cman expected_votes=&#8221;1&#8243; two_node=&#8221;1&#8243;/&gt;</p>
<p>&nbsp;</p>
<p>Repeat operation for every node you want to include in the cluster</p>
<div id="attachment_1365" style="width: 280px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/02/Cluster_GUI_Node_Gandalf.png"><img aria-describedby="caption-attachment-1365" loading="lazy" class="size-medium wp-image-1365  " title="Click to enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/02/Cluster_GUI_Node_Gandalf-300x114.png" alt="Click to enlarge." width="270" height="103" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/02/Cluster_GUI_Node_Gandalf-300x114.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/02/Cluster_GUI_Node_Gandalf.png 355w" sizes="(max-width: 270px) 100vw, 270px" /></a><p id="caption-attachment-1365" class="wp-caption-text">Insert &quot;gandalf&quot; node in our cluster</p></div>
<div id="attachment_1364" style="width: 280px" class="wp-caption alignleft"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/02/Cluster_GUI_Node_Gollum.png"><img aria-describedby="caption-attachment-1364" loading="lazy" class="size-medium wp-image-1364  " title="Click to enlarge" src="http://linternux.com/wordpress/wp-content/uploads/2011/02/Cluster_GUI_Node_Gollum-300x114.png" alt="" width="270" height="103" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/02/Cluster_GUI_Node_Gollum-300x114.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/02/Cluster_GUI_Node_Gollum.png 355w" sizes="(max-width: 270px) 100vw, 270px" /></a><p id="caption-attachment-1364" class="wp-caption-text">Insert &quot;gollum&quot; node in our cluster</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>This article was getting quite long, so I decided to stop here, and continue in a another article.</p>
<p>We are almost there stay tune, the third one will be posted soon.</p>
<p>&nbsp;</p>
<p><a title="Part 1 - Creating a RedHat/CentOS Cluster" href="http://linternux.com/2010/11/creating-cluster-part-1/" target="_blank">Part 1 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a href="http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/" target="_blank">Part 2 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 3 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/03/creating-a-red-hatcentos-cluster-part-3/" target="_blank">Part 3 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 4 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-4/" target="_blank">Part 4 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 5 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-5/" target="_blank">Part 5 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p>&nbsp;</p>
<style>.pf-button.pf-button-excerpt { display: none; }</style>]]></content:encoded>
					
					<wfw:commentRss>http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Red Hat Cluster: Part 1</title>
		<link>http://linternux.com/2010/11/creating-cluster-part-1/</link>
					<comments>http://linternux.com/2010/11/creating-cluster-part-1/#comments</comments>
		
		<dc:creator><![CDATA[Jacques Duplessis]]></dc:creator>
		<pubDate>Tue, 09 Nov 2010 02:22:51 +0000</pubDate>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[cluster]]></category>
		<guid isPermaLink="false">http://linternux.com/?p=1242</guid>

					<description><![CDATA[This is the first of a series of articles that will demonstrate how to create a Linux cluster using Red Hat/CentOS  5.5 distribution. When we  created our first cluster at the office, we were searching for some Red Hat cluster setup information on the internet. To my surprise, we could not find a lot of  [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This is the first of a series of articles that will demonstrate how to create a Linux cluster using Red Hat/CentOS  5.5 distribution. When we  created our first cluster at the office, we were searching for some Red Hat cluster setup information on the internet. To my surprise, we could not find a lot of  article or user experience on that topic. So I hope, this series of articles will benefit to the community of users trying or wanting to create their own cluster.</p>
<h3>The cluster hardware</h3>
<p>Our cluster will have 3 HP servers, they will all have 4GB of memory, 36GB of mirrored internal disks, one Qlogic fiber card connected to our SAN system, 2 network cards and for our fencing device we will use the on-board <a href="http://h18000.www1.hp.com/products/servers/management/ilo/">HP ILO</a> (Integrated Light Out). This is my setup, yours does not need to be the same.  You do not need to use HP server to build a cluster, you do not need to have mirrored disks (although recommended) and you do not need to have to use a SAN infrastructure either (NFS share can also be used). One thing I would recommend is a fencing device, on the HP server there is a network port on the back of each server called &#8220;ILO&#8221;.  This will allow the cluster software to power on, power off or restart a server remotely. Red Hat cluster package allow you to use a lot of <a href="https://access.redhat.com/kb/docs/DOC-30004">similar fencing devices</a>. This part of the cluster is important because this will prevent at one point some nodes in the cluster to write to a non-shareable file-system and create data corruption. If you do not have a <a href="http://sources.redhat.com/cluster/wiki/Fence">fencing </a>device, you can always use the manual <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/3/html/GFS_6.0_Administration_Guide/s1-fence-methods.html">fencing method</a> it works, but it not supported.</p>
<h3>The Setup</h3>
<p>Our cluster will be contains 3 servers, we will have 2 actives servers and one passive. For our example, we will have one server running an HTTP service, the second server will be an FTP server. The third server will be use as a fail-over server, if the first or second server have network, SAN, or hardware problem, the service it is running will move the third server.</p>
<p>Although not required, having a passive server offer some advantage, first it make sure that if one server have problem the passive server will be able to handle the load of any of your server. If we did  not have that passive server we would need to make sure that either of the server would be capable of handling the load of the two servers on one server.</p>
<p>Clustering environment offer some other advantage when time come to do hardware update on a server. Let say we need to add memory to the first server, we could move the HTTP service from one server to the passive node, add memory to the first server and then move back to the service on the original node when ready. Another advantage of having a passive server is that you can update the OS of your node one by one without affecting the service (if reboot is necessary).</p>
<p>So the name of our node will be &#8220;bilbo&#8221; the will host the http service, &#8220;gollum&#8221; the will host the FTP service and &#8220;gandalf&#8221; will be our passive node.</p>
<p style="text-align: center;"><a href="http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster.png"><img loading="lazy" class="size-medium wp-image-1690 aligncenter" title="Cluster Network" src="http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster-300x143.png" alt="" width="300" height="143" srcset="http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster-300x143.png 300w, http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster-1024x490.png 1024w, http://linternux.com/wordpress/wp-content/uploads/2011/03/cluster.png 1149w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p style="text-align: center;">Click on image to view it enlarge.</p>
<p style="text-align: left;">As you can see above, each server use 3 network cards.</p>
<p style="text-align: left;"><span id="more-1242"></span></p>
<p style="text-align: left;">The first NIC (eth0), is use to offer the service HTTP and FTP to the users and it is the host main network card.</p>
<p style="text-align: left;">The second network card (eth1) is used by cluster software for his heartbeat. In a corporate environment, this network should be isolated from the rest of your network. There will be a lot of  broadcast on it and the response time is important.</p>
<p style="text-align: left;">The ILO network will be used by the cluster software to remotely poweron/poweroff server in our cluster, when a problem arise.</p>
<p style="text-align: left;">So out /etc/hosts file look like this :</p>
<pre>#
127.0.0.1       localhost.localdomain   localhost
#
# Host Real IP
192.168.1.103   gandalf.maison.ca       gandalf
192.168.1.104   gollum.maison.ca        gollum
192.168.1.111   bilbo.maison.ca         bilbo
#
# Service Virtual IP
192.168.1.204   ftp.maison.ca           ftp
192.168.1.211   www.maison.ca           www
#
# HeartBeat IP Address
10.10.10.103    hbgandalf.maison.ca     hbgandalf
10.10.10.104    hbgollum.maison.ca      hbgollum
10.10.10.111    hbbilbo.maison.ca       hbbilbo
#
# HP ILO IP Address
192.168.1.3     ilo_gandalf.maison.ca   ilo_gandalf
192.168.1.4     ilo_gollum.maison.ca    ilo_gollum
192.168.1.11    ilo_bilbo.maison.ca     ilo_bilbo
#</pre>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">We should define all the ip address that our cluster need to function properly in your /etc/hosts. Of course they should also be define in your DNS, but in case your DNS does not respond, the /etc/hosts will assure you that the cluster will continue to work properly. We will use the domain name &#8220;maison.ca¨ through out these articles.</p>
<p style="text-align: left;">In our <a title="Second Article" href="http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/" target="_blank">second article</a>, we will be installing the cluster software and begin the configuration of the cluster.</p>
<p style="text-align: left;">&nbsp;</p>
<p style="text-align: left;">&nbsp;</p>
<p>&nbsp;</p>
<p><a title="Part 1 - Creating a RedHat/CentOS Cluster" href="http://linternux.com/2010/11/creating-cluster-part-1/" target="_blank">Part 1 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a href="http://linternux.com/2011/01/creating-a-redhatcentos-cluster-part-2/" target="_blank">Part 2 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 3 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/03/creating-a-red-hatcentos-cluster-part-3/" target="_blank">Part 3 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 4 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-4/" target="_blank">Part 4 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p><a title="Part 5 of Creating a RedHat/CentOS cluster" href="http://linternux.com/2011/04/creating-a-redhat-cluster-part-5/" target="_blank">Part 5 &#8211; Creating a Linux ReadHat/CentOS cluster</a></p>
<p>&nbsp;</p>
<style>.pf-button.pf-button-excerpt { display: none; }</style>]]></content:encoded>
					
					<wfw:commentRss>http://linternux.com/2010/11/creating-cluster-part-1/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
