akka-cluster

Create actor on any unspecified/random node in cluster

*爱你&永不变心* 提交于 2020-01-13 16:45:14
问题 It is possible to programmatically create an actor on a remote node, if you specify the exact node. However, I would like to simply ask the actor system to create an actor on a random, or perhaps the least utilised node. Is it possible to create an actor on any remote node given an optional node role? 回答1: In Akka 2.3 you should use Cluster Aware Routers All routers can be made aware of member nodes in the cluster, i.e. deploying new routees or looking up routees on nodes in the cluster. So

Akka actors scaling across JVM's and servers, and example at akka.io

亡梦爱人 提交于 2020-01-06 15:58:11
问题 I find the introductory example of Akka remoting supplied on the Akka landing page a bit hard to swallow as an introduction, and the length of documentation necessary for learning the ins and outs of remoting malstructured for introductory purposes. Here below is the code from the mentioned example, and I'd like to ask for a delineation of what that code means with some fair context, while relating to the question of whether any actor can be messaged remotely as if it were local requiring

Information and management of the akka cluster using JMX console

倖福魔咒の 提交于 2020-01-06 07:25:47
问题 I am working on a project based on akka cluster, where I got to implement JMX console to the manage akka clusters. When I was looking at the akka documentation I got a very minimal information. Then I tried looking at Java VisualVM, found an option to add new jmx connection like below, then what should be the connection url there ? I tried localhost:8080 but unsuccessful . What should be configured else to get the JMX console to my akka cluster ? 回答1: In the application.conf for the node(s)

max number of actors per host in akka

左心房为你撑大大i 提交于 2019-12-22 07:20:21
问题 How many max actors can we have on one box in akka? public void MyActor extends AkkaActor{ receive(Objet obj){ // so something } } 1)Is there some limit on max number of actors instances?I am planning to created around 10K actors on one box. I will have 50 such boxes so that i can scale horizontally 2)IS there some performance problems with this? 回答1: It is just a matter of having enough memory: the overhead of one actor is roughly 400 bytes (plus whatever state you keep within it). This

“max allowed size 128000 bytes, actual size of encoded class scala” error in akka remoting

旧时模样 提交于 2019-12-21 08:54:50
问题 I want to use Akka Remoting to exchange message over network between actors, but for large String message i got the following error: akka.remote.OversizedPayloadException: Discarding oversized payload sent to Actor :: max allowed size 128000 bytes , actual size of encoded class scala. How can i fix this limitation? 回答1: I add the following configuration and now everything is ok: akka { actor { provider = "akka.remote.RemoteActorRefProvider" } remote { maximum-payload-bytes = 30000000 bytes

Kubernetes - Akka clustering Deployment

末鹿安然 提交于 2019-12-21 05:06:37
问题 We have a docker image and a corresponding yaml file for the deployment using kubernetes. The application we have built is in scala with akka-http. We have used akka-cluster. We have a particular variable(seed-nodes in our case - akka cluster) in the configuration file which is used in our application code that uses the pod ip. But, we will not get the pod ip unless the deployment is done. How should we go about tackling the issue? Will environment variables help, if yes how? More

Akka cluster: how to disable ClusterHeartbeat log

为君一笑 提交于 2019-12-12 00:28:24
问题 I'm playing a bit with an Akka cluster and I had a setup with 2 nodes. As expected, the two nodes chat each other to say that they are alive through the heartbeat . So every second I have a string like this in my log [debug] 15:42:10.683-a.c.ClusterHeartbeatSender: Cluster Node [akka.tcp://application@127.0.0.1:52650] - Heartbeat to [akka.tcp://application@127.0.0.1:2551] However I wouldn't like to see this diagnostic, since it hides my debug information and I'm quite sure that the cluster

Running an Akka Cluster with EC2 and Docker. Nodes aren't registered in akka-cluster

不羁的心 提交于 2019-12-11 19:35:11
问题 I implemented the following sample of the akka-cluster system, please see below diagram: ┌────host_D:3000────┐ ┌───────▶│ .... │ │ ┌────host_C:3000────┐ │ ┌────host_A:2551────┐ │ ┌───▶│ │ │ │ │──┘ │ ┌────host_B:3000────┐ │ │ │┌─────────────────┐│────┘ │┌─────────────────┐│ │ │ ││ MasterActor ││──────▶││ WorkerActor ││ │─┘ │└─────────────────┘│ │└─────────────────┘│─┘ └───────────────────┘ └───────────────────┘ The MasterActor and WorkerActor are implemented in separated sbt-modules and

Akka clustering - force actors to stay on specific machines

独自空忆成欢 提交于 2019-12-11 04:17:37
问题 I've got an akka application that I will be deploying on many machines. I want each of these applications to communicate with each others by using the distributed publish/subscribe event bus features. However, if I set the system up for clustering, then I am worried that actors for one application may be created on a different node to the one they started on. It's really important that an actor is only created on the machine that the application it belongs to was started on. Basically, I don

How to broadcast message to all actors in an AKKA cluster in java?

帅比萌擦擦* 提交于 2019-12-10 19:36:30
问题 I have an AKKA cluster system with name say ClusterSystem . Each node of this cluster have an actor ActorA . I want a way to broadcast a message sent to an actor to all the ActoraA -s running in the cluster. It would be of great help if any one can post an example in Java. 回答1: Check out the Distributed Publish Subscribe extension. It lets you subscribe one or more actors to a topic, and publish messages to this topic from any actor in the cluster. Subscribing: class Subscriber extends Actor