[Linux-HA] HB general question
Slawomir Mroczek
s.mroczek at wasko.pl
Wed Dec 13 06:32:24 MST 2006
On Wed, 13 Dec 2006 10:36:32 +0100
MIQUET Pascal <pascal.miquet at wanadoo.fr> wrote:
> I've got some other questions :
> Can I start a specific script on activation of the HB service ?
Yes. You can use LSB (/etc/init.d/) or OCF Resource Agent
(/usr/lib/ocf/resource.d/heartbeat) scripts.
> If the answer is yes, is there a way to know if the script runs on the
> primary server or on the secondary secondary, and the state (I mean
> primary is up an got services, secondary is up and primary got
> services)
Nodes will share information about resources status. That's how HA
works.
> Primary 192.168.1.221
> Secondary 192.168.1.222
>
> Virtual IP 192.168.1.220
>
> Primary UP -> Got Virtual IP, run httpd, mount NFS file system from
> Secondary
> Secondary UP -> mount devices, and export NFS file system
>
> Secondary DOWN !!!
> Primary UP -> Got Virtual IP, run httpd, mount devices
>
> Primary DOWN !!!
> Secondary UP -> Got Virtual IP, run httpd, mount devices
>
>
> Does it make sense ?
No. It does not. Why do you want to use NFS? And what device do you
want to mount on primary node when secondary node goes down?? Have gou
got shared storage? If so, there is no need to use NFS. Use some cluser
filesystem such as GFS. If you don't have any shared storage there is
problem with filesystem replication you want to mount on any node in
cluster. Consider that scenario:
a) with shared storage (no cluserfs):
primary up -> got VIP (Virtual IP), mount devices, run httpd
secondary up -> just wait for primary node failure
primary down
secondary up -> takeover VIP, mount devices, run httpd
b) with shared storage (cluserfs):
primary up -> got VIP (Virtual IP), mount devices, run httpd
secondary up -> mount devices, wait for primary node failure
primary down
secondary up -> takeover VIP, run httpd
c) no shared storage:
You should use network mirrored device i.e. drdb (http://www.drdb.org)
primary up -> got VIP, drbd to primary state (active), mount, run httpd
secondary up -> drbd to secondary state (unable to mount, but mirror
data form primary node)
primary down
secondary up -> takeover VIP, drbd to primary state, mount, run httpd
primary up -> drbd to secondary state (run synchronization with
secondary node)
secondary up -> got VIP, drbd still in primary state, run httpd
--
Slawomir Mroczek
More information about the Linux-HA
mailing list