0

我使用 Lighthouse 作为我的种子节点,我正在编写我的第一个集群节点。我对akka集群很陌生,所以不知道我做错了什么。我有灯塔正在运行,并且一个非种子节点试图加入并获取错误消息 Dropping message [Akka.Actor.ActorSelectionMessage] 用于非本地收件人。

尝试了各种配置,但没有成功。我确保灯塔和非种子节点中的 Actor System 名称相同。查看代码和 HOCON

非种子节点 Actor 系统创建:

    public ClusterActorSystem()
    {
        system = ActorSystem.Create("ThisIsMyName");
        Console.WriteLine($"The Actor System Name is {system.Name}");
    }

在灯塔上使用这个 HOCON

    <pre>
    lighthouse{
  actorsystem: "ThisIsMyName" #POPULATE NAME OF YOUR ACTOR SYSTEM HERE
}
    # See petabridge.cmd configuration options here: 
    https://cmd.petabridge.com/articles/install/host-configuration.html
    petabridge.cmd{
    # default IP address used to listen for incoming petabridge.cmd client connections
    # should be a safe default as it listens on "all network interfaces".
    host = "0.0.0.0"

    # default port number used to listen for incoming petabridge.cmd client 
    connections
    port = 9110
}

    akka {
      actor {
        provider = cluster
      }

      remote {
        log-remote-lifecycle-events = DEBUG
        dot-netty.tcp {
          transport-class = "Akka.Remote.Transport.DotNetty.TcpTransport, Akka.Remote"
          applied-adapters = []
          transport-protocol = tcp
          #will be populated with a dynamic host-name at runtime if left uncommented
          #public-hostname = ""
          hostname = "0.0.0.0"
          port = 19621
        }
      }            

      cluster {
        #will inject this node as a self-seed node at run-time
        seed-nodes = []
        roles = [lighthouse]
      }
    }


    </pre>

在 Non-See 节点上使用这个 HOCON

      <akka>
    <hocon>
      <![CDATA[
          akka {
            log-remote-lifecycle-events = DEBUG
            actor.provider = cluster
            remote {
              dot-netty.tcp {
                transport-class = "Akka.Remote.Transport.DotNetty.TcpTransport, Akka.Remote"
                applied-adapters = []
                transport-protocol = tcp
                port = 15245
                hostname = localhost
              }
            }
            cluster {
              seed-nodes = ["akka.tcp://ThisIsMyName@localhost:19621"]
              #roles = ["MyFirstRole"]
            }
          }
      ]]>
    </hocon>
  </akka>

灯塔日志消息:

[ERROR][6/7/2019 4:42:50 PM][Thread 0011][[akka://ThisIsMyName/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FThisIsMyName%40localhost%3A51281-2/endpointWriter#1992505106]] Dropping message [Akka.Actor.ActorSelectionMessage] for non-local recipient [[akka.tcp://ThisIsMyName@localhost:19621/]] arriving at [akka.tcp://ThisIsMyName@localhost:19621] inbound addresses [akka.tcp://ThisIsMyName@7815-pc1:19621]
Cause: Unknown
[ERROR][6/7/2019 4:42:55 PM][Thread 0009][[akka://ThisIsMyName/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FThisIsMyName%40localhost%3A51281-2/endpointWriter#1992505106]] Dropping message [Akka.Actor.ActorSelectionMessage] for non-local recipient [[akka.tcp://ThisIsMyName@localhost:19621/]] arriving at [akka.tcp://ThisIsMyName@localhost:19621] inbound addresses [akka.tcp://ThisIsMyName@7815-pc1:19621]
Cause: Unknown

non-seed node log messages:
INFO][6/7/2019 5:13:10 PM][Thread 0001][remoting] Starting remoting
[INFO][6/7/2019 5:13:11 PM][Thread 0001][remoting] Remoting started; listening on addresses : [akka.tcp://ThisIsMyName@localhost:15245]
[INFO][6/7/2019 5:13:11 PM][Thread 0001][remoting] Remoting now listens on addresses: [akka.tcp://ThisIsMyName@localhost:15245]
[INFO][6/7/2019 5:13:11 PM][Thread 0001][Cluster] Cluster Node [akka.tcp://ThisIsMyName@localhost:15245] - Starting up...
[INFO][6/7/2019 5:13:11 PM][Thread 0001][Cluster] Cluster Node [akka.tcp://ThisIsMyName@localhost:15245] - Started up successfully
The Actor System Name is ThisIsMyName
Actor System Started.
[WARNING][6/7/2019 5:13:21 PM][Thread 0003][[akka://ThisIsMyName/system/cluster/core/daemon/joinSeedNodeProcess-1#2129151453]] Couldn't join seed nodes after [2] attempts, will try again. seed-nodes=[akka.tcp://ThisIsMyName@localhost:19621]
4

0 回答 0