Managing Serviceguard 14th Edition, June 2007

Designing Highly Available Cluster Applications
Designing Applications to Run on Multiple Systems
Appendix C448
For TCP stream sockets, the TCP level of the protocol stack resolves this
problem for the client since it is a connection-based protocol. On the
client, TCP ignores the stationary IP address and continues to use the
previously bound relocatable IP address originally used by the client.
With UDP datagram sockets, however, there is a problem. The client
may connect to multiple servers utilizing the relocatable IP address and
sort out the replies based on the source IP address in the server’s
response message. However, the source IP address given in this response
will be the stationary IP address rather than the relocatable application
IP address. Therefore, when creating a UDP socket for listening, the
application must always call bind(2) with the appropriate relocatable
application IP address rather than INADDR_ANY.
If the application cannot be modified as recommended above, a
workaround to this problem is to not use the stationary IP address at all,
and only use a single relocatable application IP address on a given LAN
card. Limitations with this workaround are as follows:
Local LAN failover will not work.
There has to be an idle LAN card on each backup node that is used to
relocate the relocatable application IP address in case of a failure.
Call bind() before connect()
When an application initiates its own connection, it should first call
bind(2), specifying the application IP address before calling
connect(2). Otherwise the connect request will be sent using the
stationary IP address of the system's outbound LAN interface rather
than the desired relocatable application IP address. The client will
receive this IP address from the accept(2) call, possibly confusing the
client software and preventing it from working correctly.
Give Each Application its Own Volume Group
Use separate volume groups for each application that uses data. If the
application doesn't use disk, it is not necessary to assign it a separate
volume group. A volume group (group of disks) is the unit of storage that
can move between nodes. The greatest flexibility for load balancing
exists when each application is confined to its own volume group, i.e.,
two applications do not share the same set of disk drives. If two
applications do use the same volume group to store their data, then the