Learn DC/OS with minidcos (4) – Use Marathon LB

In Part II, we deployed a service on the private node and in this part, let me talk about how to use marathon-lb to expose it onto the public node. For more details of Marathon and Marathon-LB, please check here.

Install Marathon-LB

With CLI, it’s easy to install marathon-lb, which is a package of DC/OS.

As you can see, the marathon-lb 1.15.0 is installed successfully. By default, it requires 2 CPU with 1GB memory. You can also adjust it from DC/OS GUI. In my testing, I need to remove “net.ipv4.tcp_max_orphans=60000” from Marathon-LB’s “Sysctl Params“. Otherwise, the service will be brought up.

You will find the marathon-lb service is up and it’s deployed on the public node.

Since marathon-lb uses HAProxy as its backend, we can access the HAProxy statistic panel through http://172.17.0.4:9090/haproxy?stats.

Expose the Nginx Service with Marathon-LB

To expose the nginx service, we can simply add following label “HAPROXY_GROUP: external” tn the configuration.

After relaunching the nginx service, you can access the nginx from public node (172.17.0.4) on service port 10000, which the real service runs on the private node (172.17.0.3).

Reference

发表评论

电子邮件地址不会被公开。 必填项已用*标注