2016-03-17 1 views
4

Si je veux avoir deux noeuds de gestation Lighthouse fonctionnant sur différents PC, où chacun devrait connaître l'autre, comment dois-je les configurer? Bien que j'ai trouvé mention d'utiliser plusieurs instances de Lighthouse et des configurations de nœuds non-seed utilisant des nœuds multiples, je n'ai pas réussi à trouver un exemple de plusieurs nœuds de seed (spécifiquement Lighthouse) sur des PC séparés qui en connaissent un. un autre.Dans Akka.NET, (en utilisant Akka.Cluster) comment configurer plusieurs noeuds de gestation (Lighthouse) pour se connaître?

J'ai actuellement quelque chose comme ça, mais je ne suis pas certain que ce soit correct.

<?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://[email protected]192.168.72.55:4053" 
       "akka.tcp://[email protected]:4053" 
       ] #manually populate other seed nodes here, i.e. "akka.tcp://[email protected]:4053", "akka.tcp://[email protected]: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> 

Avec la configuration de l'autre instance fondamentalement la même, mais avec ces différences:

akka.remote:

public-hostname = "192.168.72.56" 

akka.cluster:

seed-nodes = [ 
    "akka.tcp://[email protected]:4053" 
    "akka.tcp://[email protected]:4053" 
] #manually populate other seed nodes here, i.e. "akka.tcp://[email protected]:4053", "akka.tcp://[email protected]:4044" 

Est ce droit? Y a-t-il des choses que je devrais changer ou améliorer? Quelle est la meilleure façon de s'assurer que tout fonctionne comme il se doit? Dois-je supprimer le premier nœud de départ dans chacune de ces configurations, puisque les commentaires semblent indiquer qu'il n'est pas nécessaire de l'inclure?

Si je démarre le nœud sur 192.168.72.55 puis le nœud sur 192.168.72.56, je le vois rejoindre sur 192.168.72.55 et recevoir un message de bienvenue sur le 192.168.72.56. Si je arrêter l'instance 192.168.72.56 et commencer à nouveau, il est accueilli à nouveau, mais l'instance 192.168.72.55 maintient la sortie des messages tels que:

Akka.Cluster.ClusterCoreDaemon: Leader can currently not perform its duties, rea 
chability status: [akka.tcp://[email protected]:4053 -> UniqueAddr 
ess: (akka.tcp://[email protected]:4053, 1180787153): Unreachable 
[Unreachable] (2), ], member status: [$akka.tcp://[email protected] 
:4053 $Up seen=$True, $akka.tcp://[email protected]:4053 $Up seen 
=$False] 
Akka.Remote.MySystem: Association with remote system akka.tcp: 
//[email protected]: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) 

Et plus tard:

Akka.Cluster.ClusterCoreDaemon: Leader can currently not perform its duties, reachability status: [], member status: [$akka.tcp://[email protected]:4053 $Up seen=$True, $akka.tcp://[email protected]:4053 $Up seen =$False] 
Akka.Remote.ReliableDeliverySupervisor: Association with remote system akka.tcp: 
//[email protected]: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) 

Faire cela à nouveau J'ai remarqué les messages suivants:

Akka.Cluster.ClusterCoreDaemon: New incarnation of existing member [UniqueAddres 
s: (akka.tcp://[email protected]: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://[email protected] 
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://[email protected]: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://[email protected] 
8.72.55:4053] - Marking node(s) as UNREACHABLE [Member(address = akka.tcp://Sup 
[email protected]:4053, status = Down] 
Akka.Cluster.ClusterCoreDaemon: Leader is removing unreachable node [akka.tcp:// 
[email protected]:4053] 
Akka.Event.DummyClassForStringSources: Association to [akka.tcp://[email protected]: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: 
//[email protected]: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://[email protected] 
: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://[email protected]:4053] to [Up] 
+0

Salut, .... un peu de chance avec ça? Je suis confronté au même problème. –

+0

Désolé, je ne me souviens pas de trouver une solution à cela. En fin de compte, je suis passé à une approche complètement différente. Vous pouvez essayer de demander dans https://gitter.im/akkadotnet/akka.net si vous ne l'avez pas déjà fait. – foven

+0

Merci, j'ai utilisé le nom d'hôte public pour l'adresse IP publique et gardé le nom d'hôte = "0.0.0.0" pour lier à toutes les interfaces. Tout a fonctionné parfaitement –

Répondre