Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Let user specify network name for autoscaling in Docker Swarm #84

Open
1 of 2 tasks
vicary opened this issue Oct 29, 2018 · 2 comments
Open
1 of 2 tasks

Let user specify network name for autoscaling in Docker Swarm #84

vicary opened this issue Oct 29, 2018 · 2 comments
Assignees

Comments

@vicary
Copy link

vicary commented Oct 29, 2018

Make sure you read and understand http://emqtt.io/docs/v2/index.html.
Use one of the two templates below and delete the rest.

  • BUG REPORT
  • FEATURE REQUEST

FEATURE REQUEST

Missing feature

Able to specify a network interface in env var, then start.sh or cluster.sh uses the specified network to resolve the default IP into $LOCAL_IP.

devOps should be able to dynamically allocate EMQ_HOST or EMQ_NODE__NAME in a deterministic way, since Docker services with multiple networks will attach interfaces in random order.

Justification

With multiple networks attached, the current way to get LOCAL_IP in start.sh is not deterministic; While IP is generated after the container is spawn.

Workarounds

Are there any workarounds you currently have in place because the feature is missing?

In short, no.

The overlay network address is load balanced and cannot resolve single nodes, individual nodes spawned need a way to resolve their own unique address correctly, especially when there are more than one interface and/or IP available.

@ozbillwang
Copy link

ozbillwang commented Dec 22, 2019

@vicary

Did you get any solution on it?

The exist solution to join cluster, doesn't really work.

For example, I have aws load balancer,

DNS (q.mqtt.com) -> aws elb (8883) -> ssl offload |-> node1 (1883)
                                                  |-> node2 (1883)

What cluster should I join? DNS name, elb end point, or others?

Second, the note for cluster

Note: You must publsh port 4369 and range of port 6000-6999 for EMQ Clustered.

So does it mean I have to open multiple port , 4369 and 6000-6999 on elb ? Currently aws elb doesn't support to listen multiple ports. I have to set the port redirection one by one

@vicary
Copy link
Author

vicary commented Jan 13, 2020

@ozbillwang Not sure if you're spawning them in docker swarm. If so, ELB may not be able to route inside the swarm ingress network. You could either use host networking for your containers, or spin up something like Traefik to route external connections from ELB to container IP's or service networks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants