Class IcmpFailureDetectorConfig
It operates at Layer 3 of the OSI protocol, and provides much quicker and more deterministic detection of hardware
and other lower level events. This detector may be configured to perform an extra check after a member is suspected by one
of the other detectors, or it can work in parallel, which is the default. This way hardware and network level issues
will be detected more quickly.
This failure detector is based on InetAddress.isReachable(). When the JVM process has enough permissions to create RAW sockets, the implementation will choose to rely on ICMP Echo requests. This is preferred. However, if there are not enough permissions, it can be configured to fallback on attempting a TCP Echo on port 7. In the latter case, both a successful connection or an explicit rejection will be treated as "Host is Reachable". This is not preferred as each call creates a heavyweight socket and moreover the Echo service is typically disabled.
For the Ping Failure Detector to rely only on ICMP (RAW sockets) Echo requests, there are some criteria that need to be met. Please consult the Hazelcast Reference Manual on how to configure and what the OS requirements are.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
int
int
int
int
getTtl()
final int
hashCode()
boolean
boolean
boolean
setEnabled
(boolean enabled) Set whether the ICMP failure detector should be enabled or not.setFailFastOnStartup
(boolean failFastOnStartup) Sets whether the member should fail-fast on startup if ICMP is not allowed by the underlying OS.setIntervalMilliseconds
(int intervalMilliseconds) Sets the time in milliseconds between each ping This value can not be smaller than 1000 millisecondssetMaxAttempts
(int maxAttempts) Set the max ping attempts before suspecting a membersetParallelMode
(boolean mode) Set the ICMP detector to run in parallel mode, independent from the other failure detectors.setTimeoutMilliseconds
(int timeoutMilliseconds) Sets the timeout in Milliseconds before declaring a failed ping This cannot be more than the interval value.setTtl
(int ttl) Sets the maximum number of times the IP Datagram (ping) can be forwarded, in most cases all Hazelcast cluster members would be within one network switch/router thereforetoString()
-
Constructor Details
-
IcmpFailureDetectorConfig
public IcmpFailureDetectorConfig()
-
-
Method Details
-
getTimeoutMilliseconds
public int getTimeoutMilliseconds()- Returns:
- the timeout in Milliseconds before declaring a failed ping
-
setTimeoutMilliseconds
Sets the timeout in Milliseconds before declaring a failed ping This cannot be more than the interval value. Should always be smaller.- Parameters:
timeoutMilliseconds
- the timeout for each ping in millis- Returns:
- this
IcmpFailureDetectorConfig
instance
-
getIntervalMilliseconds
public int getIntervalMilliseconds()- Returns:
- the time in milliseconds between each ping
-
setIntervalMilliseconds
Sets the time in milliseconds between each ping This value can not be smaller than 1000 milliseconds- Parameters:
intervalMilliseconds
- the interval millis between each ping- Returns:
- this
IcmpFailureDetectorConfig
instance
-
isFailFastOnStartup
public boolean isFailFastOnStartup()- Returns:
- whether the member should fail-fast on startup if ICMP is not allowed by the underlying OS.
-
setFailFastOnStartup
Sets whether the member should fail-fast on startup if ICMP is not allowed by the underlying OS. Failure is usually due to OS level restrictions.- Parameters:
failFastOnStartup
- the fail-fast flag- Returns:
- this
IcmpFailureDetectorConfig
instance
-
getTtl
public int getTtl()- Returns:
- the maximum number of times the IP Datagram (ping) can be forwarded
-
setTtl
Sets the maximum number of times the IP Datagram (ping) can be forwarded, in most cases all Hazelcast cluster members would be within one network switch/router therefore- Parameters:
ttl
- the new time-to-live value- Returns:
- this
IcmpFailureDetectorConfig
instance
-
getMaxAttempts
public int getMaxAttempts()- Returns:
- max ping attempts before suspecting a member
-
setMaxAttempts
Set the max ping attempts before suspecting a member- Parameters:
maxAttempts
- the max attempts before suspecting a member- Returns:
- this
IcmpFailureDetectorConfig
instance
-
isEnabled
public boolean isEnabled()- Returns:
- whether the ICMP detector is enabled or not.
-
setEnabled
Set whether the ICMP failure detector should be enabled or not. When set to true, this member will use icmp ping failure detector to detect unavailable members -
isParallelMode
public boolean isParallelMode()- Returns:
- whether the ICMP detector is set in parallel mode, or in legacy (flag value =
false
).
-
setParallelMode
Set the ICMP detector to run in parallel mode, independent from the other failure detectors. If set to false (default) then the detector runs in legacy mode, with similar behavior as to Hazelcast version less than 3.9.- Parameters:
mode
- the mode representing whether the detector should work in parallel or not- Returns:
- this
IcmpFailureDetectorConfig
instance
-
toString
-
equals
-
hashCode
public final int hashCode()
-