liveBook · Manning

Akka Management

As explained in Akka in Action, Second Edition

Akka Management is a toolkit for operating Akka applications by exposing management, health, and cluster-control capabilities.

Akka Management provides HTTP-based tools for operating an Akka cluster. Its core exposes basic cluster interaction, while the Cluster HTTP extension reads member state and, when enabled, changes it. It complements Akka Cluster rather than forming the cluster itself. section 8.1 section 8.3

Start an HTTP management server on every cluster node. Each node needs a reachable management hostname and a distinct management port when multiple nodes run on one machine. The default endpoint binds to the configured host and port, commonly 8558 in a local example. section 8.3

The Cluster HTTP API supports these operational tasks:

  • Inspect all members or one member, including leader, oldest member, roles, status, self node, and unreachable nodes in JSON. section 8.3
  • Request that an address join the cluster, leave it, or be marked Down through member endpoints. section 8.3
  • Inspect shard information for a named shard region. section 8.3
  • Keep state-changing routes disabled by default; set route-providers-read-only to false before allowing them. section 8.3

Run and inspect two local nodes

Create an ActorSystem, call AkkaManagement(system).start(), then run one node with cluster port 2551 and management port 8558 and another with different ports. Request /cluster/members from the first management endpoint to see both nodes reported as Up. A DELETE request to a member address can initiate its leave when write routes are enabled. section 8.3 section 8.3

Akka Management also supplies the contact points used by Cluster Bootstrap. With discovery configured, nodes expose their management endpoints, wait until the required number of contact points is available, and let the lowest-address node form the initial cluster. Other nodes obtain a seed node through the endpoint and join it. section 13.1.1 section 13.1.2

Manual console downing and log inspection are useful demonstrations, but operational downing in a real application is delegated to Split Brain Resolver. Management makes status and permitted cluster actions available over HTTP; it does not replace split-brain handling. section 8.2.6 section 8.3

Table 8.1 Akka Management HTTP available paths (view table figure)

Path

HTTP method

Required form fields

Description

/cluster/members/

GET

None

Returns the status of the cluster in JSON format

/cluster/members/

POST

Address: {address}

Executes the join operation in the cluster for the provided {address}

/cluster/members/{address}

GET

None

Returns the status of {address} in the cluster in JSON format

/cluster/members/{address}

DELETE

None

Executes the leave operation in the cluster for the provided {address}

/cluster/members/{address}

PUT

Operation: Down

Executes the down operation in the cluster for the provided {address}

/cluster/members/{address}

PUT

Operation: Leave

Executes the leave operation in the cluster for the provided {address}

/cluster/shards/{name}

GET

None

Returns shard info for the shard region with the provided {name}

Browse the available Cluster HTTP paths, methods, required fields, and their member or shard operations. section 8.3

How Akka in Action, Second Edition covers it

How deep it goes
Details dependencies, HTTP configuration, startup, safeguards, and member operations; defers automated downing to Split Brain Resolver.
Examples
Demonstrates two local nodes, JSON member status, a leave request, and bootstrap formation through discovered HTTP contact points.
What it assumes
Assumes an Akka cluster and ActorSystem, but teaches management startup from an empty typed behavior.
What you can do after
Operate/configure it by starting per-node HTTP servers, inspecting members, and enabling controlled leave or down requests.
How it connects
Connects Akka Cluster, Cluster Bootstrap, service discovery, cluster sharding, and Split Brain Resolver.

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.