The problem i have is that i can create the system on another slave machine. But i cant figure out how to distribute parts onto different machines. IE master, slave1 and slave2 all end up on same machine rather than ip 101,102 and 103 respectively.
I am using a master server to essentially manage a workflow of messages through several servers. So the master starts up creates the master server actor which then does the following:
Later i want to scale each of these horizontally - however hit a problem before that. All the remote stuff will only run on 1 machine.
I am using remote so that part of the config looks like this:
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
"/masterCreatorActor/*" {
remote = "akka.tcp://RemoteActorSystem@192.168.56.101:2552"
}
"/slave1Actor/*" {
remote = "akka.tcp://RemoteActorSystem@192.168.56.102:2552"
}
"/slave2Actor/*" {
remote = "akka.tcp://RemoteActorSystem@192.168.56.103:2552"
}
}
}
The code to create the actorSystem and master actor
val config = ConfigFactory.load("remotecreation")
val system = ActorSystem("PromoAnalysisSystem", config)
def act = system.actorOf(Props(classOf[MasterCreatorActor],OnFinished _),
name = "masterCreatorActor" )
then inside the master actor I use slave1 by doing this when it receives a message:
val slave1 = context.actorOf(Props[Slave1Actor],name = "slave1Actor")
slave1 ! slave1StartMessage
So I can host the system all on 1 machine. I can also start it on 1 machine and have it all run on another remote machine. But i cannot get each of the actors in the config to run on different machines.
I am being stupid but cant see in what way! ;)
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
deployment {
"/masterCreatorActor/*" {
remote = "akka.tcp://RemoteActorSystem@192.168.56.101:2552"
}
"/*/slave1Actor/*" {
remote = "akka.tcp://RemoteActorSystem@192.168.56.102:2552"
}
"/*/slave2Actor/*" {
remote = "akka.tcp://RemoteActorSystem@192.168.56.103:2552"
}
}
}