Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Akka.NET中,(使用Akka.Cluster)如何配置多个种子节点(Lighthouse)以相互了解?_Akka_Akka Cluster_Akka.net_Akka.net Cluster - Fatal编程技术网

在Akka.NET中,(使用Akka.Cluster)如何配置多个种子节点(Lighthouse)以相互了解?

在Akka.NET中,(使用Akka.Cluster)如何配置多个种子节点(Lighthouse)以相互了解?,akka,akka-cluster,akka.net,akka.net-cluster,Akka,Akka Cluster,Akka.net,Akka.net Cluster,如果我想让两个Lighthouse种子节点在不同的PC上运行,每个PC都应该知道另一个,我应该如何配置它们?虽然我发现有人提到使用多个Lighthouse实例,并看到了使用多个种子节点的非种子节点配置,但我还没有在单独的PC上找到多个种子节点(特别是Lighthouse)的示例,这些节点彼此都知道 我现在有类似的东西,但我不确定它是否正确 <?xml version="1.0" encoding="utf-8"?> <configuration> <conf

如果我想让两个Lighthouse种子节点在不同的PC上运行,每个PC都应该知道另一个,我应该如何配置它们?虽然我发现有人提到使用多个Lighthouse实例,并看到了使用多个种子节点的非种子节点配置,但我还没有在单独的PC上找到多个种子节点(特别是Lighthouse)的示例,这些节点彼此都知道

我现在有类似的东西,但我不确定它是否正确

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" />
    </configSections>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <akka>
        <hocon>
            <![CDATA[
                    lighthouse{
                            actorsystem: "MySystem" #POPULATE NAME OF YOUR ACTOR SYSTEM HERE
                        }

                    akka {
                        actor { 
                            provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
                        }

                        remote {
                            log-remote-lifecycle-events = DEBUG
                            helios.tcp {
                                transport-class = "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
                                applied-adapters = []
                                transport-protocol = tcp
                                #will be populated with a dynamic host-name at runtime if left uncommented
                                #public-hostname = "POPULATE STATIC IP HERE"
                                public-hostname = "192.168.72.55"
                                hostname = "0.0.0.0"
                                port = 4053
                            }
                        }            

                        loggers = ["Akka.Logger.NLog.NLogLogger,Akka.Logger.NLog"]

                        cluster {
                            #will inject this node as a self-seed node at run-time
                            seed-nodes = [
                "akka.tcp://MySystem@192.168.72.55:4053"
                "akka.tcp://MySystem@192.168.72.56:4053"
              ] #manually populate other seed nodes here, i.e. "akka.tcp://lighthouse@127.0.0.1:4053", "akka.tcp://lighthouse@127.0.0.1:4044"
                            roles = [lighthouse]
                        }
                    }
            ]]>
        </hocon>
    </akka>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>
akka.cluster:

    seed-nodes = [
  "akka.tcp://MySystem@192.168.72.56:4053"
  "akka.tcp://MySystem@192.168.72.55:4053"
] #manually populate other seed nodes here, i.e. "akka.tcp://lighthouse@127.0.0.1:4053", "akka.tcp://lighthouse@127.0.0.1:4044"
是这样吗?有什么我应该改变或可以改进的吗?确保一切正常运行的最佳方法是什么?我是否应该删除这些配置中的第一个种子节点,因为注释似乎表明没有必要包含它

如果我在192.168.72.55上启动节点,然后在192.168.72.56上启动节点,我会看到它在192.168.72.55上加入,并在192.168.72.56上收到欢迎消息。如果我关闭192.168.72.56实例并再次启动它,它会再次受到欢迎,但192.168.72.55实例会继续输出如下消息:

Akka.Cluster.ClusterCoreDaemon: Leader can currently not perform its duties, rea
chability status: [akka.tcp://MySystem@192.168.72.55:4053 -> UniqueAddr
ess: (akka.tcp://MySystem@192.168.72.56:4053, 1180787153): Unreachable
[Unreachable] (2), ], member status: [$akka.tcp://MySystem@192.168.72.55
:4053 $Up seen=$True, $akka.tcp://MySystem@192.168.72.56:4053 $Up seen
=$False]
Akka.Remote.MySystem: Association with remote system akka.tcp:
//MySystem@192.168.72.56:4053 has failed; address is now gated for 5000
 ms. Reason is: [Akka.Remote.EndpointDisassociatedException: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, Parti
alAction`1 partialAction)
   at Akka.Actor.ReceiveActor.<>c__DisplayClass11_0.<Become>b__0(Object m)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SystemInvoke(Envelope envelope)]
Akka.Actor.OneForOneStrategy: Disassociated Akka.Remote.EndpointDisassociatedExc
eption: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, Parti
alAction`1 partialAction)
   at Akka.Actor.ReceiveActor.<>c__DisplayClass11_0.<Become>b__0(Object m)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SystemInvoke(Envelope envelope)
Akka.Cluster.clusterCoredemon:领导者当前无法履行其职责,rea
可达性状态:[阿克卡。tcp://MySystem@192.168.72.55:4053->UniqueAddr
女:阿卡。tcp://MySystem@192.168.72.56:40531180787153):无法到达
[无法访问](2),],成员状态:[$akka。tcp://MySystem@192.168.72.55
:4053$Up seen=$True$akka。tcp://MySystem@192.168.72.56:4053美元上涨
=$False]
Akka.Remote.MySystem:与远程系统Akka.tcp的关联:
//MySystem@192.168.72.56:4053失败;地址现在是5000
ms.原因是:[Akka.Remote.EndpointDisassociated异常:Disassociated
在Akka.Remote.EndpointWriter.PublishAndRow(异常原因,日志级别)
(l)
在Akka.Remote.EndpointWriter.Unhandled处(对象消息)
在Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(对象消息,Parti
A行动'1部分行动)
在Akka.Actor.ReceiveActor.c_uuu显示Class11_0.b_u0(对象m)
在Akka.Actor.ActorCell.c_uuuu显示类109_0.b_uu0(对象m)
在Akka.Actor.ActorBase.AroundReceive(接收接收,对象消息)
在Akka.Actor.ActorCell.ReceiveMessage(对象消息)
在Akka.Actor.ActorCell.ReceivedTerminated(终止于t)
在Akka.Actor.ActorCell.AutoReceiveMessage(信封)
在Akka.Actor.ActorCell.Invoke(信封)
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在Akka.Actor.ActorCell.HandleFailed(失败的f)
在Akka.Actor.ActorCell.SystemInvoke(信封)]
Akka.Actor.OneForOneStrategy:Disassociated Akka.Remote.EndpointDisassociatedExc
分离
在Akka.Remote.EndpointWriter.PublishAndRow(异常原因,日志级别)
(l)
在Akka.Remote.EndpointWriter.Unhandled处(对象消息)
在Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(对象消息,Parti
A行动'1部分行动)
在Akka.Actor.ReceiveActor.c_uuu显示Class11_0.b_u0(对象m)
在Akka.Actor.ActorCell.c_uuuu显示类109_0.b_uu0(对象m)
在Akka.Actor.ActorBase.AroundReceive(接收接收,对象消息)
在Akka.Actor.ActorCell.ReceiveMessage(对象消息)
在Akka.Actor.ActorCell.ReceivedTerminated(终止于t)
在Akka.Actor.ActorCell.AutoReceiveMessage(信封)
在Akka.Actor.ActorCell.Invoke(信封)
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在Akka.Actor.ActorCell.HandleFailed(失败的f)
在Akka.Actor.ActorCell.SystemInvoke(信封)
后来:

Akka.Cluster.ClusterCoreDaemon: Leader can currently not perform its duties, reachability status: [], member status: [$akka.tcp://MySystem@192.168.72.55:4053 $Up seen=$True, $akka.tcp://MySystem@192.168.72.56:4053 $Up seen =$False]
Akka.Remote.ReliableDeliverySupervisor: Association with remote system akka.tcp:
//MySystem@192.168.72.56:4053 has failed; address is now gated for 5000
 ms. Reason is: [Akka.Remote.EndpointDisassociatedException: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, Parti
alAction`1 partialAction)
   at Akka.Actor.ReceiveActor.<>c__DisplayClass11_0.<Become>b__0(Object m)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)]
Akka.Actor.OneForOneStrategy: Disassociated Akka.Remote.EndpointDisassociatedExc
eption: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, Parti
alAction`1 partialAction)
   at Akka.Actor.ReceiveActor.<>c__DisplayClass11_0.<Become>b__0(Object m)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SystemInvoke(Envelope envelope)
Akka.Cluster.ClusterCoreDaemon:领导者当前无法履行其职责,可达性状态:[],成员状态:[$Akka。tcp://MySystem@192.168.72.55:4053$Up SEED=$True$akka。tcp://MySystem@192.168.72.56:4053$Up SEED=$False]
Akka.Remote.ReliableDeliverySupervisor:与远程系统Akka.tcp的关联:
//MySystem@192.168.72.56:4053失败;地址现在是5000
ms.原因是:[Akka.Remote.EndpointDisassociated异常:Disassociated
在Akka.Remote.EndpointWriter.PublishAndRow(异常原因,日志级别)
(l)
在Akka.Remote.EndpointWriter.Unhandled处(对象消息)
在Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(对象消息,Parti
A行动'1部分行动)
在Akka.Actor.ReceiveActor.c_uuu显示Class11_0.b_u0(对象m)
在Akka.Actor.ActorCell.c_uuuu显示类109_0.b_uu0(对象m)
在Akka.Actor.ActorBase.AroundReceive(接收接收,对象消息)
在Akka.Actor.ActorCell.ReceiveMessage(对象消息)
在Akka.Actor.ActorCell.ReceivedTerminated(终止于t)
在Akka.Actor.ActorCell.AutoReceiveMessage(信封)
在Akka.Actor.ActorCell.Invoke(信封)]
Akka.Actor.OneForOneStrategy:Disassociated Akka.Remote.EndpointDisassociatedExc
分离
在Akka.Remote.EndpointWriter.PublishAndRow(异常原因,日志级别)
(l)
在Akka.Remote.EndpointWriter.Unhandled处(对象消息)
在Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(对象消息,Parti
A行动'1部分行动)
在Akka.Actor.ReceiveActor.c_uuu显示Class11_0.b_u0(对象m)
在Akka.Actor.ActorCell.c_uuuu显示类109_0.b_uu0(对象m)
在Akka.Actor.ActorBase.AroundReceive(接收接收,对象消息)
在Akka.Actor.ActorCell.ReceiveMessage(对象消息)
在Akka.Actor.ActorCell.ReceivedTerminated(终止于t)
在Akka.Actor.ActorCell.AutoReceiveMessage(信封)
在Akka.Actor.ActorCell.Invoke(信封)
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在Akka.Actor.ActorCell.HandleFailed(失败的f)
在阿克卡。
Akka.Cluster.ClusterCoreDaemon: Leader can currently not perform its duties, reachability status: [], member status: [$akka.tcp://MySystem@192.168.72.55:4053 $Up seen=$True, $akka.tcp://MySystem@192.168.72.56:4053 $Up seen =$False]
Akka.Remote.ReliableDeliverySupervisor: Association with remote system akka.tcp:
//MySystem@192.168.72.56:4053 has failed; address is now gated for 5000
 ms. Reason is: [Akka.Remote.EndpointDisassociatedException: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, Parti
alAction`1 partialAction)
   at Akka.Actor.ReceiveActor.<>c__DisplayClass11_0.<Become>b__0(Object m)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)]
Akka.Actor.OneForOneStrategy: Disassociated Akka.Remote.EndpointDisassociatedExc
eption: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, Parti
alAction`1 partialAction)
   at Akka.Actor.ReceiveActor.<>c__DisplayClass11_0.<Become>b__0(Object m)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SystemInvoke(Envelope envelope)
Akka.Cluster.ClusterCoreDaemon: New incarnation of existing member [UniqueAddres
s: (akka.tcp://MySystem@192.168.72.56:4053, 1173825306)] is trying to j
oin. Existing will be removed from the cluster and then new member will be allow
ed to join.
Akka.Cluster.ClusterCoreDaemon: Marking node [akka.tcp://MySystem@192.16
8.72.56:4053] as Down
Akka.Cluster.ClusterCoreDaemon: Leader can perform its duties again

Akka.Cluster.ClusterCoreDaemon: New incarnation of existing member [UniqueAddres
s: (akka.tcp://MySystem@192.168.72.56:4053, 253329532)] is trying to jo
in. Existing will be removed from the cluster and then new member will be allowe
d to join.
Akka.Cluster.ClusterCoreDaemon: Cluster Node [akka.tcp://MySystem@192.16
8.72.55:4053] - Marking node(s) as UNREACHABLE [Member(address = akka.tcp://Sup
ervisorSystem@192.168.72.56:4053, status = Down]
Akka.Cluster.ClusterCoreDaemon: Leader is removing unreachable node [akka.tcp://
MySystem@192.168.72.56:4053]
Akka.Event.DummyClassForStringSources: Association to [akka.tcp://MySystem@192.168.72.56:4053] having UID [1180787153] is irrecoverably failed. UID is
now quarantined and all messages to this UID will be delivered to dead letters.
Remote actorsystem must be restarted to recover from this situation.
Akka.Remote.ReliableDeliverySupervisor: Association with remote system akka.tcp:
//MySystem@192.168.72.56:4053 has failed; address is now gated for 5000
 ms. Reason is: [Akka.Remote.EndpointDisassociatedException: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, Parti
alAction`1 partialAction)
   at Akka.Actor.ReceiveActor.<>c__DisplayClass11_0.<Become>b__0(Object m)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SystemInvoke(Envelope envelope)]
Akka.Cluster.ClusterCoreDaemon: Node [akka.tcp://MySystem@192.168.72.56
:4053] is JOINING, roles [lighthouse]
Akka.Actor.OneForOneStrategy: Disassociated Akka.Remote.EndpointDisassociatedExc
eption: Disassociated
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel leve
l)
   at Akka.Remote.EndpointWriter.Unhandled(Object message)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, Parti
alAction`1 partialAction)
   at Akka.Actor.ReceiveActor.<>c__DisplayClass11_0.<Become>b__0(Object m)
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<Akka.Actor.IUntypedActorConte
xt.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
   at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SystemInvoke(Envelope envelope)
Akka.Cluster.ClusterCoreDaemon: Leader is moving node [akka.tcp://MySystem@192.168.72.56:4053] to [Up]