Monitoring services in a cluster using path monitoring
In a cluster setup, ownership for monitoring services is distributed among the nodes. Therefore, different nodes monitor different services. The node that monitors a service is called the service owner. Only the service owner probes the server to monitor the status of the services assigned to it. It further communicates the status of the services to all other nodes within the cluster. The drawback with distributed monitoring is that the network connectivity and link state between all nodes and the server is not determined. To overcome this drawback, you can use path monitoring.
Path monitoring checks the network connectivity and link state between a node and service provided by the server. A node sends ICMP pings to verify whether the server is reachable or not.
How path monitoring works
Consider an example of a Citrix ADC cluster consisting of three nodes N1, N2, and N3. N2 is the service owner that monitors the state of HTTP services (S1). It advertises the service state to other nodes in the cluster. Path monitoring is enabled on all nodes in the cluster, for all the services. Each node sends only an ICMP ping to the server. The service owner sends both the HTTP service request and an ICMP ping. Each node reports its path monitoring state to the service owner.
The following two parameters determine the service state of a node:
- S = service state advertised by the service owner
- P = path monitoring state of each node
Whether a node can reach a server or not, determines the path monitoring state for that node.
The following table shows the service state set based on the path monitoring state, when pathMonitorIndv parameter is enabled or disabled.
|Parameter||Path monitoring state||Service state|
|pathMonitorIndv = NO; This is the default configuration.||P1 = DOWN||S1 = DOWN|
|P2 = UP||S1 = DOWN|
|P3 = UP||S1 = DOWN|
|pathMonitorIndv = YES||P1 = DOWN||S1 = DOWN|
|P2 = UP||S1 = UP|
|P3 = UP||S1 = UP|
In this example, the service owner decides the service state for all the nodes based on the node whose path monitoring state is set to DOWN. If the path monitoring state for any of the nodes is DOWN, then the service owner sets the service state for all the nodes as DOWN. The service state for all the nodes is set to UP only if the path monitoring state for each of the node is UP.
You can use path monitoring for individual nodes by enabling the pathMonitorIndv parameter. This parameter enables the service owner to set the service state for each node based on the path monitoring state of that respective node.
If pathMonitorIndv parameter is set, some features like persistence might break.
Configuring path monitoring
Path monitoring is applicable for all the services and service groups. Path monitoring parameter is disabled by default.
To enable path monitoring for services/service groups by using the CLI
At the command prompt, type:
add service <service name> <IP address> <service type> <port> [-pathMonitor <YES | NO>] [-pathMonitorIndv <YES | NO>] add servicegroup <servicegroup name> <service type> [-pathMonitor <YES | NO>] [-pathMonitorIndv <YES | NO>]
add service s1 18.104.22.168 HTTP 80 -pathMonitor YES add servicegroup sg_1 HTTP -pathMonitor YES add service s1 22.214.171.124 HTTP 80 -pathMonitor YES -pathMonitorIndv YES add servicegroup sg_1 HTTP -pathMonitor YES -pathMonitorIndv YES
You can also set the path monitoring parameter from the set command, as follows:
set service <service name> [-pathMonitor <YES | NO>] [-pathMonitorIndv <YES | NO>] set servicegroup <servicegroup name> [-pathMonitor <YES | NO>] [-pathMonitorIndv <YES | NO>]
set service s1 -pathMonitor YES set servicegroup sg_1 -pathMonitor YES set service s1 -pathMonitorIndv YES set servicegroup sg_1 -pathMonitorIndv NO
To enable path monitoring for services/service groups by using the GUI
Navigate to Traffic Management > Load Balancing > Services.
For service groups, navigate to Traffic Management > Load Balancing > Service Groups.
- In the Services/Service Groups pane, select a service/service group from the list, and then double-click to open it.
- On the Service Settings tab, click Edit.
- Select Path Monitoring.
- Select Individual Path Monitoring, if you want to apply it, and then click OK.
You can enable Individual Path Monitoring only if you enable Path Monitoring.