Re: [akka-user] 2.4-SNAPSHOT Did bind-hostname/bind-port functionality change?

129 views
Skip to first unread message

Viktor Klang

unread,
Apr 14, 2015, 6:08:20 AM4/14/15
to Akka User List
Hi Greg,

have you verified that the configuration is applied to the application?

On Tue, Apr 14, 2015 at 10:13 AM, tigerfoot <gzo...@gmail.com> wrote:
Hello,

I had a working demo of Akka remoting working in a Docker container.  I ran my server in Docker and was able to communicate with it from an external program.  My application.conf looked like this:

akka {
loglevel = "ERROR"
stdout-loglevel = "ERROR"
loggers = ["akka.event.slf4j.Slf4jLogger"]
actor {
provider = akka.remote.RemoteActorRefProvider
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
# Internal addr
bind-hostname = localhost # also tried 127.0.0.1
bind-port     = 2551

# External Docker addr
hostname = "172.16.240.141"
port = 9100
}
}
}

Boxed up I run my container like this (to map ports)--the web port mapping works fine:

docker run -it -p 9100:2551 -p 9101:8080 --name dexp localhost:5000/root


My client tries to connect to it like this:

    val c = ConfigFactory parseString """akka {

      actor {

        provider = "akka.remote.RemoteActorRefProvider"

      }

      remote {

        enabled-transports = ["akka.remote.netty.tcp"]

        netty.tcp {

          hostname = "localhost"

          port     = 5151

        }

      }

    }"""

    

  val sys = ActorSystem( "boom", c )

  val actor = sys.actorSelection("akka.tcp://dock...@172.16.240.141:9100/user/dockerexp")

  println("Actor: "+actor)

  implicit val timo = Timeout(5.seconds)

  try { 

    println( Await.result( (actor ? "hey").asInstanceOf[Future[String]], 15.seconds) )

  } finally {

    println("Dying...")

    Thread.sleep(5000)

    sys.shutdown()

  }


This isn't working anymore--just times out and dies.  It did work several months ago when 2.4-SNAPSHOT was first available.  Am I doing something wrong?

Thanks,
Greg

--
>>>>>>>>>> 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+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,

Martynas Mickevičius

unread,
Apr 16, 2015, 8:20:46 AM4/16/15
to akka...@googlegroups.com
On Tue, Apr 14, 2015 at 1:07 PM, Viktor Klang <viktor...@gmail.com> wrote:
Hi Greg,

have you verified that the configuration is applied to the application?

On Tue, Apr 14, 2015 at 10:13 AM, tigerfoot <gzo...@gmail.com> wrote:
Hello,

I had a working demo of Akka remoting working in a Docker container.  I ran my server in Docker and was able to communicate with it from an external program.  My application.conf looked like this:

akka {
loglevel = "ERROR"
stdout-loglevel = "ERROR"
loggers = ["akka.event.slf4j.Slf4jLogger"]
actor {
provider = akka.remote.RemoteActorRefProvider
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
# Internal addr
bind-hostname = localhost # also tried 127.0.0.1

You are binding to the localhost which docker does not forward connections to. Bind to either the IP address provided by docker if you know it, or to ${HOSTNAME} environment variable, or to 0.0.0.0 to bind to all interfaces.



--
Martynas Mickevičius
TypesafeReactive Apps on the JVM
Reply all
Reply to author
Forward
0 new messages