Akka Cluster provides a fault-tolerant decentralized peer-to-peer based cluster membership service with no single
point of failure or single point of bottleneck. It does this using gossip protocols and an automatic failure detector.
The cluster membership state is a specialized CRDT, which means that it has a monotonic merge function. When
concurrent changes occur on different nodes the updates can always be merged and converge to the same end
result.
The seed nodes configuration value does not have any influence on the running cluster itself, it is only relevant for
new nodes joining the cluster as it helps them to find contact points to send the join command to; a new member
can send this command to any current member of the cluster, not only to the seed nodes. When a new node is started it sends a message to all seed nodes and then sends join
command to the one that answers first.
Cluster Sharding
Distributes actors across several nodes in the cluster and supports interaction with the actors using their logical
identifier, but without having to care about their physical location in the cluster.
Cluster sharding is useful when you need to distribute actors across several nodes in the cluster and want to be able to interact with them using their logical identifier, but without having to care about their physical location in the cluster, which might also change over time.
Sharding means that actors with an identifier, so called entries, can be automatically distributed across multiple nodes in the cluster.
Each entry actor runs only at one place, and messages can be sent to the entry without requiring the sender() to know the location of the destination actor. This is achieved by sending the messages via a ShardRegion actor provided by this extension, which knows how to route the message with the entry id to the final destination.
Failure Detector
In a cluster each node is monitored by a few (default maximum 5) other nodes, and when any of these detects the
node as unreachable that information will spread to the rest of the cluster through the gossip. In other words,
only one node needs to mark a node unreachable to have the rest of the cluster mark that node unreachable. The nodes in the cluster monitor each other by sending heartbeats to detect if a node is unreachable from the rest
of the cluster.
No comments:
Post a Comment