2x5 Scalable Cluster Tutorial

From Alteeve Wiki
Revision as of 17:50, 1 August 2011 by Digimer (talk | contribs)
Jump to navigation Jump to search

 AN!Wiki :: How To :: 2x5 Scalable Cluster Tutorial

Warning: This tutorial is not even close to complete or accurate. It will be updated later, but so long as this warning is here, consider it defective and unusable. The only up to date clustering tutorial is: Red Hat Cluster Service 2 Tutorial.

The Design

  __________________________                             __________________________ 
 | [ an-node01 ]      ______|                           |______      [ an-node02 ] |
 |                   | eth0 =--\                     /--= eth0 |                   |
 | [ sda ] [ sdb ]   |_____||  |                     |  ||_____|   [ sda ] [ sdb ] |
 |    |_______|             |  |                     |  |             |_______|    |
 |        |                 |  |  _________________  |  |                 |        |
 |     [ md0 ]        ______|  | [ /dev/drbd0 and  ] |  |______        [ md0 ]     |
 |        \----------| eth1 =----[___floating_IP___]----= eth1 |----------/        |
 |                   |_____||  |         | |         |  ||_____|                   |
 |                          |  | /-------------------/  |                          |
 |                    ______|  | |       | |            |______                    |
 |                   | eth2 =----------------------\ /--= eth2 |                   |
 |                   |_____||  | |       | |       | |  ||_____|                   |
 |__________________________|  | |       | |       | |  |__________________________|
                               | |       | |       | |
                  /------------/ |       | |       | \--------------------------\
                  | /------------/       | |       \--------------------------\ |
                  | |   _________________|_|__________________                | |
                  | |  | iqn.2011-08.com.an-clusterA.target01 |               | |
                  | |  |______________________________________|               | |
                  | |                    | |                                  | |
                  | \---------------\    | \--------------\                   | |
                  \---------------\ |    \--------------\ |                   | |
                                 _|_|_____________     _|_|_____________     _|_|_____________
 [ Storage Cluster ]            [ Internet Facing ]   [ Storage Network ]   [  Back-Channel   ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[_____Switch______]~~~[_____Switch______]~~~[_____Switch______]~~~
 [    VM Cluster   ]              | | | | |             | | | | |             | | | | |  
                                  | | | | |             | | | | |             | | | | |
  __________________________      | | | | |             | | | | |             | | | | |
 | [ an-node03 ]      ______|     | | | | |             | | | | |             | | | | |
 |                   | eth0 =-----/ | | | |             | | | | |             | | | | |
 |                   |_____||       | | | |             | | | | |             | | | | |
 |                          |       | | | |             | | | | |             | | | | |
 |                    ______|       | | | |             | | | | |             | | | | |
 |                   | eth1 =---------------------------/ | | | |             | | | | |
 |                   |_____||       | | | |               | | | |             | | | | |
 |                          |       | | | |               | | | |             | | | | |
 |                    ______|       | | | |               | | | |             | | | | |
 |                   | eth2 =-------------------------------------------------/ | | | |
 |                   |_____||       | | | |               | | | |               | | | |
 |__________________________|       | | | |               | | | |               | | | |
                                    | | | |               | | | |               | | | |
  __________________________        | | | |               | | | |               | | | |
 | [ an-node04 ]      ______|       | | | |               | | | |               | | | |
 |                   | eth0 =-------/ | | |               | | | |               | | | |
 |                   |_____||         | | |               | | | |               | | | |
 |                          |         | | |               | | | |               | | | |
 |                    ______|         | | |               | | | |               | | | |
 |                   | eth1 =-----------------------------/ | | |               | | | |
 |                   |_____||         | | |                 | | |               | | | |
 |                          |         | | |                 | | |               | | | |
 |                    ______|         | | |                 | | |               | | | |
 |                   | eth2 =---------------------------------------------------/ | | |
 |                   |_____||         | | |                 | | |                 | | |
 |__________________________|         | | |                 | | |                 | | |
                                      | | |                 | | |                 | | |
  __________________________          | | |                 | | |                 | | |
 | [ an-node05 ]      ______|         | | |                 | | |                 | | |
 |                   | eth0 =---------/ | |                 | | |                 | | |
 |                   |_____||           | |                 | | |                 | | |
 |                          |           | |                 | | |                 | | |
 |                    ______|           | |                 | | |                 | | |
 |                   | eth1 =-------------------------------/ | |                 | | |
 |                   |_____||           | |                   | |                 | | |
 |                          |           | |                   | |                 | | |
 |                    ______|           | |                   | |                 | | |
 |                   | eth2 =-----------------------------------------------------/ | |
 |                   |_____||           | |                   | |                   | |
 |__________________________|           | |                   | |                   | |
                                        | |                   | |                   | |
  __________________________            | |                   | |                   | |
 | [ an-node06 ]      ______|           | |                   | |                   | |
 |                   | eth0 =-----------/ |                   | |                   | |
 |                   |_____||             |                   | |                   | |
 |                          |             |                   | |                   | |
 |                    ______|             |                   | |                   | |
 |                   | eth1 =---------------------------------/ |                   | |
 |                   |_____||             |                     |                   | |
 |                          |             |                     |                   | |
 |                    ______|             |                     |                   | |
 |                   | eth2 =-------------------------------------------------------/ |
 |                   |_____||             |                     |                     |
 |__________________________|             |                     |                     |
                                          |                     |                     |
  __________________________              |                     |                     |
 | [ an-node07 ]      ______|             |                     |                     |
 |                   | eth0 =-------------/                     |                     |
 |                   |_____||                                   |                     |
 |                          |                                   |                     |
 |                    ______|                                   |                     |
 |                   | eth1 =-----------------------------------/                     |
 |                   |_____||                                                         |
 |                          |                                                         |
 |                    ______|                                                         |
 |                   | eth2 =---------------------------------------------------------/
 |                   |_____||
 |__________________________|

Install The Cluster Software

If you are using Red Hat Enterprise Linux, you will need to add the RHEL Server Optional (v. 6 64-bit x86_64) channel for each node in your cluster. You can do this in RHN by going the your subscription management page, clicking on each server, clicking on "Alter Channel Subscriptions", click to enable the RHEL Server Optional (v. 6 64-bit x86_64) channel and then by clicking on "Change Subscription".

This actual installation is simple, just use yum to install cman.

yum install cman fence-agents

Initial Config

With these decisions and the information gathered, here is what our first /etc/cluster/cluster.conf file will look like.

touch /etc/cluster/cluster.conf
vim /etc/cluster/cluster.conf
<?xml version="1.0"?>
<cluster name="an-clusterA" config_version="1">
        <cman two_node="1" expected_votes="1" />
        <totem secauth="off" rrp_mode="none" />
        <clusternodes>
                <clusternode name="an-node01.alteeve.com" nodeid="1">
                        <fence>
                                <method name="PDU">
                                        <device name="pdu2" action="reboot" port="1" />
                                </method>
                        </fence>
                </clusternode>
                <clusternode name="an-node02.alteeve.com" nodeid="2">
                        <fence>
                                <method name="PDU">
                                        <device name="pdu2" action="reboot" port="2" />
                                </method>
                        </fence>
                </clusternode>
        </clusternodes>
        <fencedevices>
                <fencedevice name="pdu2" agent="fence_apc" ipaddr="192.168.1.6" login="apc" passwd="secret" />
        </fencedevices>
</cluster>

Save the file, then validate it. If it fails, address the errors and try again.

ccs_config_validate
Configuration validates

Push it to the other node:

rsync -av /etc/cluster/cluster.conf root@an-node02:/etc/cluster/
sending incremental file list
cluster.conf

sent 781 bytes  received 31 bytes  541.33 bytes/sec
total size is 701  speedup is 0.86

Start:


DO NOT PROCEED UNTIL YOUR cluster.conf FILE VALIDATES!

Unless you have it perfect, your cluster will fail.

Once it validates, proceed.

Starting The Cluster For The First Time

By default, if you start one node only and you've enabled the <cman two_node="1" expected_votes="1"/> option as we have done, the lone server will effectively gain quorum. It will try to connect to the cluster, but there won't be a cluster to connect to, so it will fence the other node after a timeout period. This timeout is 6 seconds by default.

For now, we will leave the default as it is. If you're interested in changing it though, the argument you are looking for is post_join_delay.

This behaviour means that we'll want to start both nodes well within six seconds of one another, least the slower one get needlessly fenced.


Left off here

Note to help minimize dual-fences:

  • you could add FENCED_OPTS="-f 5" to /etc/sysconfig/cman on *one* node (ilo fence devices may need this)

iSCSI notes

default iscsi port is 3260

initiator: This is the client. target: This is the server side. sid: Session ID; Found with iscsiadm -m session -P 1. SID and sysfs path are not persistent, partially start-order based. iQN: iSCSI Qualified Name; This is a string that uniquely identifies targets and initiators.

vim /etc/tgt/targets.conf

Note: Linbit offers 8.3.11 to RHEL6 clients now, use that in this tutorial.


yum install iscsi-initiator-utils scsi-target-utils
/etc/init.d/iscsid start
iscsiadm -m iface -o new --interface=eth1
cp /etc/tgt/targets.conf /etc/tgt/targets.conf.orig
vim /etc/tgt/targets.conf

<source lang="bash">


 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.