OpenSVC |
|||||||||
High Availabity setupThis cookbook presents the steps to setup an automated OpenSVC service failover using open-ha for the heartbeat. open-ha is our preferred heartbeat daemon because it runs on all Unix operating systems, proposes multiple multicast heartbeat paths using a mix of IP and SCSI, and has a flexible trigger support. Best practice for heartbeat infrastructure
InstallationOpenSVCThis cookbook focuses on adding HA to an existing OpenSVC clustered service. Please refer to: Open-HADownload open-ha from here. The default location of all this program's files is /usr/local/cluster. Before using any open-ha commands, you have to setup some environment variables: # export EZ=/usr/local/cluster # . /usr/local/cluster/env.sh SetupDescribe cluster nodesIn file /usr/local/cluster/conf/nodes: node108 node109 Note:
Describe heartbeat pathsTo setup 3 multicast heartbeats, in file /usr/local/cluster/conf/monitor: node108 net eth1 239.131.50.10 1780 60 node108 net eth2 239.131.51.10 1780 60 node108 net eth3 239.131.52.10 1780 60 node109 net eth1 239.131.50.10 1781 60 node109 net eth2 239.131.51.10 1781 60 node109 net eth3 239.131.52.10 1781 60 Where:
Note:
Add services$EZ_BIN/service -a svc1 /opt/opensvc/etc/svc_name node108 node109 /bin/true Where:
StartupMake sure the heartbeat daemons are setup for startup at boot. If not, depending on your system, apply some commands simalar to: ln -s /usr/local/cluster/bin/ezha /etc/rc3.d/S99cluster ln -s /usr/local/cluster/bin/ezha /etc/rc0.d/K01cluster ln -s /usr/local/cluster/bin/ezha /etc/rcS.d/K01cluster Then run: /usr/local/cluster/bin/ezha start DaemonsStarting the ezha init script will spawn the following daemons:
UseDisplay the service cluster status# /usr/local/cluster/bin/service -s mysvc service owned_by nodeA nodeB svc1 nodeB FROZEN_STOP STARTED svc2 nodeA STARTED STOPPED Service status
Trigger a failoverWhen a service is handled to any heartbeat daemon, you must not use stop/start OpenSVC commands to drive this service: the heartbeat daemon being in charge, you must use its command set only. On the node where the service is RUNNING: # /usr/local/cluster/bin/service -s mysvc -a freeze-stop # /usr/local/cluster/bin/service -s mysvc -a unfreeze |
|||||||||
|
Copyright © 2010 OpenSVC - Powered by web2py |
|||||||||