2013-07-31 20 views
15

我試圖從這個文件創建一個Win 7的機器上的基本阿卡集羣:
http://doc.akka.io/docs/akka/snapshot/scala/cluster-usage.html阿卡集羣種子節點給錯誤:丟棄消息對於非本地收件人

,我得到一個錯誤當我運行的種子節點(更多關於它們下面)

AdriansClusterSystem-akka.actor.default-dispa tcher-16] [akka://AdriansClusterSystem/system/endpointManager/reliableEndpointWr iter-akka.tcp%3A%2F%2FAdriansClusterSystem%40127.0.0.1%3A2552-3/endpointWriter] dropping message [class akka.actor.SelectChildName] for non-local recipient [Act or[akka.tcp://[email protected]:2552/]] arriving at [akka.tcp://ClusterSys [email protected]:2552] inbound addresses are [akka.tcp://[email protected] .0.1:2552]

問: 爲什麼會出現這個錯誤?我錯過了akka文檔中的一些東西嗎?

我.conf文件:
我加入這個額外的行*要在URL上面列出的文件* enabled-transports = ["akka.remote.netty.tcp"]

akka { 
    actor { 
    provider = "akka.cluster.ClusterActorRefProvider" 
    } 
    remote { 
    enabled-transports = ["akka.remote.netty.tcp"] <--added this from remoting 
    log-remote-lifecycle-events = off 
    netty.tcp { 
     hostname = "127.0.0.1" 
     port = 0 
    } 
    } 
    cluster { 
    seed-nodes = [ 
    "akka.tcp://[email protected]:2551", 
    "akka.tcp://[email protected]:2552"] 

    auto-down = on 
    } 
} 

我開始2個節點,每個不同的SBT窗口

run-main sample.cluster.simple.SimpleClusterApp 2551 
run-main sample.cluster.simple.SimpleClusterApp 2552 

這兩個都啓動正常,然後反覆顯示一個ERROR消息:

mybuild:-:0.0.1-SNAPSHOT>`run-main sample.cluster.simple.SimpleClusterApp 2552` 
[warn] Credentials file C:\Users\amocanu\.ivy2\.credentials does not exist <-- ? 
[info] Running sample.cluster.simple.SimpleClusterApp 2552 
args[0]= 2552 
[INFO] [07/31/2013 10:50:00.397] [run-main] [Remoting] Starting remoting 
[INFO] [07/31/2013 10:50:00.661] [run-main] [Remoting] Remoting started; listeni 
ng on addresses :[akka.tcp://[email protected]:2552] 
[INFO] [07/31/2013 10:50:00.710] [run-main] [Cluster(akka://AdriansClusterSystem 
)] Cluster Node [akka.tcp://[email protected]:2552] - Starting up.. 
. 
[INFO] [07/31/2013 10:50:00.823] [run-main] [Cluster(akka://AdriansClusterSystem 
)] Cluster Node [akka.tcp://[email protected]:2552] - Registered cl 
uster JMX MBean [akka:type=Cluster] 
[INFO] [07/31/2013 10:50:00.823] [run-main] [Cluster(akka://AdriansClusterSystem 
)] Cluster Node [akka.tcp://[email protected]:2552] - Started up su 
ccessfully 
[INFO] [07/31/2013 10:50:00.868] [AdriansClusterSystem-akka.actor.default-dispat 
cher-2] [Cluster(akka://AdriansClusterSystem)] Cluster Node [akka.tcp://AdriansC 
[email protected]:2552] - Metrics will be retreived from MBeans, and may be 
incorrect on some platforms. To increase metric accuracy add the 'sigar.jar' to 
the classpath and the appropriate platform-specific native libary to 'java.libr 
ary.path'. Reason: java.lang.ClassNotFoundException: org.hyperic.sigar.Sigar 
[INFO] [07/31/2013 10:50:00.874] [AdriansClusterSystem-akka.actor.default-dispat 
cher-2] [Cluster(akka://AdriansClusterSystem)] Cluster Node [akka.tcp://AdriansC 
[email protected]:2552] - Metrics collection has started successfully 
[INFO] [07/31/2013 10:50:00.883] [AdriansClusterSystem-akka.actor.default-dispat 
cher-13] [akka://AdriansClusterSystem/user/clusterListener] Current members: 
[ERROR] [07/31/2013 10:50:01.003] [AdriansClusterSystem-akka.actor.default-dispa 
tcher-3] [akka://AdriansClusterSystem/system/endpointManager/reliableEndpointWri 
ter-akka.tcp%3A%2F%2FAdriansClusterSystem%40127.0.0.1%3A2551-0/endpointWriter] d 
ropping message [class akka.actor.SelectChildName] for non-local recipient [Acto 
r[akka.tcp://[email protected]:2552/]] arriving at [akka.tcp://ClusterSyst 
[email protected]:2552] inbound addresses are [akka.tcp://[email protected] 
0.1:2552] 
[ERROR] [07/31/2013 10:50:01.009] [AdriansClusterSystem-akka.actor.default-dispa 
tcher-16] [akka://AdriansClusterSystem/system/endpointManager/reliableEndpointWr 
iter-akka.tcp%3A%2F%2FAdriansClusterSystem%40127.0.0.1%3A2552-3/endpointWriter] 
dropping message [class akka.actor.SelectChildName] for non-local recipient [Act 
or[akka.tcp://[email protected]:2552/]] arriving at [akka.tcp://ClusterSys 
[email protected]:2552] inbound addresses are [akka.tcp://[email protected] 
.0.1:2552] 

如果我現在做

run-main sample.cluster.simple.SimpleClusterApp 

這是應該選擇一個隨機端口和運行一個種子節點,它開始的好,就像其他的2號種子節點,則顯示了一個類未發現異常如INFO並且沒有電流會員

[INFO] [07/31/2013 11:19:36.612] [AdriansClusterSystem-akka.actor.default-dispat 
cher-3] [Cluster(akka://AdriansClusterSystem)] Cluster Node [akka.tcp://AdriansC 
[email protected]:54824] - Metrics will be retreived from MBeans, and may b 
e incorrect on some platforms. To increase metric accuracy add the 'sigar.jar' t 
o the classpath and the appropriate platform-specific native libary to 'java.lib 
rary.path'. Reason: java.lang.ClassNotFoundException: org.hyperic.sigar.Sigar 
[INFO] [07/31/2013 11:19:36.619] [AdriansClusterSystem-akka.actor.default-dispat 
cher-3] [Cluster(akka://AdriansClusterSystem)] Cluster Node [akka.tcp://AdriansC 
[email protected]:54824] - Metrics collection has started successfully 
[INFO] [07/31/2013 11:19:36.633] [AdriansClusterSystem-akka.actor.default-dispat 
cher-12] [akka://AdriansClusterSystem/user/clusterListener] Current members: 

燁它只是掛在那兒,我不得不關閉SBT窗口終止它。

回答

16

看起來您的種子節點使用ClusterSystem作爲角色系統名稱,但根據您的日誌,您使用AdriansClusterSystem作爲角色系統名稱。嘗試更改種子節點:

seed-nodes = [ 
"akka.tcp://[email protected]:2551", 
"akka.tcp://[email protected]:2552"] 
+2

我現在覺得自己像個白癡。非常感謝,我一直在改變很多設置,並忘記了這一改變。另一雙眼睛總是幫助:) – Adrian