Class IcmpFailureDetectorConfig


public class IcmpFailureDetectorConfig extends Object
This Failure Detector may be configured in addition to one of Deadline and Phi Accrual Failure Detectors.
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 Details

    • IcmpFailureDetectorConfig

      public IcmpFailureDetectorConfig()
  • Method Details

    • getTimeoutMilliseconds

      public int getTimeoutMilliseconds()
      the timeout in Milliseconds before declaring a failed ping
    • setTimeoutMilliseconds

      public IcmpFailureDetectorConfig setTimeoutMilliseconds(int timeoutMilliseconds)
      Sets the timeout in Milliseconds before declaring a failed ping This cannot be more than the interval value. Should always be smaller.
      timeoutMilliseconds - the timeout for each ping in millis
      this IcmpFailureDetectorConfig instance
    • getIntervalMilliseconds

      public int getIntervalMilliseconds()
      the time in milliseconds between each ping
    • setIntervalMilliseconds

      public IcmpFailureDetectorConfig setIntervalMilliseconds(int intervalMilliseconds)
      Sets the time in milliseconds between each ping This value can not be smaller than 1000 milliseconds
      intervalMilliseconds - the interval millis between each ping
      this IcmpFailureDetectorConfig instance
    • isFailFastOnStartup

      public boolean isFailFastOnStartup()
      whether the member should fail-fast on startup if ICMP is not allowed by the underlying OS.
    • setFailFastOnStartup

      public IcmpFailureDetectorConfig setFailFastOnStartup(boolean failFastOnStartup)
      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.
      failFastOnStartup - the fail-fast flag
      this IcmpFailureDetectorConfig instance
    • getTtl

      public int getTtl()
      the maximum number of times the IP Datagram (ping) can be forwarded
    • setTtl

      public IcmpFailureDetectorConfig 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 therefore
      ttl - the new time-to-live value
      this IcmpFailureDetectorConfig instance
    • getMaxAttempts

      public int getMaxAttempts()
      max ping attempts before suspecting a member
    • setMaxAttempts

      public IcmpFailureDetectorConfig setMaxAttempts(int maxAttempts)
      Set the max ping attempts before suspecting a member
      maxAttempts - the max attempts before suspecting a member
      this IcmpFailureDetectorConfig instance
    • isEnabled

      public boolean isEnabled()
      whether the ICMP detector is enabled or not.
    • setEnabled

      public IcmpFailureDetectorConfig setEnabled(boolean enabled)
      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()
      whether the ICMP detector is set in parallel mode, or in legacy (flag value = false).
    • setParallelMode

      public IcmpFailureDetectorConfig setParallelMode(boolean mode)
      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.
      mode - the mode representing whether the detector should work in parallel or not
      this IcmpFailureDetectorConfig instance
    • toString

      public String toString()
      toString in class Object
    • equals

      public final boolean equals(Object o)
      equals in class Object
    • hashCode

      public final int hashCode()
      hashCode in class Object