Specifications

General Match Expressions and Match Bodies
Equalizer Installation and Administration Guide 127
Match Bodies
Match bodies specify the actions to take if the match expression selects the request. This is specified
in the form of statements that provide values to variables used by the load balancer to process the
request. The most common (and most useful) match body selects the set of servers over which to
apply the load balancing:
servers = all;
The servers assignment statement takes a comma-separated list of server names, which specifies
the set of servers to be used for load balancing all requests that match the expression in the match
rule. The reserved server names all and none specify respectively the set of all servers in the
virtual cluster and none of the servers in the virtual cluster. If you do not assign servers, none will
be available for load balancing; as a result, the connection to the client will be dropped.
In general, you can override most cluster-specific variables in a match body. (You can override
protocol-specific variables as well, but that does not always make sense.) One useful example of
overriding variables is as follows:
servers = s0, s1, s2;
flags = ! once_only;
which would load-balance across the specified servers (which first must be defined in the virtual
cluster) and also turn off the once_only flag for the duration of processing of that connection.
Match Rule Definitions
Match rules are defined in the file /var/eq/eq.conf with the definition of the cluster to which the
match rule applies. A match rule as it appears in eq.conf looks like the following example:
match ma01 {
client_ip("10.0.0.19")
} then {
flags = !spoof, once_only;
servers = sv_102, sv_65;
}
In this example (the match rule is named “ma01”), the match function, client_ip, has an
argument that matches all requests from IP address 10.0.0.19. Servers sv_102 and sv_65 are
the only ones used for load balancing of matching requests. Additionally, this rule sets the
once_only flag (that is, we perform processing only on the initial request on this connection) and
clears the spoof flag (that is, when the connection is made to the server, the server sees a
connection to the Equalizer, not to the client).
The Administration Interface allows you to create and modify match rules, without requiring a
detailed knowledge of the configuration language syntax used in the eq.conf file. The interface
validates match rules before saving them so that all saved rules are syntactically correct. For this
reason, we recommend you use the interface to create and edit match rules, rather than editing the
configuration file.
The interface does not, however, test the behavior of match rules. Match rules must be tested against
a flow of incoming requests in order to determine if the behavior of the rule is what you expect.