Closed Aaronontheweb closed 2 years ago
The docker-compose file specifies:
environment:
CLUSTER_SEEDS: "akka.tcp://webcrawler@lighthouse:4053"
CLUSTER_IP: webcrawler.crawlservice
CLUSTER_PORT: 0
Searching though the codebase, where are these read and applied to the hocon.config
?
Hi @aventurella,
I'll need to include this in the updated docs too - those values are read from our Akka.Bootstrap library: https://github.com/petabridge/akkadotnet-bootstrap/tree/dev/src/Akka.Bootstrap.Docker
This helped immensely to read that code.
2 Questions:
-e CLUSTER_SEEDS='akka.tcp://dread@172.17.0.3:4053'
. I assume that IP is the container's IP, aka the result of get-dockerip.sh
that started the Lighthouse.
0
means it's going to bind to a random port inside the container. The README shows it mapping -p 5044:5011
, so I assume the CLUSTER_PORT of dread.collector
is 5011?BONUS It might just be my code, I'm looking into it, but it seems if I start 2 Lighthouses in the same docker container, things get weird and other nodes becomes unreachable. However, if I only start 1 lighthouse, everything runs smooth, no unreachable nodes. Anyway, I figured I would ask just in case there was some known thing: OH YA! Don't do that, run 1 lighthouse per container.
AMENDMENT
If I start up 2 Lighthouses, NOT in docker, everything runs as expected.
If I start up 2 Lighthouses inside the same container in Docker, the second one breaks*
If I start up 2 Lighthouses in separate containers, it's the same problem as starting them up in the same container
Breaks here means: The second Lighthouse fails to register with the cluster..
[[akka://Attraction/system/cluster/core/daemon/joinSeedNodeProcess-1#1499972846]] Couldn't join seed nodes after [18] attempts, will try again. seed-nodes=[akka.tcp://MySystem@172.23.0.2:4053]
So that's why.. now I just need to figure out why it works sometimes and not others
It's definitely a docker issue... I can shell into Lighthouse #2
and ping 172.23.0.2
and I get a response, so it's reachable.. I can also, from Lighthouse #2
telnet to 172.23.0.2:4053
and enter a character and see Lighthouse #1
respond and disconnect me with DotNetty.Codecs.TooLongFrameException:
which I would expect since I'm definitely not entering anything like it would be expecting from the command line.
https://github.com/petabridge/akkadotnet-code-samples/blob/master/Cluster.WebCrawler/README.md