mesosphere / marathon-lb

Marathon-lb is a service discovery & load balancing tool for DC/OS
Apache License 2.0
449 stars 300 forks source link

How i can make system architecture I thought using marathon-lb? #543

Closed mslee89 closed 6 years ago

mslee89 commented 6 years ago

Hi. I want to make system architecture I thought using marathon-lb and mesos-dns. Now, I use this system architecture in company.

User -> AWS Route 53 -> L4 -> VIP -> Real servers

and .. I want to create an environment like this.

User -> AWS Route 53 -> Marathon-BI -> Mesos-DNS(If it need) -> Services in mesos cluster

but, I don't know how to connect between AWS Route 53 and Marathon-BI in mesos cluster. can you help me with this ?

P.S. My English is not good.. so if you don't understand well about my question, tell me.

justinrlee commented 6 years ago

Hi @mslee89, With Marathon-LB, you shouldn't need Mesos-DNS. Marathon-LB looks at Marathon and determines where tasks are running, and sets up haproxy backends pointing at them.

If you have your DC/OS public node running in AWS, then typically what users do is something like the following:

Does this make sense? Thanks, Justin

mslee89 commented 6 years ago

Hello @justinrlee

Thank you for a answer. I understand what you're saying. and.. may i ask you one more?

Should i allocation VIP to servers running marathon-LB for High Availability of marathon-LB if i want to run more than one instance of a marathon-LB?

justinrlee commented 6 years ago

I'm not sure what VIP you're referring to in this context - a VIP within the DC/OS cluster? A VIP that resides on the public agents? Something else?

Either way, you don't need VIPs to use multiple Marathon-LB instances. You just configure them the same (i.e., a single marathon.json definition for marathon-lb with multiple instances configured). They will end up with identical configurations based on various HAPROXY_ labels. You can then put them behind a classic ELB and load balance them that way.

Here's an example: Three DC/OS public agents on public EC2 instances, each with Marathon-LB i-123456, with IP 54.201.10.1 i-234567, with IP 54.201.20.2 i-345678, with IP 54.201.30.3 ELB: justin-abcdef-us-west-2.elb.amazonaws.com, pointing at all three EC2 instances Route53: justin.mywebsite.com, pointing at the ELB through an Alias target

Optionally, additional CNAME pointing at justin.mywebsite.com: app.mywebsite.com

Then, with this, you can tell your users to navigate to app.mywebsite.com (or justin.mywebsite.com), and depending on your Marathon HAPROXY labels, they'll get to corresponding services running on DC/OS.

mslee89 commented 6 years ago

Thank @justinrlee very much for your reply.

And I'm not using AWS(ELB, Route53), But I will use L4 instead of ELB and internal DNS instead of Route 53.

Thanks to your advice, the structure was easy to understand. Thank you very much.