html/ 0040755 0001605 0000001 00000000000 07177570450 0012341 5 ustar 00gferg other 0000264 0000003 html/doc-index.html 0100644 0001605 0000001 00000060333 07177570253 0015104 0 ustar 00gferg other 0000264 0000003 <HTML
><HEAD
><TITLE
>Index</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
REL="HOME"
TITLE="Linux FailSafe™ Programmer's
Guide"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Glossary"
HREF="g3001.html"></HEAD
><BODY
CLASS="INDEX"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux FailSafe<SUP
>™</SUP
> Programmer's
Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="g3001.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
> </TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="DOC-INDEX"
>Index</A
></H1
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3256"
>Symbols</A
></H1
><DL
><DT
>/etc/failsafe/cmon_process_groups directory,
<A
HREF="z942786646lhj.html"
>Monitoring Agents</A
>
</DT
><DT
>/usr/lib/failsafe/cmgr-templates/cmgr-create-resource_type directory,
<A
HREF="z943900431lhj.html"
>Using cluster_mgr With a Script</A
>
</DT
><DT
>/usr/lib/failsafe/policies directory,
<A
HREF="fpcontent.html#AEN1645"
>Failover Scripts</A
>
</DT
><DT
> resource group
</DT
><DD
><DL
><DT
>definition,
<A
HREF="le60545-parent.html#AEN261"
>Resource Group</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3271"
>A</A
></H1
><DL
><DT
>action scripts,
<A
HREF="le60545-parent.html#AEN399"
>Action Scripts</A
>
</DT
><DD
><DL
><DT
>examples,
<A
HREF="le49536-parent.html"
>Examples of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>failure of,
<A
HREF="z942787505lhj.html#Z944596365SMG"
>Failure of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>format
</DT
><DD
><DL
><DT
>basic action,
<A
HREF="z942786582lhj.html#AEN1237"
>Basic Action </A
>
</DT
><DT
>completion,
<A
HREF="z942786582lhj.html#AEN1303"
>Complete the Action</A
>
</DT
><DT
>exit status,
<A
HREF="z942786582lhj.html#AEN1206"
>Exit Status</A
>
</DT
><DT
>header,
<A
HREF="z942786582lhj.html#AEN1147"
>Header Information</A
>
</DT
><DT
>overview,
<A
HREF="z942786582lhj.html"
>Script Format</A
>
</DT
><DT
>read input file,
<A
HREF="z942786582lhj.html#AEN1287"
>Read Input File</A
>
</DT
><DT
>read resource information,
<A
HREF="z942786582lhj.html#AEN1157"
>Set Local Variables</A
>,
<A
HREF="z942786582lhj.html#AEN1177"
>Read Resource Information</A
>
</DT
><DT
>set global variables,
<A
HREF="z942786582lhj.html#AEN1254"
>Set Global Variables</A
>
</DT
><DT
>set local variables,
<A
HREF="z942786582lhj.html#AEN1157"
>Set Local Variables</A
>
</DT
><DT
>verify arguments,
<A
HREF="z942786582lhj.html#AEN1271"
>Verify Arguments</A
>
</DT
></DL
></DD
><DT
>monitoring
</DT
><DD
><DL
><DT
>frequence,
<A
HREF="z942786569lhj.html#AEN1059"
>How Often Should Monitoring Occur?</A
>
</DT
><DT
>necessity of,
<A
HREF="z942786569lhj.html#LE54960-PARENT"
>Is Monitoring Necessary?</A
>
</DT
><DT
>testing examples,
<A
HREF="z942786569lhj.html#AEN1072"
>Examples of Testing for Monitoring Failure</A
>
</DT
><DT
>types,
<A
HREF="z942786569lhj.html#AEN1031"
>Types of Monitoring</A
>
</DT
></DL
></DD
><DT
>optional,
<A
HREF="z942786554lhj.html"
>Set of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>preparation for writing scripts,
<A
HREF="z942786569lhj.html"
>Preparation</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>required,
<A
HREF="z942786554lhj.html"
>Set of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>resource types provided,
<A
HREF="z942786569lhj.html"
>Preparation</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>set of scripts,
<A
HREF="z942786554lhj.html"
>Set of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>successful execution results,
<A
HREF="z942787505lhj.html#Z942863078LHJ"
>Successful Execution of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>templates,
<A
HREF="z942786569lhj.html"
>Preparation</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>testing,
<A
HREF="x2401.html"
>Testing an Action Script</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>writing steps,
<A
HREF="z942786601lhj.html"
>Steps in Writing a Script</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>agents,
<A
HREF="z942786646lhj.html"
>Monitoring Agents</A
>
</DT
><DT
>application failover domain,
<A
HREF="le60545-parent.html#AEN362"
>Failover Domain</A
>
</DT
><DT
>attributes,
<A
HREF="fpcontent.html#AEN1567"
>Failover Attributes</A
>
</DT
><DT
>Auto_Failback failover attribute,
<A
HREF="fpcontent.html#AEN1567"
>Failover Attributes</A
>
</DT
><DT
>Auto_Recovery failover attribute,
<A
HREF="fpcontent.html#AEN1567"
>Failover Attributes</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3344"
>C</A
></H1
><DL
><DT
>check arguments,
<A
HREF="x2852.html"
>Check Arguments</A
>
</DT
><DT
>cluster,
<A
HREF="le60545-parent.html#AEN207"
>Cluster</A
>
</DT
><DT
>cluster node,
<A
HREF="le60545-parent.html#AEN192"
>Cluster Node (or Node)</A
>
</DT
><DT
>cluster_mgr command,
<A
HREF="z943900404lhj.html"
>Using cluster_mgr Interactively</A
>
</DT
><DT
>cmgr command,
<A
HREF="z943900404lhj.html"
>Using cluster_mgr Interactively</A
>
</DT
><DT
>cmond process
</DT
><DD
><DL
><DT
>configuration,
<A
HREF="z942786646lhj.html"
>Monitoring Agents</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>command execution function,
<A
HREF="x2890.html"
>Execute a Command</A
>
</DT
><DT
>command path,
<A
HREF="x2618.html#AEN2644"
>HA_CMDSPATH</A
>
</DT
><DT
>concepts,
<A
HREF="le60545-parent.html"
>Concepts</A
>
</DT
><DT
>configurations
</DT
><DD
><DL
><DT
>N+1,
<A
HREF="fpexample.html#AEN1767"
>N+1 Configuration for Linux FailSafe</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>N+2,
<A
HREF="fpexample.html#AEN1823"
>N+2 Configuration</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>N+M,
<A
HREF="fpexample.html#AEN1866"
>N+M Configuration for Linux FailSafe</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>Controlled_Failback failover attribute,
<A
HREF="fpcontent.html#AEN1567"
>Failover Attributes</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3385"
>D</A
></H1
><DL
><DT
>database location,
<A
HREF="x2618.html#AEN2709"
>HA_CDB</A
>
</DT
><DT
>debug script messages,
<A
HREF="x2618.html#AEN2759"
>HA_DBGLOG</A
>
</DT
><DT
>debugging information in action scripts,
<A
HREF="x2321.html"
>General Testing and Debugging Techniques</A
>
</DT
><DT
>dependency list,
<A
HREF="le60545-parent.html#AEN318"
>Resource Type Dependency List</A
>
</DT
><DT
>domain,
<A
HREF="le60545-parent.html#AEN362"
>Failover Domain</A
>,
<A
HREF="fpcontent.html#AEN1522"
>Failover Domain</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3403"
>E</A
></H1
><DL
><DT
>environment variables,
<A
HREF="x2618.html"
>Set Global Definitions</A
>
</DT
><DT
>exclusive script
</DT
><DD
><DL
><DT
>example,
<A
HREF="le49536-parent.html#AEN1412"
>exclusive Script</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>exclusive script
</DT
><DD
><DL
><DT
>definition,
<A
HREF="z942786554lhj.html"
>Set of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>execute a command,
<A
HREF="x2890.html"
>Execute a Command</A
>
</DT
><DT
>exit status in action scripts,
<A
HREF="z942786582lhj.html#AEN1206"
>Exit Status</A
>
</DT
><DT
>exit_script() function,
<A
HREF="z942786582lhj.html#AEN1206"
>Exit Status</A
>,
<A
HREF="x2401.html"
>Testing an Action Script</A
>
</DT
><DT
>exit_status value,
<A
HREF="z942786582lhj.html#AEN1206"
>Exit Status</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3429"
>F</A
></H1
><DL
><DT
>failover,
<A
HREF="le60545-parent.html#AEN341"
>Failover</A
>
</DT
><DT
>failover attributes,
<A
HREF="le60545-parent.html#AEN374"
>Failover Attribute</A
>,
<A
HREF="fpcontent.html#AEN1567"
>Failover Attributes</A
>
</DT
><DT
>failover domain,
<A
HREF="le60545-parent.html#AEN362"
>Failover Domain</A
>,
<A
HREF="fpcontent.html#AEN1522"
>Failover Domain</A
>
</DT
><DT
>failover policy,
<A
HREF="le60545-parent.html#AEN347"
>Failover Policy</A
>
</DT
><DD
><DL
><DT
>contents,
<A
HREF="fpcontent.html"
>Contents of a Failover Policy</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>examples
</DT
><DD
><DL
><DT
>N+1,
<A
HREF="fpexample.html#AEN1767"
>N+1 Configuration for Linux FailSafe</A
>
</DT
><DT
>N+2,
<A
HREF="fpexample.html#AEN1823"
>N+2 Configuration</A
>
</DT
><DT
>N+M,
<A
HREF="fpexample.html#AEN1866"
>N+M Configuration for Linux FailSafe</A
>
</DT
></DL
></DD
><DT
>failover attributes,
<A
HREF="fpcontent.html#AEN1567"
>Failover Attributes</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>failover domain,
<A
HREF="fpcontent.html#AEN1522"
>Failover Domain</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>failover script,
<A
HREF="fpcontent.html#AEN1645"
>Failover Scripts</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>failover script interface,
<A
HREF="fpinterface.html"
>Failover Script Interface</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>failover script
</DT
><DD
><DL
><DT
>description,
<A
HREF="le60545-parent.html#AEN382"
>Failover Scripts</A
>,
<A
HREF="fpcontent.html#AEN1645"
>Failover Scripts</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>interface,
<A
HREF="fpinterface.html"
>Failover Script Interface</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>field value,
<A
HREF="x2932.html"
>Get the Value for a Field</A
>
</DT
><DT
>filesystemresource type,
<A
HREF="plugin.html"
>Plug-Ins</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3475"
>G</A
></H1
><DL
><DT
>get_xxx_info() function,
<A
HREF="z942786582lhj.html#AEN1177"
>Read Resource Information</A
>
</DT
><DT
>global definition setting,
<A
HREF="x2618.html"
>Set Global Definitions</A
>
</DT
><DT
>global variables,
<A
HREF="z942786582lhj.html#AEN1254"
>Set Global Variables</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3486"
>H</A
></H1
><DL
><DT
>HA_CDB environment variable,
<A
HREF="x2618.html#AEN2709"
>HA_CDB</A
>
</DT
><DT
>ha_check_args() function,
<A
HREF="z942786582lhj.html#AEN1271"
>Verify Arguments</A
>,
<A
HREF="x2852.html"
>Check Arguments</A
>
</DT
><DT
>HA_CMDSPATH environment variable,
<A
HREF="x2618.html#AEN2644"
>HA_CMDSPATH</A
>
</DT
><DT
>HA_CMD_FAILED environment variable,
<A
HREF="x2618.html#AEN2818"
>HA_CMD_FAILED</A
>
</DT
><DT
>HA_CURRENT_LOGLEVEL environment variable,
<A
HREF="x2618.html#AEN2769"
>HA_CURRENT_LOGLEVEL</A
>
</DT
><DT
>HA_DBGLOG environment variable,
<A
HREF="x2618.html#AEN2759"
>HA_DBGLOG</A
>
</DT
><DT
>HA_DBGLVL environment variable,
<A
HREF="x2618.html#AEN2728"
>HA_DBGLVL</A
>
</DT
><DT
>ha_execute_cmd() function,
<A
HREF="x2890.html"
>Execute a Command</A
>
</DT
><DT
>ha_execute_cmd_ret() function,
<A
HREF="x2890.html"
>Execute a Command</A
>
</DT
><DT
>ha_get_field() function,
<A
HREF="x2932.html"
>Get the Value for a Field</A
>
</DT
><DT
>ha_get_info() function,
<A
HREF="x2955.html"
>Get Resource Information</A
>
</DT
><DT
>HA_HOSTNAME environment variable,
<A
HREF="x2618.html#AEN2632"
>HA_HOSTNAME</A
>
</DT
><DT
>HA_INVAL_ARGS environment variable,
<A
HREF="x2618.html#AEN2810"
>HA_INVAL_ARGS</A
>
</DT
><DT
>HA_LOG environment variable,
<A
HREF="x2618.html#AEN2780"
>HA_LOG</A
>
</DT
><DT
>HA_LOGCMD environment variable,
<A
HREF="x2618.html#AEN2678"
>HA_LOGCMD</A
>
</DT
><DT
>HA_NOCFGINFO environment variable,
<A
HREF="x2618.html#AEN2845"
>HA_NOCFGINFO</A
>
</DT
><DT
>HA_NORMLVL environment variable,
<A
HREF="x2618.html#AEN2721"
>HA_NORMLVL</A
>
</DT
><DT
>HA_NOTSUPPORTED environment variable,
<A
HREF="x2618.html#AEN2837"
>HA_NOTSUPPORTED</A
>
</DT
><DT
>HA_NOT_RUNNING environment variable,
<A
HREF="x2618.html#AEN2802"
>HA_NOT_RUNNING</A
>
</DT
><DT
>ha_print_exclusive_status() function,
<A
HREF="x2982.html"
>Print Exclusivity Check Messages</A
>
</DT
><DT
>ha_print_exclusive_status_all_resources() function,
<A
HREF="x2982.html"
>Print Exclusivity Check Messages</A
>
</DT
><DT
>HA_PRIVCMDSPATH environment variable,
<A
HREF="x2618.html#AEN2665"
>HA_PRIVCMDSPATH</A
>
</DT
><DT
>ha_read_infile() function,
<A
HREF="z942786582lhj.html#AEN1287"
>Read Input File</A
>,
<A
HREF="x2876.html"
>Read an Input File</A
>
</DT
><DT
>HA_RESOURCEQUERYCMD environment variable,
<A
HREF="x2618.html#AEN2686"
>HA_RESOURCEQUERYCMD</A
>
</DT
><DT
>HA_RUNNING environment variable,
<A
HREF="x2618.html#AEN2829"
>HA_RUNNING</A
>
</DT
><DT
>HA_SCRIPTGROUP environment variable,
<A
HREF="x2618.html#AEN2737"
>HA_SCRIPTGROUP</A
>
</DT
><DT
>HA_SCRIPTSUBSYS environment variable,
<A
HREF="x2618.html#AEN2747"
>HA_SCRIPTSUBSYS</A
>
</DT
><DT
>HA_SCRIPTTMPDIR environment variable,
<A
HREF="x2618.html#AEN2699"
>HA_SCRIPTTMPDIR</A
>
</DT
><DT
>HA_SUCCESS environment variable,
<A
HREF="x2618.html#AEN2791"
>HA_SUCCESS</A
>
</DT
><DT
>ha_write_status_for_all_resources() function,
<A
HREF="x2912.html"
>Write Status for a Resource</A
>
</DT
><DT
>ha_write_status_for_resource function,
<A
HREF="z942786582lhj.html#AEN1206"
>Exit Status</A
>
</DT
><DT
>ha_write_status_for_resource() function,
<A
HREF="x2912.html"
>Write Status for a Resource</A
>
</DT
><DT
>high availability characterists,
<A
HREF="le56070-parent.html"
>Characteristics that Permit an Application to be Highly Available</A
>
</DT
><DT
>highly available
</DT
><DD
><DL
><DT
>services,
<A
HREF="le37432-parent.html"
>Highly Available Services Included with Linux FailSafe</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>hostname,
<A
HREF="x2618.html#AEN2644"
>HA_CMDSPATH</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3596"
>I</A
></H1
><DL
><DT
>initial failover domain,
<A
HREF="fpcontent.html#AEN1522"
>Failover Domain</A
>
</DT
><DT
>InPlace_Recovery failover attribute,
<A
HREF="fpcontent.html#AEN1567"
>Failover Attributes</A
>
</DT
><DT
>input file,
<A
HREF="x2876.html"
>Read an Input File</A
>
</DT
><DT
>IP address service,
<A
HREF="le37432-parent.html"
>Highly Available Services Included with Linux FailSafe</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3610"
>L</A
></H1
><DL
><DT
>logs,
<A
HREF="x2618.html#AEN2747"
>HA_SCRIPTSUBSYS</A
>
</DT
><DT
>LVM logical volume service,
<A
HREF="plugin.html"
>Plug-Ins</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3618"
>M</A
></H1
><DL
><DT
>MAC address service,
<A
HREF="plugin.html"
>Plug-Ins</A
>
</DT
><DT
>MAC_address resource type,
<A
HREF="plugin.html"
>Plug-Ins</A
>
</DT
><DT
>membership,
<A
HREF="le60545-parent.html#AEN213"
>Node Membership</A
>
</DT
><DT
>monitor script
</DT
><DD
><DL
><DT
>example,
<A
HREF="le49536-parent.html#AEN1390"
>monitor Script</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>monitor script
</DT
><DD
><DL
><DT
>definition,
<A
HREF="z942786554lhj.html"
>Set of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>monitoring
</DT
><DD
><DL
><DT
>agents,
<A
HREF="z942786646lhj.html"
>Monitoring Agents</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>failure,
<A
HREF="z942786569lhj.html#AEN1046"
>What are the Symptoms of Monitoring Failure?</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>frequence,
<A
HREF="z942786569lhj.html#AEN1059"
>How Often Should Monitoring Occur?</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>necessity of,
<A
HREF="z942786569lhj.html#LE54960-PARENT"
>Is Monitoring Necessary?</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>script testing,
<A
HREF="x2482.html"
>Special Testing Considerations for the monitor Script</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>testing examples,
<A
HREF="z942786569lhj.html#AEN1072"
>Examples of Testing for Monitoring Failure</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>types,
<A
HREF="z942786569lhj.html#LE54960-PARENT"
>Is Monitoring Necessary?</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3653"
>N</A
></H1
><DL
><DT
>node,
<A
HREF="le60545-parent.html#AEN192"
>Cluster Node (or Node)</A
>
</DT
><DT
>node membership,
<A
HREF="le60545-parent.html#AEN213"
>Node Membership</A
>
</DT
><DT
>node status,
<A
HREF="x2321.html"
>General Testing and Debugging Techniques</A
>
</DT
><DT
>nodename output,
<A
HREF="x2618.html#AEN2644"
>HA_CMDSPATH</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3667"
>O</A
></H1
><DL
><DT
>order ranges for resource types,
<A
HREF="le43007-parent.html"
>Defining a New Resource Type</A
>
</DT
><DT
>ordered failover script,
<A
HREF="fpcontent.html#AEN1661"
>The ordered Failover Script</A
>
</DT
><DT
>overview of the programming steps,
<A
HREF="le37841-parent.html"
>Overview of the Programming Steps</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3678"
>P</A
></H1
><DL
><DT
>path to user commands,
<A
HREF="x2618.html#AEN2644"
>HA_CMDSPATH</A
>
</DT
><DT
>plug-ins,
<A
HREF="plugin.html"
>Plug-Ins</A
>
</DT
><DT
>pool,
<A
HREF="le60545-parent.html#AEN201"
>Pool</A
>
</DT
><DT
>print exclusivity check messages,
<A
HREF="x2982.html"
>Print Exclusivity Check Messages</A
>
</DT
><DT
>privileged command path,
<A
HREF="x2618.html#AEN2665"
>HA_PRIVCMDSPATH</A
>
</DT
><DT
>process
</DT
><DD
><DL
><DT
>membership,
<A
HREF="le60545-parent.html#AEN221"
>Process Membership</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>programming steps overview,
<A
HREF="le37841-parent.html"
>Overview of the Programming Steps</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3702"
>R</A
></H1
><DL
><DT
>read an input file,
<A
HREF="x2876.html"
>Read an Input File</A
>
</DT
><DT
>resource
</DT
><DD
><DL
><DT
>definition,
<A
HREF="le60545-parent.html#AEN228"
>Resource</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>dependency list,
<A
HREF="le60545-parent.html#AEN318"
>Resource Type Dependency List</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>name,
<A
HREF="le60545-parent.html#AEN254"
>Resource Name</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>query command,
<A
HREF="x2618.html#AEN2686"
>HA_RESOURCEQUERYCMD</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>resource group
</DT
><DD
><DL
><DT
>states,
<A
HREF="z942787505lhj.html#Z942863078LHJ"
>Successful Execution of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>resource information
</DT
><DD
><DL
><DT
>obtaining,
<A
HREF="x2955.html"
>Get Resource Information</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>read into an action script,
<A
HREF="z942786582lhj.html#AEN1177"
>Read Resource Information</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>resource type
</DT
><DD
><DL
><DT
>cluster_mgr use,
<A
HREF="z943900404lhj.html"
>Using cluster_mgr Interactively</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>dependency list,
<A
HREF="le60545-parent.html#AEN318"
>Resource Type Dependency List</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>description,
<A
HREF="le60545-parent.html#AEN236"
>Resource Type</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>GUI use,
<A
HREF="z943900385lhj.html#AEN2110"
>Define a New Resource Type</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>information required to define a new resource type,
<A
HREF="le43007-parent.html"
>Defining a New Resource Type</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>order ranges,
<A
HREF="le43007-parent.html"
>Defining a New Resource Type</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>provided with Linux FailSafe,
<A
HREF="le37432-parent.html"
>Highly Available Services Included with Linux FailSafe</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>restart mode,
<A
HREF="le43007-parent.html"
>Defining a New Resource Type</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>script templates,
<A
HREF="z943900431lhj.html"
>Using cluster_mgr With a Script</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>script use,
<A
HREF="z943900431lhj.html"
>Using cluster_mgr With a Script</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>restart script
</DT
><DD
><DL
><DT
>example,
<A
HREF="le49536-parent.html#AEN1425"
>restart Script</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>restart mode,
<A
HREF="le43007-parent.html"
>Defining a New Resource Type</A
>
</DT
><DT
>restart script
</DT
><DD
><DL
><DT
>definition,
<A
HREF="z942786554lhj.html"
>Set of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>root command path,
<A
HREF="x2618.html#AEN2665"
>HA_PRIVCMDSPATH</A
>
</DT
><DT
>run-time failover domain,
<A
HREF="fpcontent.html#AEN1522"
>Failover Domain</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3766"
>S</A
></H1
><DL
><DT
>script group log,
<A
HREF="x2618.html#AEN2737"
>HA_SCRIPTGROUP</A
>
</DT
><DT
>script library,
<A
HREF="z944252972lhj.html"
>Using the SRM Script Library</A
>
</DT
><DT
>script testing
</DT
><DD
><DL
><DT
>action scripts,
<A
HREF="x2401.html"
>Testing an Action Script</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>monitoring script considerations,
<A
HREF="x2482.html"
>Special Testing Considerations for the monitor Script</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>techniques,
<A
HREF="x2321.html"
>General Testing and Debugging Techniques</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>script.$$ suffix,
<A
HREF="z942786601lhj.html"
>Steps in Writing a Script</A
>
</DT
><DT
>scriptlib file,
<A
HREF="z944252972lhj.html"
>Using the SRM Script Library</A
>
</DT
><DT
>scripts. See action scripts or failover script,
<A
HREF="z942786582lhj.html"
>Script Format</A
>
</DT
><DT
>set_global_variables() function,
<A
HREF="z942786582lhj.html#AEN1254"
>Set Global Variables</A
>
</DT
><DT
>set_local_variables() section of an action script,
<A
HREF="z942786582lhj.html#AEN1157"
>Set Local Variables</A
>
</DT
><DT
>start script
</DT
><DD
><DL
><DT
>example,
<A
HREF="le49536-parent.html#AEN1354"
>start Script</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>start script
</DT
><DD
><DL
><DT
>definition,
<A
HREF="z942786554lhj.html"
>Set of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>status of a node,
<A
HREF="x2321.html"
>General Testing and Debugging Techniques</A
>
</DT
><DT
>stop script
</DT
><DD
><DL
><DT
>example,
<A
HREF="le49536-parent.html#AEN1372"
>stop Script</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>stop script
</DT
><DD
><DL
><DT
>definition,
<A
HREF="z942786554lhj.html"
>Set of Action Scripts</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3816"
>T</A
></H1
><DL
><DT
>templates
</DT
><DD
><DL
><DT
>action scripts,
<A
HREF="z942786569lhj.html"
>Preparation</A
>
</DT
><DD
><DL
></DL
></DD
><DT
>resource type script definition,
<A
HREF="z943900431lhj.html"
>Using cluster_mgr With a Script</A
>
</DT
><DD
><DL
></DL
></DD
></DL
></DD
><DT
>testing scripts. See script testing,
<A
HREF="x2321.html"
>General Testing and Debugging Techniques</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3827"
>U</A
></H1
><DL
><DT
>uname command,
<A
HREF="x2618.html#AEN2644"
>HA_CMDSPATH</A
>
</DT
><DT
>user command path,
<A
HREF="x2618.html#AEN2644"
>HA_CMDSPATH</A
>
</DT
><DT
>usr/lib/failsafe/resource_types directory,
<A
HREF="le43007-parent.html"
>Defining a New Resource Type</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3838"
>V</A
></H1
><DL
><DT
>value for a field,
<A
HREF="x2932.html"
>Get the Value for a Field</A
>
</DT
><DT
>volume resource type,
<A
HREF="plugin.html"
>Plug-Ins</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3846"
>W</A
></H1
><DL
><DT
>write status for a resource,
<A
HREF="x2912.html"
>Write Status for a Resource</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3851"
>X</A
></H1
><DL
><DT
>XFS file system service,
<A
HREF="plugin.html"
>Plug-Ins</A
>
</DT
></DL
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="g3001.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
> </TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Glossary</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
> </TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
> </TD
></TR
></TABLE
></DIV
></BODY
></HTML
>/H1
><DL
><DT
>logs,
<A
HREF="x2618.html#AEN2747"
>HA_SCRIPTSUBSYS</A
>
</DT
><DT
>LVM logical volume service,
<A
HREF="plugin.html"
>Plug-Ins</A
>
</DT
></DL
><H1
CLASS="INDEXDIV"
><A
NAME="AEN3618"
>M</A
></H1
><DL
><DT
>MAC address service,
<A
HREF="plugin.html"
>Plug-Ins</html/fpcontent.html 0100644 0001605 0000001 00000050041 07177570104 0015220 0 ustar 00gferg other 0000264 0000003 <HTML
><HEAD
><TITLE
>Contents of a Failover Policy</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
REL="HOME"
TITLE="Linux FailSafe™ Programmer's
Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="Creating a Failover Policy"
HREF="le16529-parent.html"><LINK
REL="PREVIOUS"
TITLE="Creating a Failover Policy"
HREF="le16529-parent.html"><LINK
REL="NEXT"
TITLE="Failover Script Interface"
HREF="fpinterface.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux FailSafe<SUP
>™</SUP
> Programmer's
Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="le16529-parent.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 3. Creating a Failover Policy</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="fpinterface.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="FPCONTENT"
>3.1. Contents of a Failover Policy</A
></H1
><P
>A <I
CLASS="FIRSTTERM"
>failover policy</I
> is the method by which
a resource group is failed over from one node to another. A failover policy
consists of the following:</P
><P
></P
><UL
><LI
><P
>Failover domain</P
></LI
><LI
><P
>Failover attributes</P
></LI
><LI
><P
>Failover scripts</P
></LI
></UL
><P
>Linux FailSafe uses the failover domain output from a failover script
along with failover attributes to determine on which node a resource group
should reside. </P
><P
>The administrator must configure a failover policy for each resource
group. The name of the failover policy must be unique within the pool.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1522"
>3.1.1. Failover Domain</A
></H2
><P
>A <I
CLASS="FIRSTTERM"
>failover domain</I
> is the <TT
CLASS="LITERAL"
>ordered</TT
> list of nodes on which a given resource group can be allocated.
The nodes listed in the failover domain <TT
CLASS="LITERAL"
>must</TT
> be within
the same cluster; however, the failover domain does not have to include
every node in the cluster. The failover domain can also be used to statically
load balance the resource groups in a cluster.</P
><P
>Examples:<P
></P
><UL
><LI
><P
>In a four–node cluster, a set of two nodes that
have access to a particular XLV volume may be the failover domain of the
resource group containing that XLV volume.</P
></LI
><LI
><P
>In a cluster of nodes named venus, mercury, and pluto,
you could configure the following initial failover domains for resource
groups RG1 and RG2: <P
></P
><UL
><LI
><P
>mercury, venus, pluto for RG1</P
></LI
><LI
><P
>pluto, mercury for RG2</P
></LI
></UL
></P
></LI
></UL
></P
><P
>The administrator defines the initial failover domain
when configuring a failover policy. The initial failover domain is used
when a cluster is first booted. The ordered list specified by the initial
failover domain is transformed into a run-time failover domain
by the failover script. With each failure, the failover script takes the
current run-time failover domain and potentially modifies it; the initial
failover domain is never used again. Depending on the run-time conditions
and contents of the failover script, the initial and run-time failover
domains may be identical.</P
><P
>For example, suppose the initial failover domain is: <P
CLASS="LITERALLAYOUT"
>N1 N2 N3</P
></P
><P
>The runtime failover domain will vary based on the failover script: <P
></P
><UL
><LI
><P
>If <TT
CLASS="LITERAL"
>ordered</TT
>: <P
CLASS="LITERALLAYOUT"
>N1 N2 N3</P
></P
></LI
><LI
><P
>If <TT
CLASS="LITERAL"
>round-robin</TT
>: <P
CLASS="LITERALLAYOUT"
>N2 N3 N1</P
></P
></LI
><LI
><P
>If a customized failover script, the order could be any
permutation, based on the contents of the script: <P
CLASS="LITERALLAYOUT"
>N1 N2 N3<br>
N1 N3 N2<br>
N2 N3 N1<br>
N2 N1 N3<br>
N3 N2 N1<br>
N3 N1 N2</P
></P
></LI
></UL
></P
><P
>Linux FailSafe stores the run-time failover domain and uses it as
input to the next failover script invocation.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1567"
>3.1.2. Failover Attributes</A
></H2
><P
>A <I
CLASS="FIRSTTERM"
>failover attribute</I
> is a value that is passed
to the failover scrip and used by Linux FailSafe for the purpose of modifying
the run-time failover domain for a specific resource group. There are
required and optional failover attributes, and you can also specify your
own strings as attributes. </P
><P
><A
HREF="fpcontent.html#LE45720-PARENT"
>Table 3-1</A
> shows the required failover attributes.
You must specify one and only one of these attributes. Note that the
starting conditions for the attributes differs: for the required attributes,
the starting condition is that a node joins the cluster membership when
the cluster is already providing HA services; for the optional attributes,
the starting condition is that HA services are started and the resource
group is running in only one node in the cluster</P
><DIV
CLASS="TABLE"
><A
NAME="LE45720-PARENT"
></A
><P
><B
>Table 3-1. Required Failover Attributes (mutually exclusive)</B
></P
><TABLE
BORDER="1"
WIDTH="100%"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
WIDTH="34%"
ALIGN="LEFT"
VALIGN="BOTTOM"
><P
>Name</P
></TH
><TH
WIDTH="66%"
ALIGN="LEFT"
VALIGN="BOTTOM"
><P
>Description</P
></TH
></TR
></THEAD
><TBODY
><TR
><TD
WIDTH="34%"
ALIGN="LEFT"
VALIGN="TOP"
><P
><TT
CLASS="LITERAL"
>Auto_Failback</TT
></P
></TD
><TD
WIDTH="66%"
ALIGN="LEFT"
VALIGN="TOP"
><P
>Specifies that the resource group
is made online based on the failover policy when a node joins the cluster.
This attribute is best used when some type of load balancing is required.
You must specify either this attribute or the <TT
CLASS="LITERAL"
>Controlled_Failback</TT
> attribute.</P
></TD
></TR
><TR
><TD
WIDTH="34%"
ALIGN="LEFT"
VALIGN="TOP"
><P
><TT
CLASS="LITERAL"
>Controlled_Failback</TT
></P
></TD
><TD
WIDTH="66%"
ALIGN="LEFT"
VALIGN="TOP"
><P
>Specifies that the resource group
remains on the same node when a node joins the cluster. This attribute
is best used when client/server applications have expensive recovery mechanisms,
such as databases or any application that uses <TT
CLASS="LITERAL"
>tcp</TT
>
to communicate. You must specify either this attribute or the <TT
CLASS="LITERAL"
>Auto_Failback</TT
> attribute.</P
></TD
></TR
></TBODY
></TABLE
></DIV
><P
>When defining a failover policy, you can optionally also choose
one and only one of the recovery attributes shown in <A
HREF="fpcontent.html#LE27762-PARENT"
>Table 3-2</A
>.
The recovery attribute determines the node on which a resource group will
be allocated when its state changes to online and a member of the group
is already allocated (such as when volumes are present).</P
><DIV
CLASS="TABLE"
><A
NAME="LE27762-PARENT"
></A
><P
><B
>Table 3-2. Optional Failover Attributes (mutually exclusive)</B
></P
><TABLE
BORDER="1"
WIDTH="100%"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
WIDTH="34%"
ALIGN="LEFT"
VALIGN="BOTTOM"
><P
>Name</P
></TH
><TH
WIDTH="66%"
ALIGN="LEFT"
VALIGN="BOTTOM"
><P
>Description</P
></TH
></TR
></THEAD
><TBODY
><TR
><TD
WIDTH="34%"
ALIGN="LEFT"
VALIGN="TOP"
><P
><TT
CLASS="LITERAL"
>Auto_Recovery</TT
></P
></TD
><TD
WIDTH="66%"
ALIGN="LEFT"
VALIGN="TOP"
><P
>Specifies that the resource group
is made online based on the failover policy even when an exclusivity check
shows that the resource group is running on a node. This attribute is
optional and is mutually exclusive with the <TT
CLASS="LITERAL"
>Inplace_Recovery</TT
> attribute. If you specify neither of these attributes, Linux
FailSafe will use this attribute by default if you have specified the <TT
CLASS="LITERAL"
>Auto_Failback</TT
> attribute.</P
></TD
></TR
><TR
><TD
WIDTH="34%"
ALIGN="LEFT"
VALIGN="TOP"
><P
><TT
CLASS="LITERAL"
>InPlace_Recovery</TT
></P
></TD
><TD
WIDTH="66%"
ALIGN="LEFT"
VALIGN="TOP"
><P
>Specifies that the resource group
is made online on the same node where the resource group is running.
This attribute is the default and is mutually exclusive with the <TT
CLASS="LITERAL"
>Auto_Recovery</TT
> attribute. If you specify neither of these attributes,
Linux FailSafe will use this attribute by default if you have specified
the <TT
CLASS="LITERAL"
>Controlled_Failback</TT
> attribute.</P
></TD
></TR
></TBODY
></TABLE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1645"
>3.1.3. Failover Scripts</A
></H2
><P
> A
failover script generates the run-time failover domain and returns it
to the Linux FailSafe process. The Linux FailSafe process applies the
failover attributes and then selects the first node in the returned failover
domain that is also in the current node membership.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>The run-time of the failover script must be capped to a system-definable
maximum. Hence, any external calls must be guaranteed to return quickly.
If the failover script takes too long to return, Linux FailSafe will kill
the script process and use the previous run-time failover domain.</P
></BLOCKQUOTE
></DIV
><P
>Failover scripts are stored in the <TT
CLASS="FILENAME"
>/usr/lib/failsafe/policies</TT
> directory.</P
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN1661"
>3.1.3.1. The <TT
CLASS="FILENAME"
>ordered</TT
> Failover Script</A
></H3
><P
>The <TT
CLASS="LITERAL"
>ordered</TT
> failover
script is provided with the release. The <TT
CLASS="LITERAL"
>ordered</TT
> script
never changes the initial domain; when using this script, the initial
and run-time domains are equivalent. The script reads six lines from the
input file and in case of errors logs the input parameters and/or the
error to the script log.</P
><P
>The following example shows the contents of the <TT
CLASS="FILENAME"
>ordered</TT
> failover script. (Line breaks added for readability.)</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>#!/bin/sh
#
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/NoticeExplan
#
# $1 - input file
# $2 - output file
#
# line 1 input file - version
# line 2 input file - name
# line 3 input file - owner field
# line 4 input file - attributes
# line 5 input file - list of possible owners
# line 6 input file - application failover domain
DIR=/usr/lib/failsafe/bin
LOG="${DIR}/ha_cilog -g ha_script -s script"
FILE=/usr/lib/failsafe/policies/ordered
input=$1
output=$2
{
read version
read name
read owner
read attr
read mem1 mem2 mem3 mem4 mem5 mem6 mem7 mem8
read afd1 afd2 afd3 afd4 afd5 afd6 afd7 afd8
} < ${input}
${LOG} -l 1 "${FILE}:" `/bin/cat ${input}`
if [ "${version}" -ne 1 ] ; then
${LOG} -l 1 "ERROR: ${FILE}: Different version no. Should be (1) rather than (${version})" ;
exit 1;
elif [ -z "${name}" ]; then
${LOG} -l 1 "ERROR: ${FILE}: Failover script not defined";
exit 1;
elif [ -z "${attr}" ]; then
${LOG} -l 1 "ERROR: ${FILE}: Attributes not defined";
exit 1;
elif [ -z "${mem1}" ]; then
${LOG} -l 1 "ERROR: ${FILE}: No node membership defined";
exit 1;
elif [ -z "${afd1}" ]; then
${LOG} -l 1 "ERROR: ${FILE}: No failover domain defined";
exit 1;
fi
found=0
for i in $afd1 $afd2 $afd3 $afd4 $afd5 $afd6 $afd7 $afd8; do
for j in $mem1 $mem2 $mem3 $mem4 $mem5 $mem6 $mem7 $mem8; do
if [ "X${j}" = "X${i}" ]; then
found=1;
break;
fi
done
done
if [ ${found} -eq 0 ]; then
mem="("$mem1")"" ""("$mem2")"" ""("$mem3")"" ""("$mem4")"" \
""("$mem5")"" ""("$mem6")"" ""("$mem7")"" ""("$mem8")";
afd="("$afd1")"" ""("$afd2")"" ""("$afd3")"" ""("$afd4")"" \
""("$afd5")"" ""("$afd6")"" ""("$afd7")"" ""("$afd8")";
${LOG} -l 1 "ERROR: ${FILE}: Policy script failed"
${LOG} -l 1 "ERROR: ${FILE}: " `/bin/cat ${input}`
${LOG} -l 1 "ERROR: ${FILE}: Nodes defined in membership do not match \
the ones in failure domain"
${LOG} -l 1 "ERROR: ${FILE}: Parameters read from input file: \
version = $version, name = $name, owner = $owner, attribute = $attr, \
nodes = $mem, afd = $afd"
exit 1;
fi
if [ ${found} -eq 1 ]; then
rm -f ${output}
echo $afd1 $afd2 $afd3 $afd4 $afd5 $afd6 $afd7 $afd8 > ${output}
exit 0
fi
exit 1</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN1673"
>3.1.3.2. The <TT
CLASS="FILENAME"
>round-robin </TT
>Failover Script</A
></H3
><P
>The <TT
CLASS="FILENAME"
>round-robin</TT
> script selects the resource
group owner in a round-robin (circular) fashion. This policy can be used
for resource groups that can be run in any node in the cluster.</P
><P
>The following example shows the contents of the <TT
CLASS="FILENAME"
>round-robin </TT
>failover script. </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>#!/bin/sh
#
# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like. Any license provided herein, whether implied or
# otherwise, applies only to this software file. Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
#
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
# Mountain View, CA 94043, or:
#
# http://www.sgi.com
#
# For further information regarding this notice, see:
#
# http://oss.sgi.com/projects/GenInfo/NoticeExplan
#
# $1 - input file
# $2 - output file
#
# line 1 input file - version
# line 2 input file - name
# line 3 input file - owner field
# line 4 input file - attributes
# line 5 input file - Possible list of owners
# line 6 input file - application failover domain
DIR=/usr/lib/failsafe/bin
LOG="${DIR}/ha_cilog -g ha_script -s script"
FILE=/usr/lib/failsafe/policies/round-robin
# Read input file
input=$1
output=$2
{
read version
read name
read owner
read attr
read mem1 mem2 mem3 mem4 mem5 mem6 mem7 mem8
read afd1 afd2 afd3 afd4 afd5 afd6 afd7 afd8
} < ${input}
# Validate input file
${LOG} -l 1 "${FILE}:" `/bin/cat ${input}`
if [ "${version}" -ne 1 ] ; then
${LOG} -l 1 "ERROR: ${FILE}: Different version no. Should be (1) \
rather than (${version})" ;
exit 1;
elif [ -z "${name}" ]; then
${LOG} -l 1 "ERROR: ${FILE}: Failover script not defined";
exit 1;
elif [ -z "${attr}" ]; then
${LOG} -l 1 "ERROR: ${FILE}: Attributes not defined";
exit 1;
elif [ -z "${mem1}" ]; then
${LOG} -l 1 "ERROR: ${FILE}: No node membership defined";
exit 1;
elif [ -z "${afd1}" ]; then
${LOG} -l 1 "ERROR: ${FILE}: No failover domain defined";
exit 1;
fi
# Return 0 if $1 is in the membership and return 1 otherwise.
check_in_mem()
{
for j in $mem1 $mem2 $mem3 $mem4 $mem5 $mem6 $mem7 $mem8; do
if [ "X${j}" = "X$1" ]; then
return 0;
fi
done
return 1;
}
# Check if owner has to be changed. There is no need to change owner if
# owner node is in the possible list of owners.
check_in_mem ${owner}
if [ $? -eq 0 ]; then
nextowner=${owner};
fi
# Search for the next owner
if [ "X${nextowner}" = "X" ]; then
next=0;
for i in $afd1 $afd2 $afd3 $afd4 $afd5 $afd6 $afd7 $afd8; do
if [ "X${i}" = "X${owner}" ]; then
next=1;
continue;
fi
if [ "X${owner}" = "XNO ONE" ]; then
next=1;
fi
if [ ${next} -eq 1 ]; then
# Check if ${i} is in membership
check_in_mem ${i};
if [ $? -eq 0 ]; then
# found next owner
nextowner=${i};
next=0;
break;
fi
fi
done
fi
if [ "X${nextowner}" = "X" ]; then
# wrap round the afd list.
for i in $afd1 $afd2 $afd3 $afd4 $afd5 $afd6 $afd7 $afd8; do
if [ "X${i}" = "X${owner}" ]; then
# Search for next owner complete
break;
fi
# Previous loop should have found new owner
if [ "X${owner}" = "XNO ONE" ]; then
break;
fi
if [ ${next} -eq 1 ]; then
check_in_mem ${i};
if [ $? -eq 0 ]; then
# found next owner
nextowner=${i};
next=0;
break;
fi
fi
done
fi
if [ "X${nextowner}" = "X" ]; then
${LOG} -l 1 "ERROR: ${FILE}: Policy script failed"
${LOG} -l 1 "ERROR: ${FILE}: " `/bin/cat ${input}`
${LOG} -l 1 "ERROR: ${FILE}: Could not find new owner"
exit 1;
fi
# nextowner is the new owner
print=0;
rm -f ${output};
# Print the new afd to the output file
echo -n "${nextowner} " > ${output};
for i in $afd1 $afd2 $afd3 $afd4 $afd5 $afd6 $afd7 $afd8;
do
if [ "X${nextowner}" = "X${i}" ]; then
print=1;
elif [ ${print} -eq 1 ]; then
echo -n "${i} " >> ${output}
fi
done
print=1;
for i in $afd1 $afd2 $afd3 $afd4 $afd5 $afd6 $afd7 $afd8; do
if [ "X${nextowner}" = "X${i}" ]; then
print=0;
elif [ ${print} -eq 1 ]; then
echo -n "${i} " >> ${output}
fi
done
echo >> ${output};
exit 0;</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN1681"
>3.1.3.3. Creating a New Failover Script</A
></H3
><P
>If the <TT
CLASS="LITERAL"
>ordered</TT
> or <TT
CLASS="FILENAME"
>round-robin</TT
>
scripts do not meet your needs, you can create a new failover script and
place it in the <TT
CLASS="FILENAME"
>/usr/lib/failsafe/policies</TT
> directory.
You can then configure the cluster configuration database to use your
new failover script for the required resource groups.</P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="le16529-parent.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="fpinterface.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Creating a Failover Policy</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="le16529-parent.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Failover Script Interface</TD
></TR
></TABLE
></DIV
></BODY
></HTML
> free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third pershtml/fpexample.html 0100644 0001605 0000001 00000020213 07177570115 0015201 0 ustar 00gferg other 0000264 0000003 <HTML
><HEAD
><TITLE
>Example Failover Policies for Linux FailSafe</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
REL="HOME"
TITLE="Linux FailSafe™ Programmer's
Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="Creating a Failover Policy"
HREF="le16529-parent.html"><LINK
REL="PREVIOUS"
TITLE="Failover Script Interface"
HREF="fpinterface.html"><LINK
REL="NEXT"
TITLE="Defining a New Resource Type"
HREF="le43007-parent.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux FailSafe<SUP
>™</SUP
> Programmer's
Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="fpinterface.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 3. Creating a Failover Policy</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="le43007-parent.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="FPEXAMPLE"
>3.3. Example Failover Policies for Linux FailSafe</A
></H1
><P
>There are two general types of configuration, each of which can
have from 2 through 8 nodes:</P
><P
></P
><UL
><LI
><P
><TT
CLASS="REPLACEABLE"
><I
>N</I
></TT
> nodes that can potentially
failover their applications to any of the other nodes in the cluster. </P
></LI
><LI
><P
><TT
CLASS="REPLACEABLE"
><I
>N</I
></TT
> primary nodes that can failover
to <TT
CLASS="REPLACEABLE"
><I
>M</I
></TT
> backup nodes. For example, you could have
3 primary nodes and 1 backup node.</P
></LI
></UL
><P
>This section shows examples of failover policies for the following
types of configuration, each of which can have from 2 through 8 nodes:</P
><P
></P
><UL
><LI
><P
><TT
CLASS="REPLACEABLE"
><I
>N</I
></TT
> primary nodes and one backup
node (<TT
CLASS="REPLACEABLE"
><I
>N+</I
></TT
>1)</P
></LI
><LI
><P
><TT
CLASS="REPLACEABLE"
><I
>N</I
></TT
> primary nodes and two backup
nodes (<TT
CLASS="REPLACEABLE"
><I
>N+</I
></TT
>2)</P
></LI
><LI
><P
><TT
CLASS="REPLACEABLE"
><I
>N</I
></TT
> primary nodes and <TT
CLASS="REPLACEABLE"
><I
>M </I
></TT
>backup nodes (<TT
CLASS="REPLACEABLE"
><I
>N+M</I
></TT
>)</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>The diagrams in the following sections illustrate the configuration
concepts discussed here, but they do not address all required or supported
elements, such as reset hubs. For configuration details, see the <I
CLASS="CITETITLE"
>Linux FailSafe Installation and Maintenance Instructions</I
>.</P
></BLOCKQUOTE
></DIV
></LI
></UL
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1767"
>3.3.1. N+1 Configuration for Linux FailSafe</A
></H2
><P
><A
HREF="fpexample.html#LE70211-PARENT"
>Figure 3-1</A
> shows a specific instance of an <TT
CLASS="REPLACEABLE"
><I
>N+</I
></TT
>1 configuration in which there are three primary nodes
and one backup node. (This is also known as a <I
CLASS="FIRSTTERM"
>star configuration</I
>.) The disks shown could each be disk farms. </P
><P
><DIV
CLASS="FIGURE"
><A
NAME="LE70211-PARENT"
></A
><P
><B
>Figure 3-1. <TT
CLASS="REPLACEABLE"
><I
>N+</I
></TT
>1 Configuration
Concept</B
></P
><P
><IMG
SRC="figures/star.configuration.gif"></P
></DIV
></P
><P
>You could configure the following failover policies for load balancing:</P
><P
></P
><UL
><LI
><P
>Failover policy for RG1:</P
><P
></P
><UL
><LI
><P
>Initial failover domain = A, D</P
></LI
><LI
><P
>Failover attribute = <TT
CLASS="LITERAL"
>Auto_Failback</TT
></P
></LI
><LI
><P
>Failover script = <TT
CLASS="LITERAL"
>ordered</TT
></P
></LI
></UL
></LI
><LI
><P
>Failover policy for RG2:</P
><P
></P
><UL
><LI
><P
>Initial failover domain = B, D</P
></LI
><LI
><P
>Failover attribute = <TT
CLASS="LITERAL"
>Auto_Failback</TT
></P
></LI
><LI
><P
>Failover script = <TT
CLASS="LITERAL"
>ordered</TT
></P
></LI
></UL
></LI
><LI
><P
>Failover policy for RG3:</P
><P
></P
><UL
><LI
><P
>Initial failover domain = C, D</P
></LI
><LI
><P
>Failover attribute = <TT
CLASS="LITERAL"
>Auto_Failback</TT
></P
></LI
><LI
><P
>Failover script = <TT
CLASS="LITERAL"
>ordered</TT
></P
></LI
></UL
></LI
></UL
><P
>If node A fails, RG1 will fail over to node D. As soon as node A
reboots, RG1 will be moved back to node A.</P
><P
>If you change the failover attribute to <TT
CLASS="LITERAL"
>Controlled_Failback</TT
> for RG1 and node A fails, RG1 will fail over to node D and
will remain running on node D even if node A reboots.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1823"
>3.3.2. N+2 Configuration</A
></H2
><P
><A
HREF="fpexample.html#LE15098-PARENT"
>Figure 3-2</A
> shows a specific instance of an
<TT
CLASS="REPLACEABLE"
><I
>N+</I
></TT
>2 configuration in which there are four
primary nodes and two backup nodes. The disks shown could each be disk
farms. </P
><P
><DIV
CLASS="FIGURE"
><A
NAME="LE15098-PARENT"
></A
><P
><B
>Figure 3-2. <TT
CLASS="REPLACEABLE"
><I
>N+</I
></TT
>2 Configuration
Concept</B
></P
><P
><IMG
SRC="figures/n.plus.2.configuration.gif"></P
></DIV
></P
><P
>You could configure the following failover policy for resource groups
RG7 and RG8:</P
><P
></P
><UL
><LI
><P
>Failover policy for RG7:</P
><P
></P
><UL
><LI
><P
>Initial failover domain = A, E, F</P
></LI
><LI
><P
>Failover attribute = <TT
CLASS="LITERAL"
>Controlled_Failback</TT
></P
></LI
><LI
><P
>Failover script =<TT
CLASS="LITERAL"
> ordered</TT
></P
></LI
></UL
></LI
><LI
><P
>Failover policy for RG8:</P
><P
></P
><UL
><LI
><P
>Initial failover domain = B, F, E</P
></LI
><LI
><P
>Failover attribute = <TT
CLASS="LITERAL"
>Auto_Failback</TT
></P
></LI
><LI
><P
>Failover script = <TT
CLASS="LITERAL"
>ordered</TT
></P
></LI
></UL
></LI
></UL
><P
>If node A fails, RG7 will fail over to node E. If node E also fails,
RG7 will fail over to node F. If A is rebooted, RG7 will remain on node
F.</P
><P
>If node B fails, RG8 will fail over to node F. If B is rebooted,
RG8 will return to node B.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN1866"
>3.3.3. N+M Configuration for Linux FailSafe</A
></H2
><P
><A
HREF="fpexample.html#LE66765-PARENT"
>Figure 3-3</A
> shows a specific instance of an <TT
CLASS="REPLACEABLE"
><I
>N+M</I
></TT
> configuration in which there are four primary nodes
and each can serve as a backup node. The disk shown could be a disk farm. </P
><P
><DIV
CLASS="FIGURE"
><A
NAME="LE66765-PARENT"
></A
><P
><B
>Figure 3-3. <TT
CLASS="REPLACEABLE"
><I
>N</I
></TT
>+<TT
CLASS="REPLACEABLE"
><I
>M</I
></TT
> Configuration Concept</B
></P
><P
><IMG
SRC="figures/square.configuration.gif"></P
></DIV
></P
><P
>You could configure the following failover policy for resource groups
RG5 and RG6:</P
><P
></P
><UL
><LI
><P
>Failover policy for RG5:</P
><P
></P
><UL
><LI
><P
>Initial failover domain = A, B, C, D</P
></LI
><LI
><P
>Failover attribute = <TT
CLASS="LITERAL"
>Controlled_Failback</TT
></P
></LI
><LI
><P
>Failover script = <TT
CLASS="LITERAL"
>ordered</TT
></P
></LI
></UL
></LI
><LI
><P
>Failover policy for RG6:</P
><P
></P
><UL
><LI
><P
>Initial failover domain = C, A, D</P
></LI
><LI
><P
>Failover attribute = <TT
CLASS="LITERAL"
>Controlled_Failback</TT
></P
></LI
><LI
><P
>Failover script = <TT
CLASS="LITERAL"
>ordered</TT
></P
></LI
></UL
></LI
></UL
><P
>If node C fails, RG6 will fail over to node A. When node C reboots,
RG6 will remain running on node A. If node A then fails, RG6 will return
to node C and RG5 will move to node B. If node B then fails, RG5 moves
to node C.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="fpinterface.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="le43007-parent.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Failover Script Interface</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="le16529-parent.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Defining a New Resource Type</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>