public class Cluster extends Object implements sirius.kernel.timer.EveryMinute
Permits to couple a number of machines to a cluster where each member monitors the others. In case or a failure an alert will be triggered. Additionally the cluster state can be visualized using the web interface (/system/state).
Even in a single machine installation, this class will take care of monitoring all metrics and triggering an alert (if possible).
Cluster members are defined via the configuration by listing all HTTP-Endpoints under health.cluster.nodes in the form of http://hostname:port. Each node always defines a priority (health.cluster.priority). The node with the lowest number (which is still functional) is in charge of triggering an alert in case of faulting or unreachable members.
Modifier and Type | Field and Description |
---|---|
static sirius.kernel.health.Log |
LOG |
Constructor and Description |
---|
Cluster() |
Modifier and Type | Method and Description |
---|---|
NodeInfo |
getBestAvailableNode()
Returns the best node which is still functional and has the highest priority (lowest number).
|
sirius.kernel.health.metrics.MetricState |
getClusterState()
Returns the overall state of the cluster.
|
List<NodeInfo> |
getNodeInfos()
Reports infos for all known cluster members.
|
int |
getNodePriority()
Returns the priority of this node.
|
sirius.kernel.health.metrics.MetricState |
getNodeState()
Returns the determined state of this node.
|
boolean |
isAlarmPresent() |
boolean |
isBestAvailableNode()
Determines if the current node is the best (highest priority, still functional) cluster node.
|
void |
runTimer() |
public List<NodeInfo> getNodeInfos()
During startup (before the initial communication took place) some information (like the node name) might be missing.
public NodeInfo getBestAvailableNode()
public boolean isBestAvailableNode()
public sirius.kernel.health.metrics.MetricState getNodeState()
public sirius.kernel.health.metrics.MetricState getClusterState()
public boolean isAlarmPresent()
public void runTimer() throws Exception
runTimer
in interface sirius.kernel.timer.TimedTask
Exception
public int getNodePriority()
Copyright © 2018. All rights reserved.