liveBook · Manning

Cluster HTTP submodule

As explained in Akka in Action, Second Edition

Akka Management Cluster HTTP is an Akka Management module that exposes HTTP endpoints for reading and modifying cluster-node state.

Akka Management Cluster HTTP exposes HTTP endpoints for inspecting and changing Akka Cluster node state. It builds on Akka Management and is useful when operators need to manage nodes without interacting directly with cluster internals. section 8.1 section 8.3

The HTTP API provides these cluster operations:

  • GET /cluster/members/ returns cluster membership, including leaders, roles, statuses, and unreachable nodes. section 8.3
  • POST /cluster/members/ requests that the cluster join a supplied address. section 8.3
  • DELETE or PUT /cluster/members/{address} performs leave or down operations, when mutations are enabled. section 8.3
  • GET /cluster/shards/{name} returns information for a named shard region. section 8.3

Start management and inspect a local cluster

Add the Akka Management, Cluster HTTP, cluster sharding, and discovery dependencies. Start the server on every node with AkkaManagement(system).start(). Assign each local node a distinct management HTTP port, then query curl localhost:8558/cluster/members. To remove a node, enable akka.management.http.route-providers-read-only = false and issue curl -XDELETE localhost:8558/cluster/members/akka://words@127.0.0.1:2552. section 8.3

val AkkaManagementVersion = "1.1.4"
val AkkaVersion = "2.6.20"

libraryDependencies ++= Seq(
.akka.management" %% "akka-management" % AkkaManagementVersion,
"com.lightbend.akka.management" %% "akka-management-cluster-http" % 
AkkaManagementVersion,
"com.typesafe.akka" %% "akka-cluster-sharding" % AkkaVersion,
"com.typesafe.akka" %% "akka-discovery" % AkkaVersion)

Use the dependency listing to align Akka Management 1.1.4 with Akka 2.6.20 when adding the extension. section 8.3

How Akka in Action, Second Edition covers it

How deep it goes
Defines dependencies, configuration, startup, ports, endpoints, responses, and mutation safeguards without detailing endpoint implementation internals.
Examples
Uses a two-node local cluster, curl requests, JSON membership output, and a manual node-leave command.
What it assumes
Assumes a running Akka Cluster and introduces management dependencies, HTTP configuration, server startup, and read-only controls.
What you can do after
Operate Akka Cluster nodes through named Akka Management HTTP endpoints and diagnose membership state from JSON responses.
How it connects
Connects Akka Cluster with Akka Management, cluster sharding, service discovery, Cluster Bootstrap, and split-brain resolution.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Akka in Action, Second Edition. The section links point to the parts of the book it draws on.