<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://alteeve.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Facade</id>
	<title>Alteeve Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://alteeve.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Facade"/>
	<link rel="alternate" type="text/html" href="https://alteeve.com/w/Special:Contributions/Facade"/>
	<updated>2026-05-10T06:46:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2119</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2119"/>
		<updated>2010-09-09T22:52:24Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Thanks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjusted, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files: the private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, let&#039;s take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note: normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west duel. If one node is dead, the other node is going to win the duel by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this duel is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly: testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. Their website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2118</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2118"/>
		<updated>2010-09-09T22:50:35Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Fencing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjusted, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files: the private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, let&#039;s take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note: normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west duel. If one node is dead, the other node is going to win the duel by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this duel is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly: testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2117</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2117"/>
		<updated>2010-09-09T22:42:36Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Setup cman */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjusted, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files: the private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, let&#039;s take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note: normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2116</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2116"/>
		<updated>2010-09-09T22:38:32Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Core Program Overviews */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjusted, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files: the private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, let&#039;s take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2115</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2115"/>
		<updated>2010-09-09T22:34:12Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Setup SSH Shared Keys */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjusted, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files: the private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2114</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2114"/>
		<updated>2010-09-09T22:28:29Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Setup &amp;#039;network&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjusted, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files; The private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private which &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2113</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2113"/>
		<updated>2010-09-09T22:25:51Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Remove NetworkManager */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjust, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files; The private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private which &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2112</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2112"/>
		<updated>2010-09-09T22:21:16Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Change the Default Run-Level */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjust, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files; The private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private which &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=User_talk:Facade&amp;diff=2104</id>
		<title>User talk:Facade</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=User_talk:Facade&amp;diff=2104"/>
		<updated>2010-09-09T13:13:56Z</updated>

		<summary type="html">&lt;p&gt;Facade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Thank you for all the spelling mistake fixes!&lt;br /&gt;
&lt;br /&gt;
--[[User:Digimer|Digimer]] 13:01, 9 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
You&#039;re welcome!  Ran out of time this morning, will continue tonight if time permits.&lt;br /&gt;
&lt;br /&gt;
--[[User:Facade|Facade]] 13:13, 9 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2102</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2102"/>
		<updated>2010-09-09T06:24:08Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* OS Install */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reducing the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjust, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files; The private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private which &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2101</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2101"/>
		<updated>2010-09-09T06:22:58Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Pre-Assembly */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora version. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your how password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reducing the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjust, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files; The private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private which &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2100</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2100"/>
		<updated>2010-09-09T06:21:58Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simply text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora version. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your how password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reducing the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjust, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files; The private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private which &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2099</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2099"/>
		<updated>2010-09-09T06:20:44Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would server the purposes of creating this document. What you purchase shouldn&#039;t matter, so long at the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simply text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora version. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your how password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reducing the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjust, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files; The private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private which &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2098</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2098"/>
		<updated>2010-09-09T06:18:21Z</updated>

		<summary type="html">&lt;p&gt;Facade: /* Platform */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO (currently at version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5.4&amp;lt;/span&amp;gt; which is used in this document), or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exists on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also server to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would server the purposes of creating this document. What you purchase shouldn&#039;t matter, so long at the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simply text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora version. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your how password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reducing the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.0.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjust, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Back-channel IPs to name mapping.&lt;br /&gt;
10.0.1.71	an-node01 an-node01.alteeve.com&lt;br /&gt;
10.0.1.72	an-node02 an-node02.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# Storage network&lt;br /&gt;
10.0.0.71	an-node01.sn&lt;br /&gt;
10.0.0.72	an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Internet facing&lt;br /&gt;
192.168.1.71	an-node01.inet&lt;br /&gt;
192.168.1.72	an-node02.inet&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test this, ping both nodes by name and make sure the ping packets are sent on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.0.1.0/24&amp;lt;/span&amp;gt; subnet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (10.0.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=1 ttl=64 time=0.049 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=2 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=3 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=4 ttl=64 time=0.055 ms&lt;br /&gt;
64 bytes from an-node01 (10.0.1.71): icmp_seq=5 ttl=64 time=0.055 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.0.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=1 ttl=64 time=0.221 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=2 ttl=64 time=0.188 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=3 ttl=64 time=0.217 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=4 ttl=64 time=0.192 ms&lt;br /&gt;
64 bytes from an-node02 (10.0.1.72): icmp_seq=5 ttl=64 time=0.163 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -t dsa -N &amp;quot;&amp;quot; -f ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
c4:cc:10:0a:6b:60:24:e7:57:94:69:e5:10:b2:cb:1f root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ DSA 1024]----+&lt;br /&gt;
|+oo ..B*.        |&lt;br /&gt;
|o+ o =+B         |&lt;br /&gt;
|  + +.  *        |&lt;br /&gt;
| . o . .         |&lt;br /&gt;
|    o E S        |&lt;br /&gt;
|     . .         |&lt;br /&gt;
|      .          |&lt;br /&gt;
|                 |&lt;br /&gt;
|                 |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files; The private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private which &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN DSA PRIVATE KEY-----&lt;br /&gt;
MIIBugIBAAKBgQCVo5nzeC/W8HWaFkD4pAmWO7ovf7S01f8HgocKKOYX/nMNxRui&lt;br /&gt;
wExBUUUt1b2TxYYQklTd9dn8UAzZ3UohN0CJNDrp//t2wfyACKKc2q+ewao5/svQ&lt;br /&gt;
xXTBu2ZPebKPcr1w9p0hq0xSr77Rg3v6Auc6AnC79DM9XkhYkVgNfgrvMwIVAKdY&lt;br /&gt;
SgTycvqNEWsJrCTTn5485yWvAoGANQ3rzIxFy2zHWyMlrpA9r5jllgxfaJVx3/Iw&lt;br /&gt;
DrEF82lr2dOmG8oYiKAhfvdgNyV7VeM2yxdjcdLPJAHHCx5BZZ7V9KjMzY26wS2r&lt;br /&gt;
d58TZJoWmO0nscmcwIbCv2at3fiMpxgr+nzD4tKxFOdWxYBwdmUpIjtJoW8wzY2H&lt;br /&gt;
uNghjL0CgYA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDN&lt;br /&gt;
bbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EE&lt;br /&gt;
D3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5AIUFX97yIig&lt;br /&gt;
n2SUltN+10NWUy4oYsA=&lt;br /&gt;
-----END DSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_dsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (10.0.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.0.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Tue Jul  6 22:28:19 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-dss AAAAB3NzaC1kc3MAAACBAJWjmfN4L9bwdZoWQPikCZY7ui9/tLTV/weChwoo5hf+cw3FG6LATEFRRS3VvZPFhhCSVN312fxQDNndSiE3QIk0Oun/+3bB/IAIopzar57Bqjn+y9DFdMG7Zk95so9yvXD2nSGrTFKvvtGDe/oC5zoCcLv0Mz1eSFiRWA1+Cu8zAAAAFQCnWEoE8nL6jRFrCawk05+ePOclrwAAAIA1DevMjEXLbMdbIyWukD2vmOWWDF9olXHf8jAOsQXzaWvZ06YbyhiIoCF+92A3JXtV4zbLF2Nx0s8kAccLHkFlntX0qMzNjbrBLat3nxNkmhaY7SexyZzAhsK/Zq3d+IynGCv6fMPi0rEU51bFgHB2ZSkiO0mhbzDNjYe42CGMvQAAAIA+bW0A/fZaUP6nk00tCeVzv+TUNxN5OJ3fiMuLVswvMKE2WaDnUgDNbbvzMJGf6v6irAbkJk9EbGGld91WAdtWzjBhZhuuHXptKiwAP3+YMJS7EJRs84EED3Sy3xCD+Wp3UkxrMZvaLC9onCZU+BqWjlD8wz6XJNYob/piF+jG5A== root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, lets take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour.&lt;br /&gt;
&lt;br /&gt;
In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
[http://www.clusterlabs.org Pacemaker] is the cluster resource manager. It can be used to trigger scripts to control non cluster-aware applications. In this way, these non cluster-aware applications can be made more highly available. It is considered a replacement for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
Please see: [[Two-Node Fedora 13 cluster.conf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Once it&#039;s setup, we need to verify it. Once you&#039;ve finished, be sure to run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
A note; Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Pacemaker ===&lt;br /&gt;
&lt;br /&gt;
ToDO.&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; be assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
With power fencing, the term used is &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead. Picture it like an old west dual. If one node is dead, the other node is going to win the dual by default and the dead node will just be shot again. When both nodes are alive, however, the faster node will win and will &amp;quot;kill&amp;quot; (power off or reset) the slower node before it has a chance to fire. Once this dual is over, the surviving node can then access the shared resource confident that it is the only one working on it.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly; Testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster. If you have other fence devices, like [[IPMI]], [[DRAC]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon. We&#039;ll cover the details of the [[cluster.conf]] file in a moment.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. From there, it gets the information needed to find and access the fence device. Once it connects to the fence device, it then passes the options set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; argument.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr=motoko.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login=motoko&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd=secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet=true&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action=off&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. In general terms, the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt;&#039; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on, which could be a power jack, a power or reset button, a network switch port and so on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take.&lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
=== IPMI ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. They&#039;re website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Facade</name></author>
	</entry>
</feed>