Scenario
Right now we only have a single node running the whole system. What we want is to make a distinction between "frontend" nodes, and a single "backend" node.
- "Frontend" nodes (N nodes): Maintains a persistent connection with the clients through a WebSocket connection
- "Backend" node (1 node): Processes all the requests coming form all the frontend nodes querying to database, and handling the needed domain logic.
This distinction is needed due to some reasons:
- Do not reach the limit of 70-100k persistent connections per frontend node
- Avoid disconnecting the clients while deploying changes only affecting the backend
Work done
We have connected the actors living on the frontend node with the ones living on the backend. We've done so instantiating the backend node ActorRef
s from the frontend using the akka.cluster.singleton.ClusterSingletonProxy
, and the ClusterSingletonManager
while really instantiating them in the backend.
Question
How we do the deploy taking into account the Akka cluster node downing notification?
As far as I understood by the Akka Cluster documentation about downing, and some comments on the akka mailing list, the recommended approach while dealing with that process would be something like:
- Download the akka distribution from http://akka.io/downloads/
- Copy and paste the
akka-cluster
bash script together with thejmxsh-R5.jar
on aresources/bin/
folder (for instance) - Include that folder on the distributed package (I've added the following lines on the
build.sbt
):mappings in Universal ++= (baseDirectory.value / "resources" / "bin" * "*" get) map (bin => bin -> ("bin/" + bin.getName))
- While deploying, set the node to be deployed as down manually calling the bash script like:
- Execute
bin/akka-cluster %node_to_be_deployed:port% down
- Deploy the new code version
- Execute
bin/akka-cluster %deployed_node:port% join
- Execute
Doubts:
- Is this step by step procedure correct?
- If the node to be deployed will have the very same IP and port after the deploy, is it needed to make the
down
andjoin
? - We're planning to set one frontend and the backend nodes as the seed ones. This way, all the cluster could be reconstructed while making a deploy only of the frontend nodes, or only to the backend one. Is it correct?
Thanks!