Chapter 9 High Availability for FortiOS 5.0 : HA and load balancing : Configuring load balancing settings : Configuring weighted-round-robin weights
  
Configuring weighted-round-robin weights
You can configure weighted round-robin load balancing for a cluster and configure the static weights for each of the cluster units according to their priority in the cluster. When you set schedule to weight-round-robin you can use the weight option to set the static weight of each cluster unit. The static weight is set according to the priority of each unit in the cluster. A FortiGate HA cluster can contain up to four FortiGate units so you can set up to 4 static weights.
The priority of a cluster unit is determined by its device priority, the number of monitored interfaces that are functioning, its age in the cluster and its serial number. Priorities are used to select a primary unit and to set an order of all of the subordinate units. Thus the priority order of a cluster unit can change depending on configuration settings, link failures and so on. Since weights are also set using this priority order the weights are independent of specific cluster units but do depend on the role of the each unit in the cluster.
You can use the following command to display the priority order of units in a cluster. The following example displays the priority order for a cluster of 5 FortiGate-620B units:
get system ha status
Model: 620
Mode: a-p
Group: 0
Debug: 0
ses_pickup: disable
Master:150 head_office_cla FG600B3908600825 0
Slave :150 head_office_clb FG600B3908600705 1
Slave :150 head_office_clc FG600B3908600702 2
Slave :150 head_office_cld FG600B3908600605 3
Slave :150 head_office_cle FG600B3908600309 4
number of vcluster: 1
vcluster 1: work 169.254.0.1
Master:0 FG600B3908600825
Slave :1 FG600B3908600705
Slave :2 FG600B3908600702
Slave :3 FG600B3908600605
Slave :4 FG600B3908600309
The cluster units are listed in priority order starting at the 6th output line. The primary unit always has the highest priority and is listed first followed by the subordinate units in priority order. The last 5 output lines list the cluster units in vcluster 1 and are not always in priority order. For more information about the get system ha status command, see “Viewing cluster status from the CLI”.
The default static weight for each cluster unit is 40. This means that sessions are distributed evenly among all cluster units. You can use the weight option to change the static weights of cluster units to distribute sessions depending on each unit’s priority in the cluster. The weight can be between 0 and 255. Increase the weight to increase the number of connections processed by the cluster unit with that priority.
You set the weight for each unit separately. For the example cluster of 5 FortiGate-620B units you can set the weight for each unit as follows:
config system ha
set mode a-a
set schedule weight-round-robin
set weight 0 5
set weight 1 10
set weight 2 15
set weight 3 20
set weight 4 30
end
If you enter the get command to view the HA configuration the output for weight would be:
weight 5 10 15 20 30 40 40 40 40 40 40 40 40 40 40 40
This configuration has the following results if the output of the get system ha status command is that shown above:
The first five connections are processed by the primary unit (host name head_office_cla, priority 0, weight 5). From the output of the
The next 10 connections are processed by the first subordinate unit (host name head_office_clb, priority 1, weight 10)
The next 15 connections are processed by the second subordinate unit (host name head_office_clc, priority 2, weight 15)
The next 20 connections are processed by the third subordinate unit (host name head_office_cld, priority 3, weight 20)
The next 30 connections are processed by the fourth subordinate unit (host name head_office_cle, priority 4, weight 30)