Programming cluster sockets

Cluster communications can operate over the traditional networking interfaces (IP-based) or using the storage interfaces (Fibre Channel or SAS).

When cluster communications is configured over both transports the redundancy and high availability of the underlying cluster node software and hardware configuration can be maximized by using all the paths for communications. In case of network interface failures, you can use the storage framework (Fibre Channel or SAS) to maintain communication between the cluster nodes. Cluster communications is achieved by exploiting the multicast capabilities of the networking and storage subsystems.

Example: Using a socksimple program

The following cluster socket program example uses a pinglike interface to send and receive packets over the cluster communications. The example program uses the local cluster as the scope of nodes that can send or receive information.

The example environment has a three-node cluster of nodeA, nodeB, and nodeC.

To start the socksimple program as the receiver on node 1 (nodeA), run the following command:
./socksimple -r -a 1
Note: To find the node number, view the output from the lscluster –m command. For the cluster shorthand ID, you can also use the get_clusterid function.
To start the socksimple program as the sender on node 3 (nodeC), run the following command:
./socksimple -s -a 1
Note: The –a (address) option sends the packets to node 1 in this local cluster.
The following code is output from running the socksimple –s –a 1 command:
./socksimple -s -a 1
socksimple version 1.2
socksimple 1/12 with ttl=1:

1275 bytes from cluster host id = 1: seqno=1275 ttl=1 time=0.411 ms
1276 bytes from cluster host id = 1: seqno=1276 ttl=1 time=0.275 ms
1277 bytes from cluster host id = 1: seqno=1277 ttl=1 time=0.287 ms
1278 bytes from cluster host id = 1: seqno=1278 ttl=1 time=0.284 ms
--- socksimple statistics ---
4 packets transmitted, 4 packets received
round-trip min/avg/max = 0.267/0.291/0.411 ms