GithubHelp home page GithubHelp logo

hseeberger / akkluster Goto Github PK

View Code? Open in Web Editor NEW
9.0 5.0 3.0 239 KB

Demo application to visualize the status of the member nodes

License: Apache License 2.0

Scala 89.62% HTML 1.17% JavaScript 6.14% Shell 3.08%

akkluster's Introduction

Akka Cluster up and running

Demo application to visualize the status (up, unreachable, etc.) of the member nodes of an Akka cluster.

Running locally in sbt

First add an additional loopback address:

sudo ifconfig lo0 127.0.0.2 add

Then run an sbt session and execute the command alias (see build.sbt) r0. Point your browser to 127.0.0.1:8080. Optionally run r1 in another sbt session.

How to make nodes unavailable in Docker

To make a node unavailable, first run the containers with NET_ADMIN capabilities:

docker run --detach --cap-add NET_ADMIN ...

Then connect to a running container and block traffic:

docker exec -i -t ... bash
iptables -A INPUT -p tcp -j DROP

To make a node available again:

iptables -D INPUT -p tcp -j DROP

On Minikube

minikube start

# Start with 1 dynamic replica
kubectl apply -f k8s.yml
minikube service --namespace akkluster akkluster-http

# Scale up to two replicas, down to one again and up to two again
kubectl patch --namespace akkluster deployment akkluster-dynamic -p '{"spec": {"replicas": 2}}'
kubectl patch --namespace akkluster deployment akkluster-dynamic -p '{"spec": {"replicas": 1}}'
kubectl patch --namespace akkluster deployment akkluster-dynamic -p '{"spec": {"replicas": 2}}'

# Make one dynamic replica unreachable
kubectl exec --namespace akkluster -i -t akkluster-dynamic-... -- bash
iptables -A INPUT -p tcp -j DROP

# Scale up to three replicas and see what happens ...
kubectl patch --namespace akkluster deployment akkluster-dynamic -p '{"spec": {"replicas": 3}}'

# Make one dynamic replica leave
http --form PUT $(minikube service --url akkluster-management)/cluster/members/akka://[email protected].???:25520 'operation=Leave'

# Make unreachable dynamic replica reachable again
iptables -D INPUT -p tcp -j DROP

Contribution policy

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.

License

This code is open source software licensed under the Apache-2.0 license.

akkluster's People

Contributors

hseeberger avatar scala-steward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

akkluster's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.