elasticsearchkibanamesosmarathondcos

Same context path services with different ports on Marathon-lb DCOS


I have deployed elasticsearch and kibana with below application definitions

elasticsearch.json

{
  "id": "elasticsearch",
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "docker.elastic.co/elasticsearch/elasticsearch:6.3.2",
      "network": "BRIDGE",
      "portMappings": [
        { "hostPort": 9200, "containerPort": 9200, "servicePort": 0 },
        { "hostPort": 9300, "containerPort": 9300, "servicePort": 0 }
      ],
      "forcePullImage":true
    }
  },
  "instances": 1,
  "cpus": 1,
  "mem": 3048,
  "labels":{
    "HAPROXY_GROUP":"external",
    "HAPROXY_0_VHOST":"publichost",
    "HAPROXY_0_MODE":"http",
    "DCOS_PACKAGE_NAME": "elasticsearch"
  },
    "env": {
        "ES_JAVA_OPTS": "-Xmx2048m -Xms2048m"
      }
}

Which deploys elasticsearch on "/" context path

kibana.json

{
  "id": "kibana",
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "docker.elastic.co/kibana/kibana:6.3.2",
      "network": "BRIDGE",
      "portMappings": [
        { "hostPort": 5601, "containerPort": 5601, "servicePort":0}
      ],
      "forcePullImage":true
    },
  "volumes": [
   {
        "containerPath": "/usr/share/kibana/config",
        "hostPath": "/home/azureuser/kibana/config",
        "mode": "RW"
   }
]
  },
  "instances": 1,
  "cpus": 0.5,
  "mem": 2000,
  "labels":{
    "HAPROXY_0_VHOST":"publichost",
    "HAPROXY_0_MODE":"http",
    "DCOS_SERVICE_NAME": "kibana",
    "DCOS_SERVICE_SCHEME": "http",
    "DCOS_SERVICE_PORT_INDEX": "0"
  }
}

this also eploys kibana on "/" context path

Then how to access kibana when I try to access http://publichost/app/kibana doesn't work beacuse elasticsearch is on "/"


Solution

  • I did it by removing "HAPROXY_GROUP":"external" from elasticsearch, Now it will not deploy it on marathon-lb and hence wont be accessible via browser.