24.6 Cluster Alias Resource


24.6 Cluster Alias Resource

For a majority of applications, the default cluster alias should be sufficient. For those applications that need to be restricted to a subset of members or to change the load-balancing behavior, alternate cluster aliases can be defined. Generally speaking, though, managing cluster aliases should have nothing to do with CAA, except that resources may manage applications that use a cluster alias.

Why do we have this section then? There are certain situations where you may want finer control over the handling of the cluster alias than the cluster alias subsystem alone provides. For example, what if you want to restrict an alias to the member running an application resource, but the application does not start up a network daemon that can be set as an "in_single" service in the clua_services(4) file.

For example, you have an application (we'll call it "widget") that you would like your users to use. The widget is running on member1. The users telnet(1) to member1 and start using the widget. If member1 is unavailable, then the application is unavailable.

If you implement an application resource to manage the widget, you will want to tie a cluster alias to the resource such that if the resource is relocated, the alias follows the widget.

There are a couple of possible solutions to having an alias follow the widget:

  • Use the cluamgr(8) command.

  • Use the ifconfig(8) command.

24.6.1 Alias Resource Using cluamgr

Use the cluamgr(8) command to "join" the widget alias in the "start" entry point of the widget resource's action script. When the resource relocates to another cluster member, use the cluamgr command to "leave" the widget alias in the "stop" entry point of the widget resource's action script.

  • Save a copy of the original application.tdf file.

  • Add an attribute to the application.tdf file as follows:

    • If you want to use an alias name, create a "name_string" attribute.

       #!========================== attribute: USR_ALIAS_NAME type: name_string switch: -o an default: required: no 
    • If you want to use an alias IP address, create an "internet_address" attribute.

       #!========================== attribute: USR_ALIAS_IP type: internet_address switch: -o aa default: required: no 
    • If you need more than one alias, create a "name_list" attribute.

       #!========================== attribute: USR_ALIAS_NAMES type: name_list switch: -o al default: required: no
  • In the "start" entry point:

     # cluamgr -a alias=${_USR_ALIAS_NAME},join,rpri=1 
     # cluamgr -r start 
  • In the "stop" entry point:

     # cluamgr -a alias=${_USR_ALIAS_NAME},leave,rpri=0 
Note

As of this writing, once a cluster alias is created, it survives until the cluster is shutdown regardless of whether any cluster members are currently members of the alias. In other words, even after the last cluster member uses the cluamgr command to "leave" the alias, the alias is still in existence. The last member to route for the alias will continue to respond to alias requests.

If there is a possibility, however slight, that the widget resource will be stopped, and you do not want your users connecting to the cluster when the resource is unavailable, you may want to consider the option in the following section.

For more information on the cluster alias subsystem, see Chapter 16.

24.6.2 Alias Resource Using ifconfig

Use the ifconfig(8) command with the "alias" option.

This option does not use the cluster alias subsystem, though it does allow you to add an alias to a network interface.

There are a couple of restrictions to using the ifconfig command with the "alias" option:

  1. You must use an IP address and not an alias name when defining the alias.

  2. You can only have one alias per interface.

In order to implement an alias using ifconfig:

  • Save a copy of the original application.tdf file.

  • Add the USR_ALIAS_IP attribute to the application.tdf file as shown in section 24.6.1.

  • Create a "name_string" attribute (named USR_ALIAS_INTERFACE) and add it to the application.tdf file as follows:

     #!========================== attribute: USR_ALIAS_INTERFACE type: name_string switch: -o ai default: required: no 
  • In the "start" entry point:

     # ifconfig ${_USR_ALIAS_INTERFACE} alias ${_USR_ALIAS_IP} 
  • In the "stop" entry point:

     # ifconfig ${_USR_ALIAS_INTERFACE} -alias ${_USR_ALIAS_IP} abort 

Note

You can also tie a virtual MAC address using the ifconfig command as well.

  • Add a "name_string" attribute (named USR_ALIAS_VMAC) to the application.tdf file as follows:

     #!========================== attribute: USR_ALIAS_VMAC type: name_string switch: -o av default: required: no 
  • In the "start" entry point:

     # ifconfig ${_USR_ALIAS_INTERFACE} alias ${_USR_ALIAS_IP} \ > physaddr ${_USR_ALIAS_VMAC} 
  • In the "stop" entry point:

     # ifconfig ${_USR_ALIAS_INTERFACE} -alias ${_USR_ALIAS_IP} \ > -physaddr ${_USR_ALIAS_VMAC} abort 




TruCluster Server Handbook
TruCluster Server Handbook (HP Technologies)
ISBN: 1555582591
EAN: 2147483647
Year: 2005
Pages: 273

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net