petabridge / akkadotnet-code-samples

Akka.NET professional reference code samples
http://petabridge.com/blog
Apache License 2.0
547 stars 264 forks source link

Expand WebCrawler README to include docker-compose instructions #70

Closed Aaronontheweb closed 2 years ago

Aaronontheweb commented 6 years ago

https://github.com/petabridge/akkadotnet-code-samples/blob/master/Cluster.WebCrawler/README.md

theladyjaye commented 6 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?

Aaronontheweb commented 6 years ago

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

theladyjaye commented 6 years ago

This helped immensely to read that code.

2 Questions:

  1. Based on the README for that link, it is starting docker with:

-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.

  1. A Cluster port of 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

[[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.