1

I want configure/connect marathon-lp with simple web page running on mesos/maraton.

The final result what I want to obtain is web page running on one IP address and another user question should by distributed to next instance of application.

About my infrastructure

  • three node mesos-master and three mesos-slave,
  • in my LAN infrastrutuce I have DNS ActiveDirectory domain

Now I run example www application in mesos/marathon:

{
  "id": "/example-www/hello-world",
  "cmd": null,
  "cpus": 0.5,
  "mem": 64,
  "disk": 0,
  "instances": 4,
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "tutum/hello-world",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 80,
          "hostPort": 0,
          "servicePort": 10010,
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "privileged": false,
      "parameters": [],
      "forcePullImage": true
    }
  },
  "healthChecks": [
    {
      "path": "/",
      "protocol": "HTTP",
      "portIndex": 0,
      "gracePeriodSeconds": 10,
      "intervalSeconds": 2,
      "timeoutSeconds": 10,
      "maxConsecutiveFailures": 10,
      "ignoreHttp1xx": false
    }
  ],
  "labels": {
    "HAPROXY_GROUP": "external",
    "HAPROXY_0_VHOST": "service.mesosphere.com",
    "HAPROXY_0_BIND_ADDR": "192.168.18.9",
    "HAPROXY_0_PORT": "80"
  },
  "portDefinitions": [
    {
      "port": 10010,
      "protocol": "tcp",
      "labels": {}
    }
  ]
}

This web application works properly - http://oi66.tinypic.com/27y8qco.jpg

Now I want assign this web application IP address for example 192.168.18.9. The application should be available at this address IP. But when I put this address in Web Browser and I refresh the page I should be distributed for all application instance (four instance of web application).

I try configure marathon-lp but I don't know what I do wrong. In one of master node (192.168.18.10) I install dcos and marathon-lb.

My steps:

  • running web application in mesos/marathon

  • in one of mesos-master node (192.168.18.10) where dcos and marathon-lb is installed I create options.json file with content

     {
     "marathon-lb":{
     "name":"example-www/lb",
     "haproxy-group":"example-www",
     "bind-http-https":false,
     "role":""
     }
    }
    

Now when I exercise in ssh console

dcos package install --options=options.json marathon-lb

Status of marathon-lp application is still Waiting - screen

I read marathon-lp documentation, I try fix it for many way but every time the marathon-lp application has waiting status.

What I do wrong? Maybe I don't write required variable when I create option.json file? Or maybe this file is unnecessary?

I will be very thankful for your help.

Arek
  • 89
  • 1
  • 5

1 Answers1

1

Based on your description, it's a little tough to see what's going on. I do, however, notice that you have HAPROXY_0_BIND_ADDR and HAPROXY_0_PORT set on your application as labels. Most likely, the IP you're trying to force HAProxy to bind to doesn't actually exist on any interface on your agents (slaves).

Generally speaking, you wouldn't force HAProxy to bind to an IP in this fashion. You also wouldn't use HAPROXY_0_PORT except for exceptional cases.

I suggest you read through the documentation, and these blog posts to get an understanding of how MLB is meant to be used:

https://mesosphere.com/blog/2015/12/04/dcos-marathon-lb/ https://mesosphere.com/blog/2015/12/13/service-discovery-and-load-balancing-with-dcos-and-marathon-lb-part-2/

I also noticed that the contents of your screenshot does not match what you described in the options.json for marathon-lb. Because of this, I must assume that you didn't launch MLB with that options.json. If you could get the actual app definition from Marathon, perhaps it'll be obvious what's wrong. My first guess is that the "bind-http-https":false and "role":"" values aren't set.

Good luck!