Ivan Zini

Blog tecnico di un informatico bolognese

Failover Cluster con OpenFiler 2.3 (3a parte)

segue dalla parte 2a.

Configurazione di HeartBeat

Heartbeat si occupa di gestire lo switch delle risorse tra i due nodi, questo processo viene detto “FailOver”.
I due nodi eseguono heartbeat come servizio, il quale, invia un segnale sull’interfaccia secondaria (eth1).
Se un nodo muore, HeartBeat rileva questo evento ed elegge il nodo secondario a primario eseguendo vari script di avvio che si trovano in “/etc/ha.d/resources.d”

Occorre quindi modificare I file “/etc/ha.d/ha.cf” e “/etc/ha.d/authkeys”.

Su entrambi gli openfiler Creare il file /etc/ha.d/authkeys aggiungendovi

auth 2
2 crc

Registringiamo il permesso sul file solo all’utente root su entrambi gli openfiler:

 chmod 600 /etc/ha.d/authkeys

Creare il file /etc/ha.d/ha.cf su entrambi I nodi e inserire il seguente listato:

debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
bcast eth1
keepalive 5
warntime 10
deadtime 120
initdead 120
udpport 694
auto_failback off
node openfiler01
node openfiler02

Su entrambi gli openfiler eseguire il seguente comando per avviare il servizio heartbeat al boot:

 chkconfig –level 2345 heartbeat on

Openfiler data configuration

Sulla partizione “cluster_metadata” dobbiamo creare e linkare il file di configurazione dei servizi che vogliamo siano disponibili attraverso l’HA.
Digitare su openfiler01

mkdir /cluster_metadata
mount /dev/drbd0 /cluster_metadata
mv /opt/openfiler/ /opt/openfiler.local
mkdir /cluster_metadata/opt
cp -a /opt/openfiler.local /cluster_metadata/opt/openfiler
ln -s /cluster_metadata/opt/openfiler /opt/openfiler
rm /cluster_metadata/opt/openfiler/sbin/openfiler
ln -s /usr/sbin/httpd /cluster_metadata/opt/openfiler/sbin/openfiler
rm /cluster_metadata/opt/openfiler/etc/rsync.xml
ln -s /opt/openfiler.local/etc/rsync.xml /cluster_metadata/opt/openfiler/etc/

Editiamo sempre su openfiler01 il file /opt/openfiler.local/etc/rsync.xml

<xml version=”1.0″ ?>
<rsync>
<remote hostname=”192.168.32.12″/> ## IP address of peer node.
<item path=”/etc/ha.d/haresources”/>
<item path=”/etc/ha.d/ha.cf”/>
<item path=”/etc/ldap.conf”/>
<item path=”/etc/openldap/ldap.conf”/>
<item path=”/etc/ldap.secret”/>
<item path=”/etc/nsswitch.conf”/>
<item path=”/etc/krb5.conf”/>
</rsync>

Questo file permette il sincronismo dei file di configurazione eseguiti sul nodo primario verso quello di failover secondario openfiler02
eseguire poi:

mkdir -p /cluster_metadata/etc/httpd/conf.d

Su openfiler02 eseguire:

mkdir /cluster_metadata
mv /opt/openfiler/ /opt/openfiler.local
ln -s /cluster_metadata/opt/openfiler /opt/openfiler

Editiamo sempre su openfiler02 il file /opt/openfiler.local/etc/rsync.xml

<?xml version=”1.0″ ?>
<rsync>
<remote hostname=”192.168.32.11″/> ## IP address of peer node.
<item path=”/etc/ha.d/haresources”/>
<item path=”/etc/ha.d/ha.cf”/>
<item path=”/etc/ldap.conf”/>
<item path=”/etc/openldap/ldap.conf”/>
<item path=”/etc/ldap.secret”/>
<item path=”/etc/nsswitch.conf”/>
<item path=”/etc/krb5.conf”/>
</rsync>

Configurazione del Cluster HeartBeat

Modifichiamo il file di configurazione “/cluster_metadata/opt/openfiler/etc/cluster.xml”.
Questo file genera a sua volta il file “/etc/ha.d/haresources”, il quale descrive I passi da intraprendere a HeartBeat. nel caso di failover.
Solo su openfiler0
1 editiamo /cluster_metadata/opt/openfiler/etc/cluster.xml

<?xml version=”1.0″ ?>
<cluster>
<clustering state=”on” />
<nodename value=”openfiler01″ />
<resource
value=”MailTo::ivan.zini@gmail.com::ClusterFailover”/>
<resource value=”IPaddr::192.168.100.115/24″ />
<resource value=”drbddisk::”>
<resource value=”LVM::vg0drbd”>
<resource
value=”Filesystem::/dev/drbd0::/cluster_metadata::ext3::defaults,noati
me”>
<resource value=”MakeMounts”/>
</cluster>

l’indirizzo 192.168.100.115 che abbiamo  inserito è un  IP virtuale sulla LAN che sarà l’IP del cluster su cui puntare per accedere ai servizi offerti dal cluster.

iSCSI Support

Su openfilero1 eseguire:

mv /etc/ietd.conf /cluster_metadata/etc/
ln -s /cluster_metadata/etc/ietd.conf /etc/ietd.conf
mv /etc/initiators.allow /cluster_metadata/etc/
ln -s /cluster_metadata/etc/initiators.allow /etc/initiators.allow
mv /etc/initiators.deny /cluster_metadata/etc/
ln -s /cluster_metadata/etc/initiators.deny /etc/initiators.deny

Su openfiler02 eseguire:

rm /etc/ietd.conf
ln -s /cluster_metadata/etc/ietd.conf /etc/ietd.conf
rm /etc/initiators.allow
ln -s /cluster_metadata/etc/initiators.allow /etc/initiators.allow
rm /etc/initiators.deny
ln -s /cluster_metadata/etc/initiators.deny /etc/initiators.deny

Configurazione del Volume Group

Solo su openfiler01 creiamo  il Volume Group utilizzando “/dev/drbd1”:

pvcreate /dev/drbd1

vgcreate vg0drbd /dev/drbd1

segue  parte 4a.

Lascia un Commento

Fill in your details below or click an icon to log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Log Out / Modifica )

Foto Twitter

You are commenting using your Twitter account. Log Out / Modifica )

Foto di Facebook

You are commenting using your Facebook account. Log Out / Modifica )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 45 other followers