1
akka {
actor {
provider = "akka.cluster.ClusterActorRefProvider"
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = "127.0.0.1"
port = 0
}
}
}
akka.cluster {
seed-nodes = [
"akka.tcp://[email protected]:2551",
"akka.tcp://[email protected]:2552"
]
}
object AndromedaApiClusterActivator extends App {
val system = ActorSystem("MyCluster", ConfigFactory.load())
val clusterController = system.actorOf(Props[MyCluster], name = "MyCluster")
}
class MyCluster extends Actor {
val log = Logging(context.system, this)
val cluster = Cluster(context.system)
override def preStart() {
cluster.subscribe(self, classOf[MemberEvent], classOf[UnreachableMember])
}
override def postStop() {
cluster.unsubscribe(self)
}
override def receive = {
case x: MemberEvent => log.info("MemberEvent: {}", x)
case x: UnreachableMember => log.info("UnreachableMember {}: ", x)
}
}
Когда я запускаю его я получаю:Akka: Как запустить простой локальный кластер?
Association with remote system [akka.tcp://[email protected]:2552] has failed, address is now gated for [5000] ms. Reason: [Association failed with [akka.tcp://[email protected]:2552]] Caused by: [Connection refused: /127.0.0.1:2552]
Association with remote system [akka.tcp://[email protected]:2551] has failed, address is now gated for [5000] ms. Reason: [Association failed with [akka.tcp://[email protected]:2551]] Caused by: [Connection refused: /127.0.0.1:2551]
Я не могу найти объяснение. Любая помощь?
проверить в эта ссылка https://groups.google.com/forum/#!topic/akka-user/joTgQ6PDX0Y – aravindKrishna