Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Healthcheck option port #620

Open
tguvdamm opened this issue Mar 16, 2019 · 0 comments
Open

Healthcheck option port #620

tguvdamm opened this issue Mar 16, 2019 · 0 comments

Comments

@tguvdamm
Copy link

Hi everyone

I'm researching container orchestration software for my thesis and used the marathon-lb for load-balancing. After three days of figuring out why the load balancer wouldn't work, I found out that using the option "port": 9999 instead of using "portIndex": 0 made it so that haproxy can't reach backend apps on another node. Haproxy could only reach backend apps if they were on the same node. Replacing the port option with the portindex option fixed this. I can't find how or why this would happen.

I don't require any more help, but I thought I'd leave this here for further references.

App definition:

{
  "id": "/iot-api-extended-features",
  "cmd": null,
  "cpus": 0.2,
  "mem": 256,
  "disk": 0,
  "instances": 1,
  "acceptedResourceRoles": [],
  "container": {
    "type": "DOCKER",
    "docker": {
      "forcePullImage": false,
      "image": "xxxx",
      "parameters": [],
      "privileged": false
    },
    "volumes": [],
    "portMappings": [
      {
        "containerPort": 9999,
        "hostPort": 0,
        "labels": {},
        "name": "api",
        "protocol": "tcp",
        "servicePort": 1030
      }
    ]
  },
  "env": {
    "ACTION": "restapi",
    "INFLUX_DB_URL": "http://influxdb.marathon.mesos:31999",
    "INFLUX_DATABASE": "demo",
    "REST_API_PORT": "9999"
  },
  "healthChecks": [
    {
      "gracePeriodSeconds": 15,
      "intervalSeconds": 10,
      "maxConsecutiveFailures": 3,
      "path": "/",
      "portIndex": 0,
      "protocol": "MESOS_HTTP",
      "ipProtocol": "IPv4",
      "timeoutSeconds": 20,
      "delaySeconds": 15
    }
  ],
  "labels": {
    "HAPROXY_GROUP": "thesis"
  },
  "networks": [
    {
      "name": "thesis-network",
      "mode": "container"
    }
  ],
  "portDefinitions": []
}

When "portIndex": 0, is replaced with "port":9999, marathon-lb stops working.

Marathon-lb definition

{
  "id": "/marathon-lb",
  "cmd": null,
  "cpus": 0.25,
  "mem": 256,
  "disk": 0,
  "instances": 1,
  "acceptedResourceRoles": [],
  "container": {
    "type": "DOCKER",
    "docker": {
      "forcePullImage": true,
      "image": "mesosphere/marathon-lb",
      "parameters": [],
      "privileged": false
    },
    "volumes": []
  },
  "env": {
    "PORTS": "9090"
  },
  "portDefinitions": [
    {
      "port": 9090,
      "name": "api",
      "protocol": "tcp"
    }
  ],
  "args": [
    "sse",
    "--group",
    "thesis"
  ]
}
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

1 participant