I can think of several hacks using ping, the field name and the common name HA, but I think they lead to data leakage.
If the box even knows its part of the HA cluster, or what is the cluster name? Is this more of a DNS feature? Is there any API open for mailboxes to join the HA cluster and request the id of the current active node?
I want to distinguish between inactive node and active node in the notification mechanisms for the running program. If the active node warns that I want to get into the pager and in the inactive node, I want to send an email. Clicking a definition on the warning level moves the same problem elsewhere.
EASY DECISION: Polling the server from an external agent that connects through the network makes any shell game who is an active node a controversial point. To clarify this, the only thing the page will be on is the remote agent controlling the real one. Each inbox can send emails all day for everything I need.
It really depends on the HA system used.
, IP-, - , , . ... , script , - , ping . script , ping < 2 ...
/ node, node , . , , , . , node (STONITH ), .
, , HA , / . , . HA , . Heartbeat .
, . , , , , :)
, / , , /. , , , . / / , . .
, DNS - - - .
- , , . / ( ), / , , .
- DNS ( - ) . , , , . , , , .
, .
, HA , . , , . HA, . cronjob, , . script:
#!/bin/sh HA_CLUSTER_IP=0.0.0.0 if ip addr | grep $HA_CLUSTER_IP >/dev/null; then eval "$@" fi
( , Debian.) - , , ( 0.0.0.0 IP HA), , , script. , cronjobs.
, , , , .
UPDATE: HA Heartbeat IP- . , , , gethostbyname() , , IP- .
gethostbyname()
....? , - , . ifconfig, HA , . , HA eth0, eth0: 0, node.
Therefore, you can make a simple ifconfig output request to determine if the server supports an active node or not, for example, if eth0 was a configured interface:
ACTIVE_NODE=`ifconfig | grep -c 'eth0:0'`
This will set the $ ACTIVE_NODE variable to 1 (for active) and 0 (if in standby). Hope this helps.
http://www.of-networks.co.uk
Source: https://habr.com/ru/post/1705544/More articles:tire and test coverage analysis? - chttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1705540/is-it-possible-to-limit-google-maps-to-display-only-a-given-country&usg=ALkJrhjpufw4CGVOrKqbJPfTBCuZQ1nr9Qcomparison of algorithms in C, what's the difference? - cWPF: update / update controls when loading windows - controlsC # Regex Replace Question - regexIs there any solution to know the similarity of two PDFs without comparing content - language-agnosticManipulate a VARCHAR variable exceeding 8000 characters - sql-serverСредство просмотра процессов для устройств Win CE - windows-ceWhat is the best Java parser tool for my own language grammar? - javaDelphi Progress Bar - delphiAll Articles