8 Clustering

 

This chapter covers

  • Forming a cluster
  • Cluster monitoring
  • Building a clustered Akka app

An Akka cluster is a group of nodes that communicate peer to peer to form a whole. These nodes are ActorSystems that live in independent JVMs. Thanks to its decentralized structure, a cluster has no single point of failure, is fault-tolerant, and can dynamically increase and decrease the number of nodes.

Distributed applications run in environments that are not fully under your control, such as cloud computing platforms or remote data centers. The larger the cluster, the greater the ability to distribute the load, but the greater the risk of failure. In the event of this inevitable failure, Akka offers clustering and many extensions that provide solutions to common needs raised over the years. One of these requirements is the means to monitor and change the state of the cluster nodes.

8.1 On top of Akka Cluster

Akka Cluster gives rise to multiple tools. You learn about the first two modules in this book, and it may be useful to know that the others are available when you need them:

8.2 Why use clustering?

8.2.1 Cluster membership: Joining a cluster

8.2.2 Minimal cluster example

8.2.3 Starting the cluster

8.2.4 Leaving the cluster

8.2.5 Unreachable

8.2.6 Downing a reachable node

8.3 Akka Management and the Cluster HTTP extension

8.3.1 Cluster subscriptions

8.4 Clustered job processing

8.4.1 In practice

8.4.2 The code

8.4.4 Starting the cluster