This is a Akka demo application and cluster configuration intended to help understand how Akka clustering works in practice.
It uses Docker to run cluster nodes and iptables to simulate network partitions. Some other failure simulations can also be achieved by killing/pausing/stopping individual docker containers.
Each sample application logs its cluster status events into a file to the mounted folder cluster/events
.
- Build application
cd akka-apps
./build
- Run cluster
cd cluster
./up <config file>
e.g. ./up configs/sbr-keep-majority.conf
cd cluster
./up config/sbr-keep-majority.conf ./up config/sbr-keep-oldest.conf
./down
./connectivity off 1 3
./connectivity on 1 3
./clear-rules 4
./console 5
./connectivity-12-345 off
docker-compose pause node-4 docker-compose unpause node-4 docker-compose stop node-4 docker-compose start node-4 docker-compose restart node-4
docker-compose exec node-1 curl node-2:8558/cluster/members
or
curl localhost:8558/node-2/cluster/members
See
https://developer.lightbend.com/docs/akka-management/current/cluster-http-management.html
for more information.
in the latest case control-node
provides proxy access by Nginx to each node Akka Management HTTP endpoint. See cluster/control-node
for details.