marathon-lb icon indicating copy to clipboard operation
marathon-lb copied to clipboard

marathon-lb only first marathon

Open SergejFrank opened this issue 6 years ago • 5 comments

Marathon-LB v1.11.2 marathon-lb ignores the second marathon

defindes multiple marathons via -m http://example1.marathon.com:8080 http://example2.marathon.com:8080

no matter which i put second is getting ignored

SergejFrank avatar Jan 25 '18 15:01 SergejFrank

Marathon-LB does not currently support multiple Marathon instances. Are these distinct Marathon instances or are they multiple identical Marathon instances?

Typically, users use multiple Marathon-LB instance if they have multiple Marathon instances.

justinrlee avatar Feb 06 '18 19:02 justinrlee

I use distinct Marathon instances

The help page said it is possible

--marathon MARATHON [MARATHON ...], -m MARATHON [MARATHON ...] [required] Marathon endpoint, eg. -m http://marathon1:8080 http://marathon2:8080

SergejFrank avatar Feb 08 '18 11:02 SergejFrank

Hi @SergejFrank,

Yes, we could probably clarify that a little bit. That's used for connecting to multiple instances of Marathon in a marathon cluster, and is intended to help with HA - if one Marathon instance stops responding, it'll use the next.

You can see the code for this here: https://github.com/mesosphere/marathon-lb/blob/master/marathon_lb.py#L167-L198

I'm curious about your use case. You have multiple distinct Marathon instances, and you want them all exposed by a single Marathon-LB instance? Just off the top of my head, I think a default setup of that would cause a lot of port conflicts, cause there's no guarantee of unique ports across different Marathon instances. You could probably work around this but it's not something that's been heavily investigated, I believe.

Thanks, Justin

justinrlee avatar Feb 08 '18 13:02 justinrlee

I have the same problem for marathon-lb v1.12 。 That marathon cluster have Three nodes : 10.0.0.1 10.0.0.3 10.0.0.5 then leader is 10.0.0.1 marathon-lb config : "args": ["sse", "-m", "http://10.0.0.1:8081", "-m", "http://10.0.0.3:8081", "-m", "http://10.0.0.5:8081", "--group", "web" ]

error: 2018-04-17 07:03:48,464 marathon_lb: SSE Active, trying fetch events from http://10.0.0.5:8081/v2/events?plan-format=light&event_type=status_update_event&event_type=health_status_changed_event&event_type=api_post_event 2018-04-17 07:03:48,471 marathon_lb: Caught exception Traceback (most recent call last): File "/marathon-lb/marathon_lb.py", line 2079, in for event in events: File "/marathon-lb/marathon_lb.py", line 244, in iter_events for line in stream.iter_lines(): File "/marathon-lb/utils.py", line 241, in _split_lines_from_chunks for chunk in chunks: File "/marathon-lb/utils.py", line 219, in _iter_chunks self._check_status_code() File "/marathon-lb/utils.py", line 206, in _check_status_code raise Exception(str(self.status_code) + ' ' + self.url)

thinks

zhanglt avatar Apr 17 '18 07:04 zhanglt

Hello all

@justinrlee I have this use case too. I use multiple instances of marathon to separate the scope of devops team. Each app is published with the http frontend and the LABEL : HAPROXY_{n}_VHOST on my public slaves Service port conflict is not a matter in this case.

Having a dedicated public slave for each teams is not usefull and i would love if all this app could be served by the same joker name in DNS *.elb.mydomain

Is something strange on my use case?

J-D-Z avatar May 02 '18 22:05 J-D-Z