尝试设置集群路由器池,并且本地角色启动正常,但是当第一个远程系统加入集群时出现异常。
这是具有3个项目的1-vs解决方案-种子,辅助和共享消息/类。
[ERROR][12/25/2018 2:30:10 AM][Thread 0004][akka://test/user/RRPool] Error while creating
actor instance of type Akka.Actor.ActorBase with 0 args: ()
Cause: [akka.tcp://test@spectre:49824/remote/akka.tcp/test@spectre:8080/user/RRPool/c2#1149667581]:
Akka.Actor.ActorInitializationException: > Exception during creation --->
System.TypeLoadException: Error while creating actor instance of type
Akka.Actor.ActorBase with 0 args: () --->
System.InvalidOperationException: No actor producer specified!
at Akka.Actor.Props.DefaultProducer.Produce()
at Akka.Actor.Props.NewActor()
我尝试过:
但是到目前为止没有成功。
启动路由器并测试告诉:
var router = sys.ActorOf(Props.Create<sharedProj.PoolRouter>()
.WithRouter(FromConfig.Instance), "RRPool");
router.Tell("Main Service telling me something");
为了进行测试/学习,我已经将我的配置放入带有变量的代码中。 种子节点配置和辅助节点之间的唯一区别是端口0。
"akka {
actor.provider = cluster
loglevel = """ + logInfo + @"""
remote {
dot-netty.tcp {
port = " + myPort + @"
hostname = " + name + @"
public-hostname = " + name + @"
}
}
actor.deployment {
/RRPool {
router = round-robin-pool # routing strategy
nr-of-instances = 10 # max number of total routees
cluster {
enabled = on
allow-local-routees = on
max-nr-of-instances-per-node = 1
}
}
}
cluster {
seed-nodes = [""" + seed + @"""]
}
extensions = [""Akka.Cluster.Tools.PublishSubscribe.DistributedPubSubExtensionProvider,Akka.Cluster.Tools""]
}";