Picture in the above is the physical wiring of a typical SG cluster system.
When a Internet access comes, the primary SG load balancer will redirect this request to one of the servers in the server pool based on various load balancing policy, like round robin, connection count, packet traffic, etc. If a server in the server pool is dead, it will be isolated, no more request will be redirected to this bad server. In case the primary SG load balancer failed, the backup load balancer will take over the job.
Logical View
This is a more logical view of the SG cluster system. There are 2 server group in this configuration, one is 140.116.72.114:*, the other is 140.116.72.115:23. A server group is called virtual server sometimes.
Group 140.116.72.114:* has 3 members ,including 192.168.1.1:*, 192.168.1.2:*, 192.168.1.3:*. It is a mapping of whole machine. All request for 140.116.72.114 will be redirected to one of the members. This is called "redirect_address"
Group 140.116.72.115:23 has 4 members, including 192.168.1.2:23, 192.168.1.3:23, 192.168.1.4:23, 192.168.1.5:23. It is a mapping of specific port. Only request for 140.116.72.115 port 23 will be redirected to the members. This is called "redirect_port"
The load balancer actually has 3 IP address. 140.116.72.114 and 140.116.72.115 are used for server group, any request for these 2 IP addresses will be redirected to related members and any packets from the members will be alias as from these 2 IP addresses. IP address 140.116.72.219 is used for machines which are behind SG load balancer but do not belong to any server group. Packets from those non-server machines will be alias as from 140.116.72.219.
A SG load balancer currently supports max to 8 server groups, and each server group could has 32 servers. The membership of different group can overlap for flexibility.
SG Process Interaction
Server Group Properties
This is a block of shared memory accessed by SG processes. It contains the membership, the load balancing policy, properties of each server group and statistical information of all servers.
bidd
More than one SG load balancer could be setup at the same time to tolerate the fault of load balancer. One of them is the primary SG load balancer and the others are backups. These load balancers cooperate through the bidd daemon. Bidd on the primary load balancer generates heartbeat and bidd on the backup monitors the heartbeat. If the primary is dead, a new primary will be choosed from the backup.
NATD
The major component of SG load balancer, it is responsible for changing the IP address in the IP packet header based on the Server Group Properties
mrouted
SG cluster supports not only the "select one" model of service but also the "write all" model of service. A write request under "write all" model will be multicast to all servers in the server group. This is modified mrouted is used to support multicast service in SG cluster.
sgmon
Normally, natd can detect the failure of a server if the server does not response to the the client's request. But natd won't find out the failure if no request is coming at all. Further more, natd won't detect the recovery of dead servers since no request would be sent to a dead server. Sgmon monitors the failure and recovery of servers by periodically sending request to servers.
sgctrld
Sgctrld provides an interface for processes outside SG load balancer to modify the "Server Group Properties". Other processes use "feedback protocol" to communicate with sgctrld and sgctrld makes changes on the Server Group Properties. For example, service process can feed back current load to SG load balancer for better load balancing.
sgcmd
This is a client of sgctrld and provides a command line interface of the "feedback protocol". It can be used by shell script or by the user interactively.
sghb
The is optional. It is a little monitor process executed on servers. Since not all server component are network reachable, sghb can be used monitor those quiet servers and generate heartbeat to SG load balancer.
|
|
| SG Cluster by Distributed System Lab E.E. NCKU 2001 |