Each node needs an entry in /etc/hosts. The hostname must be identical to the nodename in /etc/cluster.conf.
Code:
172.16.40.50 node01
172.16.40.51 node02
You need to create the /etc/yum.repos.d/csgfs.repo file:
Code:
[csgfs]
name=CentOS-5 - CSGFS
baseurl=http://mirror.centos.org/centos/$releasever/csgfs/$basearch/
gpgcheck=1
enabled=1
The following packages need to be installed on all nodes:
Code:
# yum install cman gfs-utils kmod-gfs lvm2-cluster
lvm2 clustering needs to be enabled
Code:
lvmconf --enable-cluster
For a beginning, the following /etc/cluster.conf may be used:
Code:
<?xml version="1.0"?>
<cluster config_version="1" name="atixcluster">
<cman expected_votes="1" two_node="1"/>
<fence_daemon clean_start="1" post_fail_delay="0" post_join_delay="3"/>
<clusternodes>
<clusternode name="node01" votes="1" nodeid="1">
<fence>
<method name="1">
</method>
</fence>
</clusternode>
<clusternode name="node02" votes="1" nodeid="2">
<fence>
<method name="1">
</method>
</fence>
</clusternode>
</clusternodes>
<cman/>
<fencedevices/>
<rm>
<failoverdomains/>
<resources/>
</rm>
</cluster>
Please note that you must configure a valid fencing method for productive use. The default method "Fence manual" is only suitable for first tests.
Also be aware that this is a special two node configuration.
It is better to include a third node or a quorum device to get another vote and to further avoid any split brain issues.
Now you may start your cluster:
Code:
# /etc/init.d/ccsd start
# /etc/init.d/cman start
# /etc/init.d/fenced start
Now you may create your first GFS volume:
Code:
# pvcreate /dev/sdx
# vgcreate vg_gfs /dev/sdx
# lvcreate lvcreate -l $(vgdisplay vg_gfs | grep "Total PE" | cut -d " " -f18-) -n lv_gfs vg_gfs
# gfs_mkfs -j 3 -t atixcluster:lv_gfs -p lock_dlm /dev/vg_gfs/lv_gfs
Have fun...