![Coyote Point Systems E350GX Скачать руководство пользователя страница 260](http://html.mh-extra.com/html/coyote-point-systems/e350gx/e350gx_installation-and-administration-manual_2674414260.webp)
Appendix A: Server Agent Probes
256
Equalizer Installation and Administration Guide
Server Agents and Load Balancing Policies
Server agents work with all load balancing policies (see “Equalizer’s Load Balancing Policies” on page 127), except
for
round robin
-- which simply ignores any agent response for all servers in the cluster. All other policies use the
integer returned by the agent as one factor in determining the server to which a new request is sent.
The
server agent
policy gives primary importance to the value returned by a server agent over other load balancing
factors (server weight, number of current connections, etc.).
Server Agents and Server ‘Down’ Conditions
Note that there is no return code for 'server down' in the table above. This is because Equalizer normally relies on
the other health check probes (ICMP, TCP, and ACV probes) to determine whether the server is up. So, even if the
server agent responds with “-1” or “-2”, this by itself will not cause Equalizer to mark the server down.
To change this default behavior, enable the global
require agent response
flag (see “Modifying Global
Parameters” on page 85). When this global flag is enabled
and
server agents are enabled for a cluster, then Equalizer
will mark a server in the cluster ‘down’ if either of the following are true:
•
Equalizer does not get a response from the server agent running on the server before the probe timeout
elapses
•
Equalizer receives either a ‘-1’ or ‘-2’ response from the server agent running on a server
Sample Server Agent in Perl
You can write custom agents as shell scripts, or in Java, Perl, C, or other languages. The code below is a simple
server agent example written in Perl. This code assumes that an integer response value is supplied on the command
line, and returns that value when a connection is made on port 1510 (configurable via the
$port
variable). This
sample agent is intended for testing purposes only. In a real deployment, the server agent would determine the
response value to return by polling system resources, or some other real-time method.
#!/usr/bin/perl -w
# serveragent.pl
#--------------------
#(c) Copyright 2008 Coyote Point Systems, Inc.
use strict;
use Socket;
# use port 1510 as default
my $port = 1510;
my $proto = getprotobyname('tcp');
# take the server agent response value from the command line
my $response = shift;
# response has to be a valid server agent response
$response==-1 or ($response > 0 and $response<101)
or die "Response must be between -1 and 100";
# create a socket and set the options, set up listen port
socket(SERVER, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, 1) or die "setsock: $!";
my $paddr = sockaddr_in($port, INADDR_ANY);
# bind to the port, then listen on it
Содержание E350GX
Страница 18: ...Chapter Preface 18 Equalizer Installation and Administration Guide ...
Страница 38: ...Chapter 1 Equalizer Overview 38 Equalizer Installation and Administration Guide ...
Страница 50: ...Chapter 2 Installing and Configuring Equalizer Hardware 50 Equalizer Installation and Administration Guide ...
Страница 62: ...Chapter 3 Using the Administration Interface 62 Equalizer Installation and Administration Guide ...
Страница 80: ...Chapter 4 Equalizer Network Configuration 80 Equalizer Installation and Administration Guide ...
Страница 110: ...Chapter 5 Configuring Equalizer Operation 110 Equalizer Installation and Administration Guide ...
Страница 208: ...Chapter 7 Monitoring Equalizer Operation 208 Equalizer Installation and Administration Guide ...
Страница 240: ...Chapter 8 Using Match Rules 238 Equalizer Installation and Administration Guide ...
Страница 258: ...Chapter 9 Administering GeoClusters 254 Equalizer Installation and Administration Guide Envoy Configuration Worksheet ...
Страница 262: ...Appendix A Server Agent Probes 258 Equalizer Installation and Administration Guide ...
Страница 274: ...Appendix B Timeout Configuration 270 Equalizer Installation and Administration Guide ...
Страница 280: ...Appendix D Regular Expression Format 276 Equalizer Installation and Administration Guide ...
Страница 296: ...Appendix E Using Certificates in HTTPS Clusters 292 Equalizer Installation and Administration Guide ...
Страница 310: ...Appendix F Equalizer VLB 306 Equalizer Installation and Administration Guide ...
Страница 318: ...Appendix G Troubleshooting 314 Equalizer Installation and Administration Guide ...