Cluster

Ignite has advanced clustering capabilities including logical cluster groups and auto-discovery.

Ignite nodes can automatically discover each other. This helps to scale the cluster when needed, without having to restart the whole cluster. Developers can also leverage Ignite’s hybrid cloud support that allows establishing connection between private cloud and public clouds such as Amazon Web Services, providing them with best of both worlds.

777

Features

  • Pluggable Design via IgniteDiscoverySpi
  • Dynamic topology management
  • Automatic discovery on LAN, WAN, and AWS
  • On-demand and direct deployment
  • Support for virtual clusters and node groupings

IgniteCluster

Cluster functionality is provided via ICluster interface. You can get an instance of ICluster from Ignite as follows:

IIgnite ignite = Ignition.Start();

ICluster cluster = ignite.GetCluster();

Through ICluster interface you can:

ClusterNode

The IClusterNode interface has very concise API and deals only with the node as a logical network endpoint in the topology: its globally unique ID, the node metrics, its static attributes set by the user and a few other parameters.

Cluster Node Attributes

All cluster nodes on startup automatically register all environment and system properties as node attributes. However, users can choose to assign their own node attributes through configuration:

var cfg = new IgniteConfiguration
{
    UserAttributes = new Dictionary<string, object> { { "ROLE", "worker" } }
};
<igniteConfiguration>
    <userAttributes>
        <pair key='ROLE' value='worker' />
    </userAttributes>
</igniteConfiguration>
<bean class="org.apache.ignite.IgniteConfiguration">
    ...
    <property name="userAttributes">
        <map>
            <entry key="ROLE" value="worker"/>
        </map>
    </property>
    ...
</bean>

Following example shows how to get the nodes where "worker" attribute has been set.

IClusterGroup workers = ignite.GetCluster().ForAttribute("ROLE", "worker");

ICollection<IClusterNode> nodes = workers.GetNodes();

👍

All node attributes are available via IClusterNode.GetAttributes() method.

Cluster Node Metrics

Ignite automatically collects metrics for all cluster nodes. Metrics are collected in the background and are updated with every heartbeat message exchanged between cluster nodes.

Node metrics are available via IClusterMetrics interface which contains over 50 various metrics (note that the same metrics are available for Cluster Groups as well).

Here is an example of getting some metrics, including average CPU load and used heap, for the local node:

// Local Ignite node.
IClusterNode localNode = cluster.GetLocalNode();

// Node metrics.
IClusterMetrics metrics = localNode.GetMetrics();

// Get some metric values.
double cpuLoad = metrics.CurrentCpuLoad;
long usedHeap = metrics.HeapMemoryUsed;
int numberOfCores = metrics.TotalCpus;
int activeJobs = metrics.CurrentActiveJobs;

Local Cluster Node

Local grid node is an instance of the IClusterNode representing this Ignite .NET node.

Here is an example of how to get a local node:

IClusterNode localNode = ignite.GetCluster().GetLocalNode();