I think I may have realised one part of my mistake, 
the "akka.remote.netty.tcp.hostname" needs to be set to the hostname of the 
machine that the application is running on, so that the remote nodes can 
talk back to it.

Now that I've changed that, I'm successfully starting up the application, 
but its still failing to register with the seed nodes on the first machine. 
For example :

[info] [WARN] [03/17/2016 00:56:07.070] 
[ClusterSystem-akka.remote.default-remote-dispatcher-21] 
[akka.tcp://ClusterSyst
em@GLA-ENG-2146NX1:12349/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40Scott-PC%3A2552-
1] Association with remote system [akka.tcp://ClusterSystem@Scott-PC:2552] 
has failed, address is now gated for [5000] m
s. Reason: [Association failed with 
[akka.tcp://ClusterSystem@Scott-PC:2552]] Caused by: [connection timed out: 
Scott-PC
/192.168.0.2:2552]
[info] [WARN] [03/17/2016 00:56:17.371] 
[ClusterSystem-akka.remote.default-remote-dispatcher-22] 
[akka.tcp://ClusterSyst
em@GLA-ENG-2146NX1:12349/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40Scott-PC%3A2551-
0] Association with remote system [akka.tcp://ClusterSystem@Scott-PC:2551] 
has failed, address is now gated for [5000] m
s. Reason: [Association failed with 
[akka.tcp://ClusterSystem@Scott-PC:2551]] Caused by: [connection timed out: 
Scott-PC
/192.168.0.2:2551]
[info] [WARN] [03/17/2016 00:56:27.171] 
[ClusterSystem-akka.remote.default-remote-dispatcher-21] 
[akka.tcp://ClusterSyst
em@GLA-ENG-2146NX1:12349/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40Scott-PC%3A2552-
1] Association with remote system [akka.tcp://ClusterSystem@Scott-PC:2552] 
has failed, address is now gated for [5000] m
s. Reason: [Association failed with 
[akka.tcp://ClusterSystem@Scott-PC:2552]] Caused by: [connection timed out: 
Scott-PC
/192.168.0.2:2552]
[info] [WARN] [03/17/2016 00:56:42.229] 
[ClusterSystem-akka.remote.default-remote-dispatcher-22] 
[akka.tcp://ClusterSyst
em@GLA-ENG-2146NX1:12349/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40Scott-PC%3A2551-
0] Association with remote system [akka.tcp://ClusterSystem@Scott-PC:2551] 
has failed, address is now gated for [5000] m
s. Reason: [Association failed with 
[akka.tcp://ClusterSystem@Scott-PC:2551]] Caused by: [connection timed out: 
Scott-PC
/192.168.0.2:2551]
[info] [WARN] [03/17/2016 00:56:47.272] 
[ClusterSystem-akka.remote.default-remote-dispatcher-22] 
[akka.tcp://ClusterSyst
em@GLA-ENG-2146NX1:12349/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40Scott-PC%3A2552-
1] Association with remote system [akka.tcp://ClusterSystem@Scott-PC:2552] 
has failed, address is now gated for [5000] m
s. Reason: [Association failed with 
[akka.tcp://ClusterSystem@Scott-PC:2552]] Caused by: [connection timed out: 
Scott-PC
/192.168.0.2:2552]



On Thursday, 17 March 2016 00:25:06 UTC, Scott Mackie wrote:
>
> Hi folks,
>
> I've been taking a look at the clustering sample project provided with 
> the Typesafe Activator 
> <http://www.lightbend.com/activator/template/akka-sample-cluster-scala>, 
> and I'm having some trouble with joining a remotely running cluster.
>
> I've got the project set up on two machines, the first machine has two 
> instances of the "SimpleClusterApp" running. The consoles for these two 
> processes is showing what I'd expect, membership messages showing that both 
> nodes are on the cluster.
>
> I wanted to see if I could connect a third instance of this from the 
> second machine, but I can't get the config right. In the application.conf 
> file, I've got the following:
>
> akka {
>   actor {
>     provider = "akka.cluster.ClusterActorRefProvider"
>   }
>   remote {
>     log-remote-lifecycle-events = off
>     netty.tcp {
>       hostname = "Scott-PC"
>       port = 0
>     }
>   }
>
>   cluster {
>     seed-nodes = [
>       "akka.tcp://ClusterSystem@Scott-PC:2551",
>       "akka.tcp://ClusterSystem@Scott-PC:2552"]
>
>     auto-down-unreachable-after = 10s
>   }
> }
>
> # Disable legacy metrics in akka-cluster.
> akka.cluster.metrics.enabled=off
>
> # Enable metrics extension in akka-cluster-metrics.
> akka.extensions=["akka.cluster.metrics.ClusterMetricsExtension"]
>
> # Sigar native library extract location during tests.
> # Note: use per-jvm-instance folder when running multiple jvm on one host. 
>
> akka.cluster.metrics.native-library-extract-folder=${user.dir}/target/native
>
>
> Where Scott-PC is the hostname of the machine running the first two 
> processes. The two parts that I've changed here are the 
> "akka.remote.netty.tcp.hostname" and the "cluster.seed-nodes" properties 
> (to use the other machine's hostname).
>
> When I try to run a new process on the second machine I get the following 
> output:
>
> PS C:\Users\smackie\akka-sample-cluster-java> .\activator "runMain 
> sample.cluster.simple.SimpleClusterApp 2551"
> [info] Loading project definition from 
> C:\Users\smackie\akka-sample-cluster-java\project
> [info] Set current project to akka-sample-cluster-java (in build 
> file:/C:/Users/smackie/akka-sample-cluster-java/)
> [info] Running sample.cluster.simple.SimpleClusterApp 2551
> [info] [INFO] [03/17/2016 00:10:18.495] [main] [akka.remote.Remoting] 
> Starting remoting
> [info] [ERROR] [03/17/2016 00:10:18.799] 
> [ClusterSystem-akka.remote.default-remote-dispatcher-5] 
> [NettyTransport(akka://
> ClusterSystem)] failed to bind to Scott-PC/192.168.0.2:2551, shutting 
> down Netty transport
> [error] Exception in thread "main" 
> org.jboss.netty.channel.ChannelException: Failed to bind to: Scott-PC/
> 192.168.0.2:255
> 1
> [error]         at 
> org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
> [error]         at 
> akka.remote.transport.netty.NettyTransport$$anonfun$listen$1.apply(NettyTransport.scala:410)
> [error]         at 
> akka.remote.transport.netty.NettyTransport$$anonfun$listen$1.apply(NettyTransport.scala:406)
> [error]         at scala.util.Success$$anonfun$map$1.apply(Try.scala:237)
> [error]         at scala.util.Try$.apply(Try.scala:192)
> [info] [INFO] [03/17/2016 00:10:18.808] 
> [ClusterSystem-akka.remote.default-remote-dispatcher-6] 
> [akka://ClusterSystem/sy
> stem/remoting-terminator] Shutting down remote daemon.
> [error]         at scala.util.Success.map(Try.scala:237)
> [error]         at 
> scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
> [info] [INFO] [03/17/2016 00:10:18.810] 
> [ClusterSystem-akka.remote.default-remote-dispatcher-6] 
> [akka://ClusterSystem/sy
> stem/remoting-terminator] Remote daemon shut down; proceeding with 
> flushing remote transports.
> [error]         at 
> scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
> [error]         at 
> scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
> [error]         at 
> akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
> [error]         at 
> akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
> [info] [INFO] [03/17/2016 00:10:18.812] 
> [ClusterSystem-akka.remote.default-remote-dispatcher-6] 
> [akka://ClusterSystem/sy
> stem/remoting-terminator] Remoting shut down.
> [error]         at 
> akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
> [info] [ERROR] [03/17/2016 00:10:18.813] 
> [ClusterSystem-akka.remote.default-remote-dispatcher-5] 
> [akka.remote.Remoting]
> Remoting system has been terminated abrubtly. Attempting to shut down 
> transports
> [error]         at 
> akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
> [error]         at 
> scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
> [error]         at 
> akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90)
> [error]         at 
> akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39)
> [error]         at 
> akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:399)
> [error]         at 
> scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
> [error]         at 
> scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
> [error]         at 
> scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
> [error]         at 
> scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
> [error] Caused by: java.net.BindException: Cannot assign requested 
> address: bind
> [error]         at sun.nio.ch.Net.bind0(Native Method)
> [error]         at sun.nio.ch.Net.bind(Net.java:433)
> [error]         at sun.nio.ch.Net.bind(Net.java:425)
> [error]         at 
> sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
> [error]         at 
> sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
> [error]         at 
> org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
> [error]         at 
> org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
>
> [error]         at 
> org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
> [error]         at 
> org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
> [error]         at 
> org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
> [error]         at 
> org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
> [error]         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> [error]         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> [error]         at java.lang.Thread.run(Thread.java:745)
> java.lang.RuntimeException: Nonzero exit code returned from runner: 1
>         at scala.sys.package$.error(package.scala:27)
> [trace] Stack trace suppressed: run last compile:runMain for the full 
> output.
> [error] (compile:runMain) Nonzero exit code returned from runner: 1
> [error] Total time: 1 s, completed Mar 17, 2016 12:10:18 AM
>
> Any idea what I'm doing wrong?
>
> Thanks,
> Scott
>
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to